Easy3D 2.5.3
|
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 |
SurfaceMesh * | mesh () const |
float | area () const |
float | border_length () const |
Box3 | bbox () const |
void | translate (const vec3 &offset) |
SurfaceMesh * | to_mesh () const |
Static Public Member Functions | |
static std::vector< SurfaceMeshComponent > | extract (SurfaceMesh *mesh, bool descending=true) |
static SurfaceMeshComponent | extract (SurfaceMesh *mesh, SurfaceMesh::Face seed) |
static SurfaceMeshComponent | extract (SurfaceMesh *mesh, SurfaceMesh::Vertex seed) |
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.
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.
Box3 bbox | ( | ) | const |
Returns the bounding box of this component.
float border_length | ( | ) | const |
Returns the total border length of this component.
|
static |
Extracts connected components. The components are sorted in descending order if descending
is true
(in terms of number of faces.
|
static |
Extracts a single connected component from the seed face
|
static |
Extracts a single connected component from the seed vertex
|
inline |
Returns the surface mesh to which this component belongs.
SurfaceMesh * to_mesh | ( | ) | const |
Constructs a surface mesh from this component.
void translate | ( | const vec3 & | offset | ) |
Translates this component by an offset vector.