![]() |
ImFusion C++ SDK 4.4.0
|
Mesh processing algorithms related to cleaning of the mesh. More...
Mesh processing algorithms related to cleaning of the mesh.
Classes | |
| struct | ImFusionOriginProperty |
| Vertex and / or face property indicating the origin of a vertex or face in the mesh, added to the mesh by cropMesh. More... | |
Enumerations | |
| enum class | CropType { InfrontUnion , InfrontIntersection , BehindUnion , BehindIntersection } |
| CropType for cropMesh method. More... | |
Functions | |
| void | mergeCloseVertices (Mesh &mesh, double delta=0.0, bool allowFaceReordering=false) |
| Remove close mesh vertices. | |
| void | removeIsolatedVertices (Mesh &mesh) |
| Remove vertices not belonging to any face. | |
| void | crop (Mesh &mesh, const vec3 &boxCenter, const vec3 &boxExtent, const bool discardPointsInside, const mat4 &transformation, bool cap=false, Progress *progress=nullptr) |
| Deletes all faces that are not inside the given box. | |
| void | crop (Mesh &mesh, const std::vector< Geometry::Plane > &planes, CropType cropType, bool cap=false, Progress *progress=nullptr) |
| Crops a mesh using a set of planes. | |
|
strong |
CropType for cropMesh method.
Defines the desired output of the mesh cropping, i.e. which. parts of the mesh are to be kept after cropping.
| void ImFusion::MeshProcessing::Cleaning::mergeCloseVertices | ( | Mesh & | mesh, |
| double | delta = 0.0, | ||
| bool | allowFaceReordering = false ) |
Remove close mesh vertices.
This function merges vertices in a mesh that are closer than delta (using the L2 norm). To do so it builds a graph whose nodes $V = {\mathbf{v}_0,...,\mathbf{v}_n}$ represent the vertices of the mesh and whose edges $E$ contain $e_{i,j} \in E \Leftrightarrow ||v_i-v_j|| < \delta$. Connected components in this graph are subsequentially merged into one representative vertex before faces are reassigned to the new vertices. This means that the total circumference of a merged cluster might exceed delta if there is a long "chain" of vertices which are pairwise closer than delta.
| [in,out] | mesh | Mesh |
| [in] | delta | threshold for the distance between vertices. If distance between vertices is smaller than the threshold, vertices will be merged (optional, default is 0.0) |
| void ImFusion::MeshProcessing::Cleaning::crop | ( | Mesh & | mesh, |
| const vec3 & | boxCenter, | ||
| const vec3 & | boxExtent, | ||
| const bool | discardPointsInside, | ||
| const mat4 & | transformation, | ||
| bool | cap = false, | ||
| Progress * | progress = nullptr ) |
Deletes all faces that are not inside the given box.
Operates directly on the input mesh without making a copy
For a detailed explanation and the handling of properties see
| [in,out] | mesh | Mesh |
| [in] | boxCenter | center of the cropping box |
| [in] | boxExtent | the extent in all axes of the cropping box |
| [in] | discardPointsInside | should the points inside or outside the box be discarded |
| [in] | transformation | a transformation that is applied to the cropping box |
| [in] | cap | (optional) should cap the cropped mesh, default is false |
| [in] | progress | (optional) a pointer to a progress handler, default is nullptr |
| void ImFusion::MeshProcessing::Cleaning::crop | ( | Mesh & | mesh, |
| const std::vector< Geometry::Plane > & | planes, | ||
| CropType | cropType, | ||
| bool | cap = false, | ||
| Progress * | progress = nullptr ) |
Crops a mesh using a set of planes.
The crop parameter defines the desired output of the mesh cropping. Operates directly on the input mesh without making a copy
Mesh attributes will be handled in the following way: