Geometry operations.
More...
|
MeshPtr | GEOM_WOF::melt (std::vector< Point3 > &vInputCorners, double avgLength, double featureThresh=15.0) |
| Remesh (melt) a triangle mesh. More...
|
|
MeshPtr | GEOM_WOF::reconstruct_auto (std::vector< Point3 > &vPoints, double sfactor, int numGrowSteps) |
| Reconstruct with an automatic spacing value. More...
|
|
MeshPtr | GEOM_WOF::reconstruct_abs (std::vector< Point3 > &vPoints, double spacingAbs, int numGrowSteps) |
| Reconstruct with an absolute spacing value. More...
|
|
void | GEOM_WOF::toCloud (std::vector< Point3 > &vCornersIn, double length, double featureThresh, std::vector< Point3 > &vCloudOut) |
| Mesh-to-Cloud. More...
|
|
void | GEOM_WOF::edgeFlips (MeshPtr pMesh) |
| Flip edges. More...
|
|
void | GEOM_WOF::edgeFlipsSimA (MeshPtr pMesh) |
| Flip edges - simulated annealing. More...
|
|
void | GEOM_WOF::laplacianSmoothing (MeshPtr pMesh, int numIterations) |
| Laplacian smoothing. More...
|
|
int | GEOM_WOF::reduce (MeshPtr pMesh, double targetLen=DBL_MAX, double maxDev=2.0) |
| Reduce. More...
|
|
Operations to reconstruct a surface, to sample-and-reconstruct a mesh and to create feature-aligned quality point clouds.
◆ edgeFlips()
void GEOM_WOF::edgeFlips |
( |
MeshPtr |
pMesh | ) |
|
This function uses a simple and fast edge-flip algorithm to fit the mesh better to thought surface.
- Parameters
-
[in] | pMesh | is the mesh to be improved |
- See also
- edgeFlipsSimA()
◆ edgeFlipsSimA()
void GEOM_WOF::edgeFlipsSimA |
( |
MeshPtr |
pMesh | ) |
|
Like edgeFlips() the present function flips edges to adapt the mesh better to the thought surface. But with a computationally more expensive simulated annealing algorithm that achieves yet better output quality.
- Parameters
-
[in] | pMesh | is the mesh to be improved |
- See also
- edgeFlips()
◆ laplacianSmoothing()
void GEOM_WOF::laplacianSmoothing |
( |
MeshPtr |
pMesh, |
|
|
int |
numIterations |
|
) |
| |
This function applies weighted laplacian smoothing to create a smoother mesh.
- Parameters
-
[in] | pMesh | is the mesh to be improved |
[in] | numIterations | specifies how much the mesh shall be smoothed. |
◆ melt()
MeshPtr GEOM_WOF::melt |
( |
std::vector< Point3 > & |
vInputCorners, |
|
|
double |
avgLength, |
|
|
double |
featureThresh = 15.0 |
|
) |
| |
This function converts a mesh into a point cloud and then reconstructs it from there. This way you can get rid of meshing errors and unnecessary complexity. This mesh-melting operation may change the topology of the object i.e., depending on the sample distance it may close holes and create additional bridges.
- Parameters
-
[in] | vInputCorners | contains the input triangles (3 corner points per triangle) |
[in] | avgLength | specifies the average distance to be used. Choose this parameter with care to avoid an extreme number of elements. |
[in] | featureThresh | is an optional parameter that specifies that edges above this value shall be treated as feature lines on which points shall be placed. |
◆ reconstruct_abs()
MeshPtr GEOM_WOF::reconstruct_abs |
( |
std::vector< Point3 > & |
vPoints, |
|
|
double |
spacingAbs, |
|
|
int |
numGrowSteps |
|
) |
| |
This function reconstructs a triangular mesh from a 3D point cloud.
- Parameters
-
[in] | vPoints | contains the input point cloud |
[in] | spacingAbs | is an absolute spacing value. |
[in] | numGrowSteps | is the number of steps by which the boundaries of holes can grow to close the holes. The steps correspond approximately to the used spacing distance. Larger values close larger holes and can take considerably more time. If the sampling quality is reasonably homogeneous, numGrowSteps=1 is recommended. |
- Returns
- the reconstructed mesh.
If the absolute spacing value is unknown then better use reconstruct_auto() which automatically estimates the point cloud density.
- See also
- reduce(), laplacianSmoothing(), edgeFlips(), edgeFlipsSimA() which are powerful postprocessing fuctions.
◆ reconstruct_auto()
MeshPtr GEOM_WOF::reconstruct_auto |
( |
std::vector< Point3 > & |
vPoints, |
|
|
double |
sfactor, |
|
|
int |
numGrowSteps |
|
) |
| |
This function reconstructs a triangular mesh from a 3D point cloud.
- Parameters
-
[in] | vPoints | contains the input point cloud |
[in] | sfactor | is a factor on the estimated point cloud density. The average spacing in the point cloud is automatically estimated and multiplied by sfactor. Use larger values to avoid holes upfront and to create coarser meshes. |
[in] | numGrowSteps | is the number of steps by which the boundaries of holes can grow to close the holes. The steps correspond approximately to the used spacing distance. Use 0 to deactivate. Larger values close larger holes but also take more time. |
- Returns
- the reconstructed mesh.
- See also
- reduce(), laplacianSmoothing(), edgeFlips(), edgeFlipsSimA() which are powerful postprocessing fuctions.
◆ reduce()
int GEOM_WOF::reduce |
( |
MeshPtr |
pMesh, |
|
|
double |
targetLen = DBL_MAX , |
|
|
double |
maxDev = 2.0 |
|
) |
| |
This function reduces the number of triangles in pMesh
.
- Parameters
-
[in] | pMesh | is the mesh to be simplified |
[in] | targetLen | is a limit on the edge length (the algorithm will skip larger edges). Default: DBL_MAX |
[in] | maximum | angle deviation per simplification step. Default: 2.0 |
- Returns
- the number of removed triangles
◆ toCloud()
void GEOM_WOF::toCloud |
( |
std::vector< Point3 > & |
vCornersIn, |
|
|
double |
length, |
|
|
double |
featureThresh, |
|
|
std::vector< Point3 > & |
vCloudOut |
|
) |
| |
This function creates a 3D point cloud from an input mesh.
- Parameters
-
[in] | vCornersIn | contains the input triangles (3 corners per triangle) |
[in] | length | specifies the approximate distance to be used |
[in] | featureThresh | is an optional parameter. Edges with larger dihedral angles are treated as feature edges and points are preferably placed there. |
[out] | vCloudOut | is used to return the point cloud |