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

Enumerates connected components for a surface mesh. More...

#include <easy3d/algo/surface_mesh_enumerator.h>

Static Public Member Functions

static int enumerate_connected_components (SurfaceMesh *mesh, SurfaceMesh::VertexProperty< int > id)
 Enumerates the connected components of a surface mesh from its vertices.
 
static int enumerate_connected_components (SurfaceMesh *mesh, SurfaceMesh::FaceProperty< int > id)
 Enumerates the connected components of a surface mesh from its faces.
 
static void propagate_connected_component (SurfaceMesh *mesh, SurfaceMesh::VertexProperty< int > id, SurfaceMesh::Vertex seed, int cur_id)
 Propagates a connected component of a surface mesh from the seed vertex.
 
static void propagate_connected_component (SurfaceMesh *mesh, SurfaceMesh::FaceProperty< int > id, SurfaceMesh::Face seed, int cur_id)
 Propagates a connected component of a surface mesh from the seed face.
 
static int enumerate_planar_components (SurfaceMesh *mesh, SurfaceMesh::FaceProperty< int > id, float angle_threshold=1.0f)
 Enumerates planar patches.
 
static void propagate_planar_component (SurfaceMesh *mesh, SurfaceMesh::FaceProperty< int > id, SurfaceMesh::Face seed, int cur_id, float angle_threshold)
 Propagates a planar patch from the seed face.
 

Detailed Description

Enumerates connected components for a surface mesh.

Member Function Documentation

◆ enumerate_connected_components() [1/2]

int enumerate_connected_components ( SurfaceMesh * mesh,
SurfaceMesh::FaceProperty< int > id )
static

Enumerates the connected components of a surface mesh from its faces.

Parameters
meshThe input mesh.
idThe face property storing the result.
Returns
The number of connected components.

◆ enumerate_connected_components() [2/2]

int enumerate_connected_components ( SurfaceMesh * mesh,
SurfaceMesh::VertexProperty< int > id )
static

Enumerates the connected components of a surface mesh from its vertices.

Parameters
meshThe input mesh.
idThe vertex property storing the result.
Returns
The number of connected components.

◆ enumerate_planar_components()

int enumerate_planar_components ( SurfaceMesh * mesh,
SurfaceMesh::FaceProperty< int > id,
float angle_threshold = 1.0f )
static

Enumerates planar patches.

Parameters
meshThe input mesh.
idThe vertex property storing the result.
angle_thresholdTwo faces sharing a common edge are considered coplanar if the dihedral angle is smaller than angle_threshold (in degrees).
Returns
The number of connected components.

◆ propagate_connected_component() [1/2]

void propagate_connected_component ( SurfaceMesh * mesh,
SurfaceMesh::FaceProperty< int > id,
SurfaceMesh::Face seed,
int cur_id )
static

Propagates a connected component of a surface mesh from the seed face.

Parameters
meshThe input mesh.
idThe face property storing the result.
seedThe seed face from which the connected component will be propagated.
cur_idThe index of the connected component to be propagated.
Attention
The face property id must be initialized with "-1".

◆ propagate_connected_component() [2/2]

void propagate_connected_component ( SurfaceMesh * mesh,
SurfaceMesh::VertexProperty< int > id,
SurfaceMesh::Vertex seed,
int cur_id )
static

Propagates a connected component of a surface mesh from the seed vertex.

Parameters
meshThe input mesh.
idThe vertex property storing the result.
seedThe seed vertex from which the connected component will be propagated.
cur_idThe index of the connected component to be propagated.
Attention
The vertex property id must be initialized with "-1".

◆ propagate_planar_component()

void propagate_planar_component ( SurfaceMesh * mesh,
SurfaceMesh::FaceProperty< int > id,
SurfaceMesh::Face seed,
int cur_id,
float angle_threshold )
static

Propagates a planar patch from the seed face.

Parameters
meshThe input mesh.
idThe face property storing the result.
seedThe seed face from which the planar patch will be propagated.
cur_idThe index of the connected component to be propagated.
angle_thresholdTwo faces sharing a common edge are considered coplanar if the dihedral angle is smaller than angle_threshold (in degrees).
Precondition
The face normal property (with name "f:normal") must exist and be up to date.
Attention
The face property id must be initialized with "-1".

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