Easy3D 2.5.3
SurfaceMeshComponent Class Reference

A connected component of a SurfaceMesh. More...

#include <easy3d/algo/surface_mesh_components.h>

Public Types

typedef SurfaceMesh::Face Face
 
typedef SurfaceMesh::Vertex Vertex
 
typedef SurfaceMesh::Edge Edge
 
typedef SurfaceMesh::Halfedge Halfedge
 

Public Member Functions

 SurfaceMeshComponent (SurfaceMesh *mesh)
 
const std::vector< Face > & faces () const
 
const std::vector< Vertex > & vertices () const
 
const std::vector< Edge > & edges () const
 
const std::vector< Halfedge > & halfedges () const
 
std::size_t n_faces () const
 
std::size_t n_vertices () const
 
std::size_t n_edges () const
 
std::size_t n_halfedges () const
 
SurfaceMeshmesh () const
 
float area () const
 
float border_length () const
 
Box3 bbox () const
 
void translate (const vec3 &offset)
 
SurfaceMeshto_mesh () const
 

Static Public Member Functions

static std::vector< SurfaceMeshComponentextract (SurfaceMesh *mesh, bool descending=true)
 
static SurfaceMeshComponent extract (SurfaceMesh *mesh, SurfaceMesh::Face seed)
 
static SurfaceMeshComponent extract (SurfaceMesh *mesh, SurfaceMesh::Vertex seed)
 

Detailed Description

A connected component of a SurfaceMesh.

Internally, A connected component of a SurfaceMesh stores four lists of SurfaceMesh elements, i.e., vertices, faces, edges, and halfedges.

Member Function Documentation

◆ area()

float area ( ) const

Returns the surface area of this component. Internally it triangulates the face using the tessellator. So this method also works for concave faces.

◆ bbox()

Box3 bbox ( ) const

Returns the bounding box of this component.

◆ border_length()

float border_length ( ) const

Returns the total border length of this component.

◆ extract() [1/3]

std::vector< SurfaceMeshComponent > extract ( SurfaceMesh mesh,
bool  descending = true 
)
static

Extracts connected components. The components are sorted in descending order if descending is true (in terms of number of faces.

Examples
Tutorial_204_Viewer_Qt.

◆ extract() [2/3]

SurfaceMeshComponent extract ( SurfaceMesh mesh,
SurfaceMesh::Face  seed 
)
static

Extracts a single connected component from the seed face

◆ extract() [3/3]

SurfaceMeshComponent extract ( SurfaceMesh mesh,
SurfaceMesh::Vertex  seed 
)
static

Extracts a single connected component from the seed vertex

◆ mesh()

SurfaceMesh * mesh ( ) const
inline

Returns the surface mesh to which this component belongs.

◆ to_mesh()

SurfaceMesh * to_mesh ( ) const

Constructs a surface mesh from this component.

◆ translate()

void translate ( const vec3 offset)

Translates this component by an offset vector.


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