Reputation: 149
I have a set of 3D polygonal meshes created with some CGAL algorithms (KSR in my case) and want to compute some metrics on them. However, some Polygon_Mesh_Processing
functions that I would need to use, such as corefine_and_compute_intersection()
require using triangle meshes as input.
When looking at the documentation, I found no direct conversion from polygonal meshes to triangle meshes.
A workaround maybe to build a constrained Delaunay Triangulation on the input polygonal mesh to transform it into a triangle mesh, where each edge in the input mesh becomes a constraint for building the triangular mesh, but it seems to me that this conversion may not provide strong guaranties to preserve the input 3D shape of the polygon mesh.
Is there an easier way to do this conversion? Otherwise, would the proposed workaround be a good-enough approximation of the 3D input polygon mesh?
Below is an example of a polygon mesh that I want to convert to a triangle mesh.
OFF
27 12 0
252.119 869.843 15.3141
252.119 870.199 15.3383
252.119 870.199 6.67102
252.119 841.171 6.70329
252.119 840.481 6.70406
252.119 840.5 13.052
252.119 841.146 13.1018
252.119 841.145 13.3589
241.329 843.177 17.0008
241.265 843.02 17.0107
237.412 843.914 18.3228
235.989 844.182 18.8032
235.981 844.184 18.8058
235.993 844.244 18.8059
236.001 844.242 18.8032
241.393 870.199 18.821
224.468 870.199 13.3111
224.468 870.199 6.65948
224.468 846.894 14.8711
224.468 846.894 14.9021
224.468 846.382 14.9362
224.468 846.382 14.9054
224.468 846.414 6.68592
224.468 846.868 6.68542
224.468 838.791 6.6944
235.445 844.332 6.69282
252.119 838.791 6.70594
8 7 6 5 4 3 2 1 0
11 15 14 13 12 11 10 9 8 7 0 1
5 17 16 15 1 2
4 14 15 16 18
8 23 22 21 20 19 18 16 17
5 26 4 25 22 24
7 12 20 21 22 25 10 11
5 9 10 25 4 5
4 8 9 5 6
3 6 7 8
4 13 14 18 19
4 19 20 12 13
Upvotes: 0
Views: 30
Reputation: 6293
You can use function CGAL::Polygon_mesh_processing::triangulate_faces()
to triangulate your polygonal faces
Upvotes: 3