![]() |
ImFusion SDK 4.3
|
Mesh processing algorithms based on connected component analysis. More...
Mesh processing algorithms based on connected component analysis.
Classes | |
| struct | ConnectedComponent |
| struct | ConnectedComponentInfo |
Functions | |
| ConnectedComponentInfo | labelConnectedComponents (const Mesh &mesh) |
| Determines the connected triangles. | |
| bool | reduceToNumberOfLargestComponents (Mesh &mesh, int numComponents, const ConnectedComponentInfo *info=nullptr) |
| Removes small connected components. | |
| bool | reduceToComponentsByLabel (Mesh &mesh, const std::vector< unsigned int > &componentsToKeep, const ConnectedComponentInfo *info=nullptr) |
| Removes all connected components that are not among the specified ones. | |
| bool | reduceToComponentsByArea (Mesh &mesh, float minConnectedArea, float maxConnectedArea, const ConnectedComponentInfo *info=nullptr) |
| Removes all connected components that are not within the specified area range. | |
| std::vector< std::unique_ptr< Mesh > > | splitConnectedComponents (const Mesh &mesh, const std::vector< unsigned int > &componentsToExtract={}, const ConnectedComponentInfo *info=nullptr) |
| Split connected components in separate meshes. | |
| void | analyzeLabels (TriMesh *mesh, int assignedLabels, std::vector< int > &labels, std::vector< int > &labelsSize, std::vector< float > &labelsArea) |
| ConnectedComponentInfo labelConnectedComponents | ( | const Mesh & | mesh | ) |
Determines the connected triangles.
Known duplicate vertices will be taken into account
| [in,out] | mesh | mesh |
| bool reduceToNumberOfLargestComponents | ( | Mesh & | mesh, |
| int | numComponents, | ||
| const ConnectedComponentInfo * | info = nullptr ) |
Removes small connected components.
| [in,out] | mesh | mesh |
| numComponents | number of largest connected components that should be kept | |
| info | optional connected component info obtained from labelConnectedComponents. If not provided this info will be re-computed internally. It is recommended to pass this information in order to improve the speed |
| bool reduceToComponentsByLabel | ( | Mesh & | mesh, |
| const std::vector< unsigned int > & | componentsToKeep, | ||
| const ConnectedComponentInfo * | info = nullptr ) |
Removes all connected components that are not among the specified ones.
| [in,out] | mesh | mesh |
| componentsToKeep | labels of connected components that should remain | |
| info | optional connected component info obtained from labelConnectedComponents. If not provided this info will be re-computed internally. It is recommended to pass this information in order to improve the speed |
| bool reduceToComponentsByArea | ( | Mesh & | mesh, |
| float | minConnectedArea, | ||
| float | maxConnectedArea, | ||
| const ConnectedComponentInfo * | info = nullptr ) |
Removes all connected components that are not within the specified area range.
| [in,out] | mesh | mesh |
| minConnectedArea | minimum allowed area of triangles for the remaining connected components | |
| maxConnectedArea | maximum allowed area of triangles for the remaining connected components | |
| info | optional connected component info obtained from labelConnectedComponents. If not provided this info will be re-computed internally. It is recommended to pass this information in order to improve the speed |
| std::vector< std::unique_ptr< Mesh > > splitConnectedComponents | ( | const Mesh & | mesh, |
| const std::vector< unsigned int > & | componentsToExtract = {}, | ||
| const ConnectedComponentInfo * | info = nullptr ) |
Split connected components in separate meshes.
| [in] | mesh | mesh |
| [in] | componentsToExtract | optional parameter specifying the labels of components to extract. If empty, all components will be extracted |
| info | optional connected component info obtained from labelConnectedComponents. If not provided this info will be re-computed internally. It is recommended to pass this information in order to improve the speed |