Easy3D 2.5.3
|
Detects and resolves self-intersection for surface mesh. More...
#include <easy3d/algo_ext/self_intersection.h>
Public Member Functions | |
std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > | detect (SurfaceMesh *mesh, bool construct=false) |
Detect intersecting face pairs. More... | |
bool | remesh (SurfaceMesh *mesh, bool stitch) |
Detect and remesh the intersecting faces. More... | |
Detects and resolves self-intersection for surface mesh.
Given a triangle mesh compute a new mesh which is the same as the input mesh except that any self-intersecting triangles have been subdivided (new vertices and face created) so that the self-intersection contour lies exactly on edges in the the new mesh. New vertices will appear in original faces or on original edges. New vertices on edges are "merged" only across original faces sharing that edge. This means that if the input triangle mesh is a closed manifold the output will be too.
Known issues: If an existing edge lies exactly on another face then any resulting additional vertices along that edge may not get properly connected so that the output mesh has the same global topology.
std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > detect | ( | SurfaceMesh * | mesh, |
bool | construct = false |
||
) |
Detect intersecting face pairs.
mesh | The input mesh. |
construct | If true, also construct the intersecting geometry. |
bool remesh | ( | SurfaceMesh * | mesh, |
bool | stitch | ||
) |
Detect and remesh the intersecting faces.
mesh | The input mesh. If self intersection exists, it carries the remeshed model. Otherwise it remains unchanged. |
stitch | Stitch the borders |
true
if remesh actually occurred (i.e., self intersection was detected).