Easy3D 2.6.1
|
Detects and resolves self-intersection for surface mesh. More...
#include <easy3d/algo_ext/self_intersection.h>
Public Member Functions | |
SelfIntersection () | |
Constructor for SelfIntersection. | |
~SelfIntersection () | |
Destructor for SelfIntersection. | |
std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > | detect (SurfaceMesh *mesh, bool construct=false) |
Detect intersecting face pairs. | |
bool | remesh (SurfaceMesh *mesh, bool stitch) |
Detect and remesh the intersecting faces. | |
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 faces created) so that the self-intersection contour lies exactly on edges in 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 | If true, stitch the borders. |
true
if remesh actually occurred (i.e., self-intersection was detected).