MeshLib Documentation
Loading...
Searching...
No Matches
Components

This chapter represents documentation about components. More...

Topics

 MeshComponents
 
 PointCloudComponents
 

Functions

MRMESH_API UndirectedEdgeBitSet MR::PolylineComponents::getComponent (const PolylineTopology &topology, UndirectedEdgeId id)
 
MRMESH_API std::vector< UndirectedEdgeBitSet > MR::PolylineComponents::getAllComponents (const PolylineTopology &topology)
 
MRMESH_API std::pair< std::vector< UndirectedEdgeBitSet >, int > MR::PolylineComponents::getAllComponents (const PolylineTopology &topology, int maxComponentCount)
 
MRMESH_API UnionFind< UndirectedEdgeId > MR::PolylineComponents::getUnionFindStructure (const PolylineTopology &topology)
 
template<typename V >
UndirectedEdgeBitSet MR::PolylineComponents::getLargestComponent (const Polyline< V > &polyline)
 
MRVOXELS_API std::vector< VoxelBitSet > MR::FloatGridComponents::getAllComponents (const FloatGrid &grid, float isoValue=0.0f)
 

Detailed Description

This chapter represents documentation about components.

Function Documentation

◆ getAllComponents() [1/3]

MRVOXELS_API std::vector< VoxelBitSet > MR::FloatGridComponents::getAllComponents ( const FloatGrid & grid,
float isoValue = 0.0f )

finds separated by iso-value components in grid space (0 voxel id is minimum active voxel in grid)

◆ getAllComponents() [2/3]

MRMESH_API std::vector< UndirectedEdgeBitSet > MR::PolylineComponents::getAllComponents ( const PolylineTopology & topology)

gets all connected components of polyline topology

Note
be careful, if mesh is large enough and has many components, the memory overflow will occur

◆ getAllComponents() [3/3]

MRMESH_API std::pair< std::vector< UndirectedEdgeBitSet >, int > MR::PolylineComponents::getAllComponents ( const PolylineTopology & topology,
int maxComponentCount )

gets all connected components of polyline topology

\detail if components number more than the maxComponentCount, they will be combined into groups of the same size

Parameters
maxComponentCountshould be more then 1
Returns
pair components bitsets vector and number components in one group if components number more than maxComponentCount

◆ getComponent()

MRMESH_API UndirectedEdgeBitSet MR::PolylineComponents::getComponent ( const PolylineTopology & topology,
UndirectedEdgeId id )

returns one connected component containing given undirected edge id, not effective to call more than once, if several components are needed use getAllComponents

◆ getLargestComponent()

template<typename V >
UndirectedEdgeBitSet MR::PolylineComponents::getLargestComponent ( const Polyline< V > & polyline)

returns largest by length component

◆ getUnionFindStructure()

MRMESH_API UnionFind< UndirectedEdgeId > MR::PolylineComponents::getUnionFindStructure ( const PolylineTopology & topology)

gets union-find structure for given polyline