MeshLib C# Docs
Loading...
Searching...
No Matches
MR.MeshComponents Class Reference

Public Types

enum  FaceIncidence
 
enum  FaceIncidence : int { PerEdge = 0 , PerVertex = 1 }
 Face incidence type. More...
 

Static Public Member Functions

static unsafe MR.FaceBitSet getComponent (MR.Const_MeshPart meshPart, MR.FaceId id, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 returns one connected component containing given face, not effective to call more than once, if several components are needed use getAllComponents Generated from function MR.MeshComponents.getComponent. Parameter incidence defaults to FaceIncidence.PerEdge.
 
static unsafe MR.VertBitSet getComponentVerts (MR.Const_Mesh mesh, MR.VertId id, MR.Const_VertBitSet? region=null)
 returns one connected component containing given vertex, not effective to call more than once, if several components are needed use getAllComponentsVerts Generated from function MR.MeshComponents.getComponentVerts.
 
static unsafe MR.VertBitSet getLargestComponentVerts (MR.Const_Mesh mesh, MR.Const_VertBitSet? region=null)
 returns the largest by number of elements component Generated from function MR.MeshComponents.getLargestComponentVerts.
 
static unsafe MR.VertBitSet getLargeComponentVerts (MR.Const_Mesh mesh, int minVerts, MR.Const_VertBitSet? region=null)
 returns the union of vertex connected components, each having at least
 
static unsafe MR.FaceBitSet getLargestComponent (MR.Const_MeshPart meshPart, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null, float? minArea=null, MR.Misc.InOut< int >? numSmallerComponents=null)
 returns the largest by surface area component or empty set if its area is smaller than
 
static unsafe MR.FaceBitSet getComponents (MR.Const_MeshPart meshPart, MR.Const_FaceBitSet seeds, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 returns union of connected components, each of which contains at least one seed face Generated from function MR.MeshComponents.getComponents. Parameter incidence defaults to FaceIncidence.PerEdge.
 
static unsafe MR.FaceBitSet getComponents (MR.Const_MeshTopology topology, MR.Const_FaceBitSet seeds, MR.Const_FaceBitSet? region=null, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 Generated from function MR.MeshComponents.getComponents. Parameter incidence defaults to FaceIncidence.PerEdge.
 
static unsafe MR.FaceBitSet getLargeByAreaComponents (MR.Const_MeshPart meshPart, float minArea, MR.Const_UndirectedEdgeBitSet? isCompBd)
 returns the union of connected components, each having at least given area Generated from function MR.MeshComponents.getLargeByAreaComponents.
 
static unsafe MR.FaceBitSet getLargeByAreaComponents (MR.Const_MeshPart meshPart, MR.UnionFind_MRFaceId unionFind, float minArea, MR.UndirectedEdgeBitSet? outBdEdgesBetweenLargeComps=null)
 given prepared union-find structure returns the union of connected components, each having at least given area Generated from function MR.MeshComponents.getLargeByAreaComponents.
 
static unsafe MR.FaceBitSet expandToComponents (MR.Const_MeshPart mp, MR.Const_FaceBitSet seeds, MR.MeshComponents.Const_ExpandToComponentsParams? params_=null)
 expands given seeds to whole components Generated from function MR.MeshComponents.expandToComponents. Parameter params_ defaults to {}.
 
static unsafe MR.Std.Vector_MRFaceBitSet getNLargeByAreaComponents (MR.Const_MeshPart meshPart, MR.MeshComponents.Const_LargeByAreaComponentsSettings settings)
 returns requested number of largest by area connected components in descending by area order Generated from function MR.MeshComponents.getNLargeByAreaComponents.
 
static unsafe MR.FaceBitSet getLargeByAreaSmoothComponents (MR.Const_MeshPart meshPart, float minArea, float angleFromPlanar, MR.UndirectedEdgeBitSet? outBdEdgesBetweenLargeComps=null)
 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 Generated from function MR.MeshComponents.getLargeByAreaSmoothComponents.
 
static unsafe MR.VertBitSet getComponentsVerts (MR.Const_Mesh mesh, MR.Const_VertBitSet seeds, MR.Const_VertBitSet? region=null)
 returns union of connected components, each of which contains at least one seed vert Generated from function MR.MeshComponents.getComponentsVerts.
 
static unsafe ulong getNumComponents (MR.Const_MeshPart meshPart, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 returns the number of connected components in mesh part Generated from function MR.MeshComponents.getNumComponents. Parameter incidence defaults to FaceIncidence.PerEdge.
 
static unsafe MR.Std.Vector_MRFaceBitSet getAllComponents (MR.Const_MeshPart meshPart, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 gets all connected components of mesh part
 
static unsafe MR.Std.Pair_StdVectorMRFaceBitSet_Int getAllComponents (MR.Const_MeshPart meshPart, int maxComponentCount, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 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
 
static unsafe MR.Std.Vector_MRFaceBitSet getAllComponents (MR.Face2RegionMap componentsMap, int componentsCount, MR.Const_FaceBitSet region, int maxComponentCount)
 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)
 
static unsafe MR.Std.Pair_MRFace2RegionMap_Int getAllComponentsMap (MR.Const_MeshPart meshPart, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 gets all connected components of mesh part as
 
static unsafe MR.Vector_Double_MRRegionId getRegionAreas (MR.Const_MeshPart meshPart, MR.Const_Face2RegionMap regionMap, int numRegions)
 computes the area of each region given via the map Generated from function MR.MeshComponents.getRegionAreas.
 
static unsafe MR.Std.Pair_MRFaceBitSet_Int getLargeByAreaRegions (MR.Const_MeshPart meshPart, MR.Const_Face2RegionMap regionMap, int numRegions, float minArea)
 returns
 
static unsafe MR.Std.Vector_MRVertBitSet getAllComponentsVerts (MR.Const_Mesh mesh, MR.Const_VertBitSet? region=null)
 gets all connected components of mesh part Generated from function MR.MeshComponents.getAllComponentsVerts.
 
static unsafe MR.Std.Vector_MRVertBitSet getAllComponentsVertsSeparatedByPath (MR.Const_Mesh mesh, MR.Std.Const_Vector_MREdgePoint path)
 gets all connected components, separating vertices by given path (either closed or from boundary to boundary) Generated from function MR.MeshComponents.getAllComponentsVertsSeparatedByPath.
 
static unsafe MR.Std.Vector_MRVertBitSet getAllComponentsVertsSeparatedByPaths (MR.Const_Mesh mesh, MR.Std.Const_Vector_StdVectorMREdgePoint paths)
 gets all connected components, separating vertices by given paths (either closed or from boundary to boundary) Generated from function MR.MeshComponents.getAllComponentsVertsSeparatedByPaths.
 
static unsafe MR.Std.Vector_MREdgeBitSet getAllComponentsEdges (MR.Const_Mesh mesh, MR.Const_EdgeBitSet edges)
 subdivides given edges on connected components Generated from function MR.MeshComponents.getAllComponentsEdges.
 
static unsafe MR.Std.Vector_MRUndirectedEdgeBitSet getAllComponentsUndirectedEdges (MR.Const_Mesh mesh, MR.Const_UndirectedEdgeBitSet edges)
 subdivides given edges on connected components Generated from function MR.MeshComponents.getAllComponentsUndirectedEdges.
 
static unsafe bool hasFullySelectedComponent (MR.Const_Mesh mesh, MR.Const_VertBitSet selection)
 returns true if all vertices of a mesh connected component are present in selection Generated from function MR.MeshComponents.hasFullySelectedComponent.
 
static unsafe bool hasFullySelectedComponent (MR.Const_MeshTopology topology, MR.Const_VertBitSet selection)
 Generated from function MR.MeshComponents.hasFullySelectedComponent.
 
static unsafe void excludeFullySelectedComponents (MR.Const_Mesh mesh, MR.VertBitSet selection)
 if all vertices of a mesh connected component are present in selection, excludes these vertices Generated from function MR.MeshComponents.excludeFullySelectedComponents.
 
static unsafe MR.UnionFind_MRFaceId getUnionFindStructureFaces (MR.Const_MeshPart meshPart, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 gets union-find structure for faces with different options of face-connectivity Generated from function MR.MeshComponents.getUnionFindStructureFaces. Parameter incidence defaults to FaceIncidence.PerEdge.
 
static unsafe MR.UnionFind_MRFaceId getUnionFindStructureFaces (MR.Const_MeshTopology topology, MR.Const_FaceBitSet? region=null, MR.MeshComponents.FaceIncidence? incidence=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 Generated from function MR.MeshComponents.getUnionFindStructureFaces. Parameter incidence defaults to FaceIncidence.PerEdge.
 
static unsafe MR.UnionFind_MRFaceId getUnionFindStructureFacesPerEdge (MR.Const_MeshPart meshPart, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 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 thread-safe manner (that left and right face are always processed by one thread) Generated from function MR.MeshComponents.getUnionFindStructureFacesPerEdge.
 
static unsafe MR.UnionFind_MRFaceId getUnionFindStructureFacesPerEdge (MR.Const_MeshTopology topology, MR.Const_FaceBitSet? region=null, MR.Const_UndirectedEdgeBitSet? isCompBd=null)
 Generated from function MR.MeshComponents.getUnionFindStructureFacesPerEdge.
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVerts (MR.Const_Mesh mesh, MR.Const_VertBitSet? region=null)
 gets union-find structure for vertices Generated from function MR.MeshComponents.getUnionFindStructureVerts.
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVerts (MR.Const_MeshTopology topology, MR.Const_VertBitSet? region=null)
 Generated from function MR.MeshComponents.getUnionFindStructureVerts.
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVerts (MR.Const_Mesh mesh, MR.Const_EdgeBitSet edges)
 gets union-find structure for vertices, considering connections by given edges only Generated from function MR.MeshComponents.getUnionFindStructureVerts.
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVerts (MR.Const_Mesh mesh, MR.Const_UndirectedEdgeBitSet edges)
 gets union-find structure for vertices, considering connections by given undirected edges only Generated from function MR.MeshComponents.getUnionFindStructureVerts.
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVertsEx (MR.Const_Mesh mesh, MR.Const_UndirectedEdgeBitSet ignoreEdges)
 gets union-find structure for vertices, considering connections by all edges excluding given ones Generated from function MR.MeshComponents.getUnionFindStructureVertsEx.
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVertsSeparatedByPath (MR.Const_Mesh mesh, MR.Std.Const_Vector_MREdgePoint path, MR.VertBitSet? outPathVerts=null)
 gets union-find structure for vertices, separating vertices by given path (either closed or from boundary to boundary)
 
static unsafe MR.UnionFind_MRVertId getUnionFindStructureVertsSeparatedByPaths (MR.Const_Mesh mesh, MR.Std.Const_Vector_StdVectorMREdgePoint paths, MR.VertBitSet? outPathVerts=null)
 Generated from function MR.MeshComponents.getUnionFindStructureVertsSeparatedByPaths.
 
static unsafe MR.UnionFind_MRUndirectedEdgeId getUnionFindStructureUndirectedEdges (MR.Const_Mesh mesh, bool? allPointToRoots=null)
 gets union-find structure for all undirected edges in
 
static unsafe MR.UndirectedEdgeBitSet getComponentsUndirectedEdges (MR.Const_Mesh mesh, MR.Const_UndirectedEdgeBitSet seeds)
 returns union of connected components, each of which contains at least one seed edge Generated from function MR.MeshComponents.getComponentsUndirectedEdges.
 

Public Attributes

 PerEdge
 
 PerVertex
 

Member Enumeration Documentation

◆ FaceIncidence

enum MR.MeshComponents.FaceIncidence : int

Face incidence type.

Enumerator
PerEdge 

face can have neighbor only via edge

face can have neighbor via vertex

Member Function Documentation

◆ getAllComponents() [1/3]

static unsafe MR.Std.Pair_StdVectorMRFaceBitSet_Int MR.MeshComponents.getAllComponents ( MR.Const_MeshPart meshPart,
int maxComponentCount,
MR.MeshComponents.FaceIncidence? incidence = null,
MR.Const_UndirectedEdgeBitSet? isCompBd = null )
inlinestatic

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

Parameters
maxComponentCountshould be more then 1
Returns
pair components bitsets vector and number components in one group if components number more than maxComponentCount Generated from function MR.MeshComponents.getAllComponents. Parameter incidence defaults to FaceIncidence.PerEdge.

◆ getAllComponents() [2/3]

static unsafe MR.Std.Vector_MRFaceBitSet MR.MeshComponents.getAllComponents ( MR.Const_MeshPart meshPart,
MR.MeshComponents.FaceIncidence? incidence = null,
MR.Const_UndirectedEdgeBitSet? isCompBd = null )
inlinestatic

gets all connected components of mesh part

Note
be careful, if mesh is large enough and has many components, the memory overflow will occur Generated from function MR.MeshComponents.getAllComponents. Parameter incidence defaults to FaceIncidence.PerEdge.

◆ getAllComponents() [3/3]

static unsafe MR.Std.Vector_MRFaceBitSet MR.MeshComponents.getAllComponents ( MR.Face2RegionMap componentsMap,
int componentsCount,
MR.Const_FaceBitSet region,
int maxComponentCount )
inlinestatic

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)

Parameters
maxComponentCountshould be more then 1
Returns
components bitsets vector Generated from function MR.MeshComponents.getAllComponents.

◆ getAllComponentsMap()

static unsafe MR.Std.Pair_MRFace2RegionMap_Int MR.MeshComponents.getAllComponentsMap ( MR.Const_MeshPart meshPart,
MR.MeshComponents.FaceIncidence? incidence = null,
MR.Const_UndirectedEdgeBitSet? isCompBd = null )
inlinestatic

gets all connected components of mesh part as

  1. the mapping: FaceId -> Component ID in [0, 1, 2, ...)
  2. the total number of components Generated from function MR.MeshComponents.getAllComponentsMap. Parameter incidence defaults to FaceIncidence.PerEdge.

◆ getLargeByAreaRegions()

static unsafe MR.Std.Pair_MRFaceBitSet_Int MR.MeshComponents.getLargeByAreaRegions ( MR.Const_MeshPart meshPart,
MR.Const_Face2RegionMap regionMap,
int numRegions,
float minArea )
inlinestatic

returns

  1. the union of all regions with area >= minArea
  2. the number of such regions Generated from function MR.MeshComponents.getLargeByAreaRegions.

◆ getLargeComponentVerts()

static unsafe MR.VertBitSet MR.MeshComponents.getLargeComponentVerts ( MR.Const_Mesh mesh,
int minVerts,
MR.Const_VertBitSet? region = null )
inlinestatic

returns the union of vertex connected components, each having at least

Parameters
minVertsvertices Generated from function MR.MeshComponents.getLargeComponentVerts.

◆ getLargestComponent()

static unsafe MR.FaceBitSet MR.MeshComponents.getLargestComponent ( MR.Const_MeshPart meshPart,
MR.MeshComponents.FaceIncidence? incidence = null,
MR.Const_UndirectedEdgeBitSet? isCompBd = null,
float? minArea = null,
MR.Misc.InOut< int >? numSmallerComponents = null )
inlinestatic

returns the largest by surface area component or empty set if its area is smaller than

Parameters
minAreaGenerated from function MR.MeshComponents.getLargestComponent. Parameter incidence defaults to FaceIncidence.PerEdge. Parameter minArea defaults to 0.

◆ getUnionFindStructureUndirectedEdges()

static unsafe MR.UnionFind_MRUndirectedEdgeId MR.MeshComponents.getUnionFindStructureUndirectedEdges ( MR.Const_Mesh mesh,
bool? allPointToRoots = null )
inlinestatic

gets union-find structure for all undirected edges in

Parameters
mesh
allPointToRootsif true, then every element in the structure will point directly to the root of its respective component Generated from function MR.MeshComponents.getUnionFindStructureUndirectedEdges. Parameter allPointToRoots defaults to false.

◆ getUnionFindStructureVertsSeparatedByPath()

static unsafe MR.UnionFind_MRVertId MR.MeshComponents.getUnionFindStructureVertsSeparatedByPath ( MR.Const_Mesh mesh,
MR.Std.Const_Vector_MREdgePoint path,
MR.VertBitSet? outPathVerts = null )
inlinestatic

gets union-find structure for vertices, separating vertices by given path (either closed or from boundary to boundary)

Parameters
outPathVertsthis set receives all vertices passed by the path Generated from function MR.MeshComponents.getUnionFindStructureVertsSeparatedByPath.

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