-
|
I have a custom repairing pipeline for my triangular mesh that produces a manifold. As a byproduct, it has all the connectivity information needed to construct half edge mesh: map of incident faces for each canonical edge, vertex "stars" and border loops. After repairing, I want to use some CGAL functions, so I need to convert it to Surface_mesh, and that conversion must be as fast as possible, meaning that I want to do that conversion linearly and preallocate all the memory it requires. I am not a CGAL guru in the sense that I am not very familiar with its internal structure, therefore, I need some help to figure out where to start. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
I suggest to try to use |
Beta Was this translation helpful? Give feedback.
-
|
what would be the signature of the function you'd like to use then? |
Beta Was this translation helpful? Give feedback.
-
|
I'm very curious to see how you designed your repair pipeline such that the performance bottleneck is the mesh creation. Anyway, you first need to create the Then you need to add the vertices and set the points. For that you need to use Then you need to create edges are link them together and to incident faces. Then you need to add faces. You can use I don't know what information exactly you have but if you only have edge->face connected and no edge connection, it might be better to first create faces so that you can associate the halfedges while creating them. halfedges will need to be linked together using halfedges and faces also need to be associated using With all that done you should be done. |
Beta Was this translation helpful? Give feedback.
I'm very curious to see how you designed your repair pipeline such that the performance bottleneck is the mesh creation.
Anyway, you first need to create the
Surface_meshand allocate memory. For that you can usereserve().Then you need to add the vertices and set the points. For that you need to use
add_vertex().Then you need to create edges are link them together and to incident faces.
To add an edge, you can use
add_edge(). Note that it is important to add edges only once. The function will return a halfedge, corresponding to the oriented edge, pointing in one of the two (at most) incident faces.Then you need to add faces. You can use
add_face().I don't know what information exactl…