Easy3D 2.5.3
SurfaceMeshPolygonization Class Reference

Merge connected coplanar faces into a general polygon face. More...

#include <easy3d/algo/surface_mesh_polygonization.h>

Public Member Functions

void apply (SurfaceMesh *mesh, float angle_threshold=1.0f)
 Merges connected coplanar faces into a general polygon face. More...
 
void merge_colinear_edges (SurfaceMesh *mesh, float angle_threshold=1.0f)
 Removes 2-degree vertices. More...
 

Detailed Description

Merge connected coplanar faces into a general polygon face.

Todo:
Support faces with holes (i.e., polygons with multiple contours)

Member Function Documentation

◆ apply()

void apply ( SurfaceMesh mesh,
float  angle_threshold = 1.0f 
)

Merges connected coplanar faces into a general polygon face.

The result is a general polygonal mesh.

Parameters
meshThe input surface mesh. Upon return, the mesh will be modified.
angle_thresholdTwo faces sharing a common edge are considered coplanar if the dihedral angle is smaller than angle_threshold (in degrees).
Attention
The current implementation doesn't support polygon faces with holes.

◆ merge_colinear_edges()

void merge_colinear_edges ( SurfaceMesh mesh,
float  angle_threshold = 1.0f 
)

Removes 2-degree vertices.

For every 2-degree vertex, if the angle between its two incident edges is smaller than a threshold, merge the two incident edges by removing this vertex.

Parameters
meshThe input surface mesh. Upon return, the mesh will be modified.
angle_thresholdTwo edges sharing the same vertex are considered colinear if their angle is smaller than angle_threshold (in degrees).

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