-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add C bindings for Triangulate() (#1034)
* Adds C bindings for Triangulate() * Triangulate() returns a std::vector<ivec3>, which I tried to respect. Since ivec3 is 3 int's, I have manifold_triangulation_tri_verts(void *mem, ...) copy assuming mem has space for 3 * num_tri int's * NOTE: manifoldc.cpp now includes "manifold/polygon.h" * NOTE: I couldn't figure out manifold_destruct_triangulation(...) Also, I don't understand the use case(s) of the destruct functions (literally don't understand; I am sure they exist) * Usage code: ``` ManifoldTriangulation *triangulation = manifold_triangulate(manifold_alloc_triangulation(), polygons, epsilon); size_t num_tri = manifold_triangulation_num_tri(triangulation); int *tri_verts = (int *) manifold_triangulation_tri_verts(malloc(num_tri * 3 * sizeof(int)), triangulation); manifold_delete_triangulation(triangulation); ``` * fixing formatting * fix destruct * add triangulation CBIND test --------- Co-authored-by: pca006132 <[email protected]>
- Loading branch information
1 parent
e7e0780
commit ee32b30
Showing
6 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters