meshcut
meshcut copied to clipboard
Returning both halves of the mesh
Is it possible for meshcut to return the both halves as closed manifolds? Or would I have to adapt the code? If so, could you point me in the right direction of where to start?
Thanks in advance!
The code would need adaptation for this. The reason is that the current implementation works by picking a starting triangle and then explores neighbouring triangles that are intersected by the cut plane. For each intersected triangle, it then computes the 'triangle-plane' intersection (either a node or a line), appends this to a list and moves on. So it doesn't visit all triangles and therefore it doesn't have a notion of the both halves.
I am not sure what would be the best algorithm to extract both halves. One naive approach would be to compute the signed distance to the cut plane for each triangle and you can then easily split them in two groups (below and above). The difficulty is then in closing the two parts so they are manifold. I think mesh closing can be a somewhat hairy issue, but maybe you could use something like cgal to close the mesh.