ImFusion SDK 4.3
ImFusion::MeshProcessing::Misc Namespace Reference

Miscellaneous mesh processing functions. More...

Detailed Description

Miscellaneous mesh processing functions.

Enumerations

enum class  FillType { None = 0 , Bottom , Top }
 Filling type for the label map computation. More...
 

Functions

bool invertNormals (Mesh &mesh)
 Invert the vertex normals of the Mesh. Returns false if mesh has no vertex normals.
 
void burnInTransformation (Mesh &mesh, const mat4 &transformation)
 Applies the transformation to all mesh vertices.
 
std::unique_ptr< TypedImage< unsigned char > > computeLabelMap (Mesh &mesh, const vec3 &resolution, unsigned int margin=10, unsigned int dir=2, FillType fill=FillType::None, vec3i *targetDim=nullptr)
 Compute label map volume from the mesh, representing the inside of a closed surface.
 
void erodeBoundary (Mesh &mesh, int layers)
 Removes mesh boundary faces (faces which have at least one boundary edge)
 
bool transferMeshFaceLabels (const Mesh &meshSrc, Mesh &meshDst)
 Transfer face labels from source mesh to destination mesh by propagating the label of its nearest neighbor.
 

Enumeration Type Documentation

◆ FillType

enum class FillType
strong

Filling type for the label map computation.

Enumerator
None 

no closing

Bottom 

close label map in the bottom of axis

Top 

close label map on the top of axis

Function Documentation

◆ burnInTransformation()

void burnInTransformation ( Mesh & mesh,
const mat4 & transformation )

Applies the transformation to all mesh vertices.

Transformation is also applied to vertex normals, halfedge normals and face normals if present

Parameters
[in,out]meshMesh
[in]transformationThe transformation matrix

◆ computeLabelMap()

std::unique_ptr< TypedImage< unsigned char > > computeLabelMap ( Mesh & mesh,
const vec3 & resolution,
unsigned int margin = 10,
unsigned int dir = 2,
FillType fill = FillType::None,
vec3i * targetDim = nullptr )

Compute label map volume from the mesh, representing the inside of a closed surface.

Parameters
[in,out]meshMesh
[in]resolutionResolution of a single voxel
[in]marginAdditional voxels added at the volume boundaries
[in]dirAxis along which ray-mesh intersection should be performed (0 is x-axis, 1 is y-axis, 2 is z-axis)
[in]fillSpecifies whether the label map should be manually closed in case of an open mesh
[in]targetDimOptional target dimension of the computed volume. If not provided, the dimension will be computed as [mesh extent] * [resolution] + [margin]
Returns
Label map with inside voxels set to 1, outside voxels set to 0
Warning
Mesh matrix is ignored
Mesh must be centered (its center of the local bounds should be at the origin)

◆ erodeBoundary()

void erodeBoundary ( Mesh & mesh,
int layers )

Removes mesh boundary faces (faces which have at least one boundary edge)

Parameters
[in,out]meshmesh
layersnumber of layers of boundary faces to be removed
Note
Consider removing duplicated vertices by calling Cleaning::mergeCloseVertices before this
Search Tab / S to search, Esc to close