![]() |
ImFusion SDK 4.3
|
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 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 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 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:
) are undefined (except normals, see below).If \a mesh has the vertex normal property the vertex normals in the filled regions are computed. Additionally the halfedge normal property is added and set accordingly to support shading the sharp cropping edges.If \a mesh has vertex color or texture coordinate properties the respective halfedge properties are added and set.If \a mesh has the face normal property all face normals are recomputed.All other existing vertex, face, edge, and halfedge properties are kept at vertices and faces with ImFusionOriginProperty::Original property, at other vertices and faces they are undefined. \note If the mesh is not watertight and the cropping planes cross some boundary, the resulting hole will only be filled between the newly created vertices, i.e. vertices on the planes \param [in,out] mesh Mesh \param [in] planes the cropping planes \param [in] cropType type of cropping \param [in] cap (optional) should the cropped mesh be capped. Default isfalse. \param [in] progress (optional) a pointer to a progress handler. Default isnullptr`.