meshcut icon indicating copy to clipboard operation
meshcut copied to clipboard

Returning both halves of the mesh

Open themmes opened this issue 7 years ago • 1 comments

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!

themmes avatar Oct 17 '18 15:10 themmes

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.

julienr avatar Oct 18 '18 08:10 julienr