MeshLib Python Docs
Loading...
Searching...
No Matches
meshlib.mrmeshpy.MeshComponents Class Reference

Classes

class  FaceIncidence
 
class  LargeByAreaComponentsSettings
 

Static Public Member Functions

None excludeFullySelectedComponents (Mesh mesh, VertBitSet selection)
 
std_vector_TaggedBitSet_FaceTag getAllComponents (MeshPart meshPart, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
tuple[std_vector_TaggedBitSet_FaceTag, int] getAllComponents (MeshPart meshPart, int maxComponentCount, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
std_vector_TaggedBitSet_FaceTag getAllComponents (Face2RegionMap componentsMap, int componentsCount, FaceBitSet region, int maxComponentCount)
 
std_vector_TaggedBitSet_EdgeTag getAllComponentsEdges (Mesh mesh, EdgeBitSet edges)
 
tuple[Face2RegionMap, int] getAllComponentsMap (MeshPart meshPart, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
std_vector_TaggedBitSet_UndirectedEdgeTag getAllComponentsUndirectedEdges (Mesh mesh, UndirectedEdgeBitSet edges)
 
std_vector_TaggedBitSet_VertTag getAllComponentsVerts (Mesh mesh, VertBitSet region=None)
 
std_vector_TaggedBitSet_VertTag getAllComponentsVertsSeparatedByPath (Mesh mesh, std_vector_EdgePoint path)
 
std_vector_TaggedBitSet_VertTag getAllComponentsVertsSeparatedByPaths (Mesh mesh, std_vector_std_vector_EdgePoint paths)
 
std_vector_TaggedBitSet_FaceTag getAllFlatComponents (MeshPart meshPart, float zTolerance)
 
FaceBitSet getComponent (MeshPart meshPart, FaceId id, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
VertBitSet getComponentVerts (Mesh mesh, VertId id, VertBitSet region=None)
 
FaceBitSet getComponents (MeshPart meshPart, FaceBitSet seeds, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
UndirectedEdgeBitSet getComponentsUndirectedEdges (Mesh mesh, UndirectedEdgeBitSet seeds)
 
VertBitSet getComponentsVerts (Mesh mesh, VertBitSet seeds, VertBitSet region=None)
 
FaceBitSet getLargeByAreaComponents (MeshPart meshPart, float minArea, func_bool_from_Id_UndirectedEdgeTag isCompBd)
 
FaceBitSet getLargeByAreaComponents (MeshPart meshPart, UnionFind_FaceId unionFind, float minArea, UndirectedEdgeBitSet outBdEdgesBetweenLargeComps=None)
 
tuple[FaceBitSet, int] getLargeByAreaRegions (MeshPart meshPart, Face2RegionMap regionMap, int numRegions, float minArea)
 
FaceBitSet getLargeByAreaSmoothComponents (MeshPart meshPart, float minArea, float angleFromPlanar, UndirectedEdgeBitSet outBdEdgesBetweenLargeComps=None)
 
VertBitSet getLargeComponentVerts (Mesh mesh, int minVerts, VertBitSet region=None)
 
FaceBitSet getLargestComponent (MeshPart meshPart, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}', float minArea=0, int_output numSmallerComponents=None)
 
VertBitSet getLargestComponentVerts (Mesh mesh, VertBitSet region=None)
 
std_vector_TaggedBitSet_FaceTag getNLargeByAreaComponents (MeshPart meshPart, MeshComponents.LargeByAreaComponentsSettings settings)
 
int getNumComponents (MeshPart meshPart, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
Vector_double_RegionId getRegionAreas (MeshPart meshPart, Face2RegionMap regionMap, int numRegions)
 
UnionFind_FaceId getUnionFindStructureFaces (MeshPart meshPart, MeshComponents.FaceIncidence incidence='FaceIncidence::PerEdge', func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
UnionFind_FaceId getUnionFindStructureFacesPerEdge (MeshPart meshPart, func_bool_from_Id_UndirectedEdgeTag isCompBd='MR::UndirectedEdgePredicate{}')
 
UnionFind_UndirectedEdgeId getUnionFindStructureUndirectedEdges (Mesh mesh, bool allPointToRoots=False)
 
UnionFind_VertId getUnionFindStructureVerts (Mesh mesh, VertBitSet region=None)
 
UnionFind_VertId getUnionFindStructureVerts (Mesh mesh, EdgeBitSet edges)
 
UnionFind_VertId getUnionFindStructureVerts (Mesh mesh, UndirectedEdgeBitSet edges)
 
UnionFind_VertId getUnionFindStructureVertsEx (Mesh mesh, UndirectedEdgeBitSet ignoreEdges)
 
UnionFind_VertId getUnionFindStructureVertsSeparatedByPath (Mesh mesh, std_vector_EdgePoint path, VertBitSet outPathVerts=None)
 
UnionFind_VertId getUnionFindStructureVertsSeparatedByPaths (Mesh mesh, std_vector_std_vector_EdgePoint paths, VertBitSet outPathVerts=None)
 
bool hasFullySelectedComponent (Mesh mesh, VertBitSet selection)
 

Detailed Description

This is a namespace.

Member Function Documentation

◆ excludeFullySelectedComponents()

None meshlib.mrmeshpy.MeshComponents.excludeFullySelectedComponents ( Mesh mesh,
VertBitSet selection )
static
if all vertices of a mesh connected component are present in selection exludes these vertices

◆ getAllComponents() [1/3]

std_vector_TaggedBitSet_FaceTag meshlib.mrmeshpy.MeshComponents.getAllComponents ( Face2RegionMap componentsMap,
int componentsCount,
FaceBitSet region,
int maxComponentCount )
static
gets all connected components from components map ( FaceId => RegionId )
\\detail if components  number more than the maxComponentCount, they will be combined into groups of the same size (this similarly changes componentsMap)
\\param maxComponentCount should be more then 1
\\return components bitsets vector

◆ getAllComponents() [2/3]

tuple[std_vector_TaggedBitSet_FaceTag, int] meshlib.mrmeshpy.MeshComponents.getAllComponents ( MeshPart meshPart,
int maxComponentCount,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
gets all connected components of mesh part
\\detail if components  number more than the maxComponentCount, they will be combined into groups of the same size
\\param maxComponentCount should be more then 1
\\return pair components bitsets vector and number components in one group if components number more than maxComponentCount

◆ getAllComponents() [3/3]

std_vector_TaggedBitSet_FaceTag meshlib.mrmeshpy.MeshComponents.getAllComponents ( MeshPart meshPart,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
gets all connected components of mesh part
\\note be careful, if mesh is large enough and has many components, the memory overflow will occur

◆ getAllComponentsEdges()

std_vector_TaggedBitSet_EdgeTag meshlib.mrmeshpy.MeshComponents.getAllComponentsEdges ( Mesh mesh,
EdgeBitSet edges )
static
subdivides given edges on connected components

◆ getAllComponentsMap()

tuple[Face2RegionMap, int] meshlib.mrmeshpy.MeshComponents.getAllComponentsMap ( MeshPart meshPart,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
gets all connected components of mesh part as
1. the mapping: FaceId -> Component ID in [0, 1, 2, ...)
2. the total number of components

◆ getAllComponentsUndirectedEdges()

std_vector_TaggedBitSet_UndirectedEdgeTag meshlib.mrmeshpy.MeshComponents.getAllComponentsUndirectedEdges ( Mesh mesh,
UndirectedEdgeBitSet edges )
static
subdivides given edges on connected components

◆ getAllComponentsVerts()

std_vector_TaggedBitSet_VertTag meshlib.mrmeshpy.MeshComponents.getAllComponentsVerts ( Mesh mesh,
VertBitSet region = None )
static
gets all connected components of mesh part

◆ getAllComponentsVertsSeparatedByPath()

std_vector_TaggedBitSet_VertTag meshlib.mrmeshpy.MeshComponents.getAllComponentsVertsSeparatedByPath ( Mesh mesh,
std_vector_EdgePoint path )
static
gets all connected components, separating vertices by given path (either closed or from boundary to boundary)

◆ getAllComponentsVertsSeparatedByPaths()

std_vector_TaggedBitSet_VertTag meshlib.mrmeshpy.MeshComponents.getAllComponentsVertsSeparatedByPaths ( Mesh mesh,
std_vector_std_vector_EdgePoint paths )
static
gets all connected components, separating vertices by given paths (either closed or from boundary to boundary)

◆ getAllFlatComponents()

std_vector_TaggedBitSet_FaceTag meshlib.mrmeshpy.MeshComponents.getAllFlatComponents ( MeshPart meshPart,
float zTolerance )
static
gets all connected components where difference between the highest and the lowest point is less than \\param zTolerance

◆ getComponent()

FaceBitSet meshlib.mrmeshpy.MeshComponents.getComponent ( MeshPart meshPart,
FaceId id,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
returns one connected component containing given face, 
not effective to call more than once, if several components are needed use getAllComponents

◆ getComponents()

FaceBitSet meshlib.mrmeshpy.MeshComponents.getComponents ( MeshPart meshPart,
FaceBitSet seeds,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
returns union of connected components, each of which contains at least one seed face

◆ getComponentsUndirectedEdges()

UndirectedEdgeBitSet meshlib.mrmeshpy.MeshComponents.getComponentsUndirectedEdges ( Mesh mesh,
UndirectedEdgeBitSet seeds )
static
returns union of connected components, each of which contains at least one seed edge

◆ getComponentsVerts()

VertBitSet meshlib.mrmeshpy.MeshComponents.getComponentsVerts ( Mesh mesh,
VertBitSet seeds,
VertBitSet region = None )
static
returns union of connected components, each of which contains at least one seed vert

◆ getComponentVerts()

VertBitSet meshlib.mrmeshpy.MeshComponents.getComponentVerts ( Mesh mesh,
VertId id,
VertBitSet region = None )
static
returns one connected component containing given vertex, 
not effective to call more than once, if several components are needed use getAllComponentsVerts

◆ getLargeByAreaComponents() [1/2]

FaceBitSet meshlib.mrmeshpy.MeshComponents.getLargeByAreaComponents ( MeshPart meshPart,
float minArea,
func_bool_from_Id_UndirectedEdgeTag isCompBd )
static
returns the union of connected components, each having at least given area

◆ getLargeByAreaComponents() [2/2]

FaceBitSet meshlib.mrmeshpy.MeshComponents.getLargeByAreaComponents ( MeshPart meshPart,
UnionFind_FaceId unionFind,
float minArea,
UndirectedEdgeBitSet outBdEdgesBetweenLargeComps = None )
static
given prepared union-find structure returns the union of connected components, each having at least given area

◆ getLargeByAreaRegions()

tuple[FaceBitSet, int] meshlib.mrmeshpy.MeshComponents.getLargeByAreaRegions ( MeshPart meshPart,
Face2RegionMap regionMap,
int numRegions,
float minArea )
static
returns
1. the union of all regions with area >= minArea
2. the number of such regions

◆ getLargeByAreaSmoothComponents()

FaceBitSet meshlib.mrmeshpy.MeshComponents.getLargeByAreaSmoothComponents ( MeshPart meshPart,
float minArea,
float angleFromPlanar,
UndirectedEdgeBitSet outBdEdgesBetweenLargeComps = None )
static
returns the union of connected components, each having at least given area,
and any two faces in a connected component have a path along the surface across the edges, where surface does not deviate from plane more than on given angle

◆ getLargeComponentVerts()

VertBitSet meshlib.mrmeshpy.MeshComponents.getLargeComponentVerts ( Mesh mesh,
int minVerts,
VertBitSet region = None )
static
returns the union of vertex connected components, each having at least \\param minVerts vertices

◆ getLargestComponent()

FaceBitSet meshlib.mrmeshpy.MeshComponents.getLargestComponent ( MeshPart meshPart,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}',
float minArea = 0,
int_output numSmallerComponents = None )
static
returns the largest by surface area component or empty set if its area is smaller than \\param minArea

◆ getLargestComponentVerts()

VertBitSet meshlib.mrmeshpy.MeshComponents.getLargestComponentVerts ( Mesh mesh,
VertBitSet region = None )
static
returns the largest by number of elements component

◆ getNLargeByAreaComponents()

std_vector_TaggedBitSet_FaceTag meshlib.mrmeshpy.MeshComponents.getNLargeByAreaComponents ( MeshPart meshPart,
MeshComponents.LargeByAreaComponentsSettings settings )
static
returns requested number of largest by area connected components in descending by area order

◆ getNumComponents()

int meshlib.mrmeshpy.MeshComponents.getNumComponents ( MeshPart meshPart,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
returns the number of connected components in mesh part

◆ getRegionAreas()

Vector_double_RegionId meshlib.mrmeshpy.MeshComponents.getRegionAreas ( MeshPart meshPart,
Face2RegionMap regionMap,
int numRegions )
static
computes the area of each region given via the map

◆ getUnionFindStructureFaces()

UnionFind_FaceId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureFaces ( MeshPart meshPart,
MeshComponents.FaceIncidence incidence = 'FaceIncidence::PerEdge',
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
gets union-find structure for faces with different options of face-connectivity

◆ getUnionFindStructureFacesPerEdge()

UnionFind_FaceId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureFacesPerEdge ( MeshPart meshPart,
func_bool_from_Id_UndirectedEdgeTag isCompBd = 'MR::UndirectedEdgePredicate{}' )
static
gets union-find structure for faces with connectivity by shared edge, and optional edge predicate whether to skip uniting components over it
it is guaranteed that isCompBd is invoked in a thead-safe manner (that left and right face are always processed by one thread)

◆ getUnionFindStructureUndirectedEdges()

UnionFind_UndirectedEdgeId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureUndirectedEdges ( Mesh mesh,
bool allPointToRoots = False )
static
gets union-find structure for all undirected edges in \\param mesh
\\param allPointToRoots if true, then every element in the structure will point directly to the root of its respective component

◆ getUnionFindStructureVerts() [1/3]

UnionFind_VertId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureVerts ( Mesh mesh,
EdgeBitSet edges )
static
gets union-find structure for vertices, considering connections by given edges only

◆ getUnionFindStructureVerts() [2/3]

UnionFind_VertId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureVerts ( Mesh mesh,
UndirectedEdgeBitSet edges )
static
gets union-find structure for vertices, considering connections by given undirected edges only

◆ getUnionFindStructureVerts() [3/3]

UnionFind_VertId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureVerts ( Mesh mesh,
VertBitSet region = None )
static
gets union-find structure for vertices

◆ getUnionFindStructureVertsEx()

UnionFind_VertId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureVertsEx ( Mesh mesh,
UndirectedEdgeBitSet ignoreEdges )
static
gets union-find structure for vertices, considering connections by all edges excluding given ones

◆ getUnionFindStructureVertsSeparatedByPath()

UnionFind_VertId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureVertsSeparatedByPath ( Mesh mesh,
std_vector_EdgePoint path,
VertBitSet outPathVerts = None )
static
 \\brief gets union-find structure for vertices, separating vertices by given path (either closed or from boundary to boundary)
 \\param outPathVerts this set receives all vertices passed by the path

◆ getUnionFindStructureVertsSeparatedByPaths()

UnionFind_VertId meshlib.mrmeshpy.MeshComponents.getUnionFindStructureVertsSeparatedByPaths ( Mesh mesh,
std_vector_std_vector_EdgePoint paths,
VertBitSet outPathVerts = None )
static

◆ hasFullySelectedComponent()

bool meshlib.mrmeshpy.MeshComponents.hasFullySelectedComponent ( Mesh mesh,
VertBitSet selection )
static
returns true if all vertices of a mesh connected component are present in selection

The documentation for this class was generated from the following file: