Easy3D 2.6.1
Loading...
Searching...
No Matches
SelfIntersection Class Reference

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.
 

Detailed Description

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.

Member Function Documentation

◆ detect()

std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > detect ( SurfaceMesh * mesh,
bool construct = false )

Detect intersecting face pairs.

Parameters
meshThe input mesh.
constructIf true, also construct the intersecting geometry.
Returns
The intersecting face pairs.

◆ remesh()

bool remesh ( SurfaceMesh * mesh,
bool stitch )

Detect and remesh the intersecting faces.

Parameters
meshThe input mesh. If self-intersection exists, it carries the remeshed model. Otherwise, it remains unchanged.
stitchIf true, stitch the borders.
Returns
true if remesh actually occurred (i.e., self-intersection was detected).

The documentation for this class was generated from the following files: