Geom Software - C++ Programming and Geometry Libraries
WOF Documentation pages v1.12
Geometry functions

Geometry operations. More...

Functions

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, bool bAllowSmoothing, double sfactor=2.0, int numGrowSteps=10)
 Reconstruct with an automatic spacing value. More...
 
MeshPtr GEOM_WOF::reconstruct_abs (std::vector< Point3 > &vPoints, bool bAllowSmoothing, double spacingAbs, int numGrowSteps=10)
 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...
 

Detailed Description

Operations to reconstruct a surface, to sample-and-reconstruct a mesh and to create feature-aligned quality point clouds.

Function Documentation

◆ 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]pMeshis 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]pMeshis 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]pMeshis the mesh to be improved
[in]numIterationsspecifies 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]vInputCornerscontains the input triangles (3 corner points per triangle)
[in]avgLengthspecifies the average distance to be used. Choose this parameter with care to avoid an extreme number of elements.
[in]featureThreshis 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,
bool  bAllowSmoothing,
double  spacingAbs,
int  numGrowSteps = 10 
)

This function reconstructs a triangular mesh from a 3D point cloud.

Parameters
[in]vPointscontains the input point cloud
[in]spacingAbsis an absolute spacing value. Large values
[in]bAllowSmoothingspecifies if the point cloud shall be smoothed before reconstruction.
[in]numGrowStepsis 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.
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,
bool  bAllowSmoothing,
double  sfactor = 2.0,
int  numGrowSteps = 10 
)

This function reconstructs a triangular mesh from a 3D point cloud.

Parameters
[in]vPointscontains the input point cloud
[in]bAllowSmoothingspecifies if the point cloud shall be smoothed before reconstruction.
[in]sfactoris 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. By default sfactor=2.0.
[in]numGrowStepsis 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]pMeshis the mesh to be simplified
[in]targetLenis a limit on the edge length (the algorithm will skip larger edges). Default: DBL_MAX
[in]maximumangle 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]vCornersIncontains the input triangles (3 corners per triangle)
[in]lengthspecifies the approximate distance to be used
[in]featureThreshis an optional parameter. Edges with larger dihedral angles are treated as feature edges and points are preferably placed there.
[out]vCloudOutis used to return the point cloud