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

Mesh Topology Generated from class MR.MeshTopology. This is the non-const half of the class. More...

+ Inheritance diagram for MR.MeshTopology:

Public Member Functions

unsafe MeshTopology ()
 Constructs an empty (default-constructed) instance.
 
unsafe MeshTopology (MR._ByValue_MeshTopology _other)
 Generated from constructor MR.MeshTopology.MeshTopology.
 
 MeshTopology (Const_MeshTopology _other)
 Generated from constructor MR.MeshTopology.MeshTopology.
 
 MeshTopology (MeshTopology _other)
 Generated from constructor MR.MeshTopology.MeshTopology.
 
unsafe MR.MeshTopology assign (MR._ByValue_MeshTopology _other)
 Generated from method MR.MeshTopology.operator=.
 
unsafe MR.EdgeId makeEdge ()
 creates an edge not associated with any vertex or face Generated from method MR.MeshTopology.makeEdge.
 
unsafe void edgeReserve (ulong newCapacity)
 sets the capacity of half-edges vector Generated from method MR.MeshTopology.edgeReserve.
 
unsafe void shrinkToFit ()
 requests the removal of unused capacity Generated from method MR.MeshTopology.shrinkToFit.
 
unsafe void splice (MR.EdgeId a, MR.EdgeId b)
 given two half edges do either of two: 1) if a and b were from distinct rings, puts them in one ring; 2) if a and b were from the same ring, puts them in separate rings; the cut in rings in both cases is made after a and b Generated from method MR.MeshTopology.splice.
 
unsafe MR.EdgeId collapseEdge (MR.EdgeId e, MR.Std.Const_Function_VoidFuncFromMREdgeIdMREdgeId onEdgeDel)
 collapses given edge in a vertex and deletes 1) faces: left( e ) and right( e ); 2) edges: e, next( e.sym() ), prev( e.sym() ), and optionally next( e ), prev( e ) if their left and right triangles are deleted; 3) all vertices that lost their last edge; calls onEdgeDel for every deleted edge (del) including given (e); if valid (rem) is given then dest( del ) = dest( rem ) and their origins are in different ends of collapsing edge, (rem) shall take the place of (del)
 
unsafe void setOrg (MR.EdgeId a, MR.VertId v)
 sets new origin to the full origin ring including this edge; edgePerVertex_ table is updated accordingly Generated from method MR.MeshTopology.setOrg.
 
unsafe void setLeft (MR.EdgeId a, MR.FaceId f)
 sets new left face to the full left ring including this edge; edgePerFace_ table is updated accordingly Generated from method MR.MeshTopology.setLeft.
 
unsafe MR.VertId addVertId ()
 creates new vert-id not associated with any edge yet Generated from method MR.MeshTopology.addVertId.
 
unsafe void vertResize (ulong newSize)
 explicitly increases the size of vertices vector Generated from method MR.MeshTopology.vertResize.
 
unsafe void vertResizeWithReserve (ulong newSize)
 explicitly increases the size of vertices vector, doubling the current capacity if it was not enough Generated from method MR.MeshTopology.vertResizeWithReserve.
 
unsafe void vertReserve (ulong newCapacity)
 sets the capacity of vertices vector Generated from method MR.MeshTopology.vertReserve.
 
unsafe MR.FaceId addFaceId ()
 creates new face-id not associated with any edge yet Generated from method MR.MeshTopology.addFaceId.
 
unsafe void deleteFace (MR.FaceId f, MR.Const_UndirectedEdgeBitSet? keepEdges=null)
 deletes the face, also deletes its edges and vertices if they were not shared by other faces and not in
 
unsafe void deleteFaces (MR.Const_FaceBitSet fs, MR.Const_UndirectedEdgeBitSet? keepEdges=null)
 deletes multiple given faces by calling deleteFace for each Generated from method MR.MeshTopology.deleteFaces.
 
unsafe void faceResize (ulong newSize)
 explicitly increases the size of faces vector Generated from method MR.MeshTopology.faceResize.
 
unsafe void faceResizeWithReserve (ulong newSize)
 explicitly increases the size of faces vector, doubling the current capacity if it was not enough Generated from method MR.MeshTopology.faceResizeWithReserve.
 
unsafe void faceReserve (ulong newCapacity)
 sets the capacity of faces vector Generated from method MR.MeshTopology.faceReserve.
 
unsafe void flipEdge (MR.EdgeId e)
 given the edge with left and right triangular faces, which form together a quadrangle, rotates the edge counter-clockwise inside the quadrangle Generated from method MR.MeshTopology.flipEdge.
 
unsafe MR.EdgeId splitEdge (MR.EdgeId e, MR.FaceBitSet? region=null, MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old=null)
 split given edge on two parts: dest(returned-edge) = org(e) - newly created vertex, org(returned-edge) = org(e-before-split), dest(e) = dest(e-before-split)
 
unsafe MR.VertId splitFace (MR.FaceId f, MR.FaceBitSet? region=null, MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old=null)
 split given triangle on three triangles, introducing new vertex (which is returned) inside original triangle and connecting it to its vertices
 
unsafe void flipOrientation (MR.Const_UndirectedEdgeBitSet? fullComponents=null)
 flip orientation (normals) of
 
unsafe void addPart (MR.Const_MeshTopology from, MR.Const_PartMapping? map=null, bool? rearrangeTriangles=null)
 appends mesh topology (from) in addition to the current topology: creates new edges, faces, verts;
 
unsafe void addPart (MR.Const_MeshTopology from, MR.FaceMap? outFmap=null, MR.VertMap? outVmap=null, MR.WholeEdgeMap? outEmap=null, bool? rearrangeTriangles=null)
 Generated from method MR.MeshTopology.addPart. Parameter rearrangeTriangles defaults to false.
 
unsafe void addPartByMask (MR.Const_MeshTopology from, MR.Const_FaceBitSet? fromFaces, MR.Const_PartMapping? map=null)
 the same but copies only portion of (from) specified by fromFaces, Generated from method MR.MeshTopology.addPartByMask. Parameter map defaults to {}.
 
unsafe void addPartByMask (MR.Const_MeshTopology from, MR.Const_FaceBitSet? fromFaces, bool? flipOrientation=null, MR.Std.Const_Vector_StdVectorMREdgeId? thisContours=null, MR.Std.Const_Vector_StdVectorMREdgeId? fromContours=null, MR.Const_PartMapping? map=null)
 this version has more parameters
 
unsafe void rotateTriangles ()
 for each triangle selects edgeWithLeft with minimal origin vertex Generated from method MR.MeshTopology.rotateTriangles.
 
unsafe void pack (MR.FaceMap? outFmap=null, MR.VertMap? outVmap=null, MR.WholeEdgeMap? outEmap=null, bool? rearrangeTriangles=null)
 tightly packs all arrays eliminating lone edges and invalid faces and vertices
 
unsafe void pack (MR.Const_PackMapping map)
 tightly packs all arrays eliminating lone edges and invalid faces and vertices; reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping Generated from method MR.MeshTopology.pack.
 
unsafe void packMinMem (MR.Const_PackMapping map)
 tightly packs all arrays eliminating lone edges and invalid faces and vertices; reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping; unlike pack method, this method allocates minimal amount of memory for its operation but works much slower Generated from method MR.MeshTopology.packMinMem.
 
unsafe void read (MR.Std.Istream s, MR.Std._ByValue_Function_BoolFuncFromFloat? callback=null)
 loads from binary stream
 
unsafe void resizeBeforeParallelAdd (ulong edgeSize, ulong vertSize, ulong faceSize)
 These function are for parallel mesh creation from different threads. If you are not sure, do not use them.
 
unsafe void addPackedPart (MR.Const_MeshTopology from, MR.EdgeId toEdgeId, MR.Const_FaceMap fmap, MR.Const_VertMap vmap)
 copies topology (from) into this;
 
unsafe bool computeValidsFromEdges (MR.Std._ByValue_Function_BoolFuncFromFloat? cb=null)
 compute 1) numValidVerts_ and validVerts_ from edgePerVertex_ 2) numValidFaces_ and validFaces_ from edgePerFace_ and activates their auto-update Generated from method MR.MeshTopology.computeValidsFromEdges. Parameter cb defaults to {}.
 
unsafe void stopUpdatingValids ()
 stops updating validVerts(), validFaces(), numValidVerts(), numValidFaces() for parallel processing of mesh parts Generated from method MR.MeshTopology.stopUpdatingValids.
 
unsafe void preferEdges (MR.Const_UndirectedEdgeBitSet stableEdges)
 for incident vertices and faces of given edges, remember one of them as edgeWithOrg and edgeWithLeft; this is important in parallel algorithms where other edges may change but stable ones will survive Generated from method MR.MeshTopology.preferEdges.
 
unsafe bool buildGridMesh (MR.Const_GridSettings settings, MR.Std._ByValue_Function_BoolFuncFromFloat? cb=null)
 Generated from method MR.MeshTopology.buildGridMesh. Parameter cb defaults to {}.
 

Detailed Description

Mesh Topology Generated from class MR.MeshTopology. This is the non-const half of the class.

Constructor & Destructor Documentation

◆ MeshTopology() [1/4]

unsafe MR.MeshTopology.MeshTopology ( )
inline

Constructs an empty (default-constructed) instance.

◆ MeshTopology() [2/4]

unsafe MR.MeshTopology.MeshTopology ( MR._ByValue_MeshTopology _other)
inline

Generated from constructor MR.MeshTopology.MeshTopology.

◆ MeshTopology() [3/4]

MR.MeshTopology.MeshTopology ( Const_MeshTopology _other)
inline

Generated from constructor MR.MeshTopology.MeshTopology.

◆ MeshTopology() [4/4]

MR.MeshTopology.MeshTopology ( MeshTopology _other)
inline

Generated from constructor MR.MeshTopology.MeshTopology.

Member Function Documentation

◆ addFaceId()

unsafe MR.FaceId MR.MeshTopology.addFaceId ( )
inline

creates new face-id not associated with any edge yet Generated from method MR.MeshTopology.addFaceId.

◆ addPackedPart()

unsafe void MR.MeshTopology.addPackedPart ( MR.Const_MeshTopology from,
MR.EdgeId toEdgeId,
MR.Const_FaceMap fmap,
MR.Const_VertMap vmap )
inline

copies topology (from) into this;

Parameters
fromedges must be tightly packes without any lone edges, and they are mapped [0, from.edges.size()) -> [toEdgeId, toEdgeId + from.edges.size());
fmap,vmapmapping of vertices and faces if it is given ( from.id -> this.id ) Generated from method MR.MeshTopology.addPackedPart.

◆ addPart() [1/2]

unsafe void MR.MeshTopology.addPart ( MR.Const_MeshTopology from,
MR.Const_PartMapping? map = null,
bool? rearrangeTriangles = null )
inline

appends mesh topology (from) in addition to the current topology: creates new edges, faces, verts;

Parameters
rearrangeTrianglesif true then the order of triangles is selected according to the order of their vertices, please call rotateTriangles() first Generated from method MR.MeshTopology.addPart. Parameter map defaults to {}. Parameter rearrangeTriangles defaults to false.

◆ addPart() [2/2]

unsafe void MR.MeshTopology.addPart ( MR.Const_MeshTopology from,
MR.FaceMap? outFmap = null,
MR.VertMap? outVmap = null,
MR.WholeEdgeMap? outEmap = null,
bool? rearrangeTriangles = null )
inline

Generated from method MR.MeshTopology.addPart. Parameter rearrangeTriangles defaults to false.

◆ addPartByMask() [1/2]

unsafe void MR.MeshTopology.addPartByMask ( MR.Const_MeshTopology from,
MR.Const_FaceBitSet? fromFaces,
bool? flipOrientation = null,
MR.Std.Const_Vector_StdVectorMREdgeId? thisContours = null,
MR.Std.Const_Vector_StdVectorMREdgeId? fromContours = null,
MR.Const_PartMapping? map = null )
inline

this version has more parameters

Parameters
flipOrientationif true then every from triangle is inverted before adding
thisContourscontours on this mesh (no left face) that have to be stitched with
fromContourscontours on from mesh during addition (no left face if flipOrientation otherwise no right face) Generated from method MR.MeshTopology.addPartByMask. Parameter flipOrientation defaults to false. Parameter thisContours defaults to {}. Parameter fromContours defaults to {}. Parameter map defaults to {}.

◆ addPartByMask() [2/2]

unsafe void MR.MeshTopology.addPartByMask ( MR.Const_MeshTopology from,
MR.Const_FaceBitSet? fromFaces,
MR.Const_PartMapping? map = null )
inline

the same but copies only portion of (from) specified by fromFaces, Generated from method MR.MeshTopology.addPartByMask. Parameter map defaults to {}.

◆ addVertId()

unsafe MR.VertId MR.MeshTopology.addVertId ( )
inline

creates new vert-id not associated with any edge yet Generated from method MR.MeshTopology.addVertId.

◆ assign()

unsafe MR.MeshTopology MR.MeshTopology.assign ( MR._ByValue_MeshTopology _other)
inline

Generated from method MR.MeshTopology.operator=.

◆ buildGridMesh()

unsafe bool MR.MeshTopology.buildGridMesh ( MR.Const_GridSettings settings,
MR.Std._ByValue_Function_BoolFuncFromFloat? cb = null )
inline

Generated from method MR.MeshTopology.buildGridMesh. Parameter cb defaults to {}.

◆ collapseEdge()

unsafe MR.EdgeId MR.MeshTopology.collapseEdge ( MR.EdgeId e,
MR.Std.Const_Function_VoidFuncFromMREdgeIdMREdgeId onEdgeDel )
inline

collapses given edge in a vertex and deletes 1) faces: left( e ) and right( e ); 2) edges: e, next( e.sym() ), prev( e.sym() ), and optionally next( e ), prev( e ) if their left and right triangles are deleted; 3) all vertices that lost their last edge; calls onEdgeDel for every deleted edge (del) including given (e); if valid (rem) is given then dest( del ) = dest( rem ) and their origins are in different ends of collapsing edge, (rem) shall take the place of (del)

Returns
prev( e ) if it is still valid Generated from method MR.MeshTopology.collapseEdge.

◆ computeValidsFromEdges()

unsafe bool MR.MeshTopology.computeValidsFromEdges ( MR.Std._ByValue_Function_BoolFuncFromFloat? cb = null)
inline

compute 1) numValidVerts_ and validVerts_ from edgePerVertex_ 2) numValidFaces_ and validFaces_ from edgePerFace_ and activates their auto-update Generated from method MR.MeshTopology.computeValidsFromEdges. Parameter cb defaults to {}.

◆ deleteFace()

unsafe void MR.MeshTopology.deleteFace ( MR.FaceId f,
MR.Const_UndirectedEdgeBitSet? keepEdges = null )
inline

deletes the face, also deletes its edges and vertices if they were not shared by other faces and not in

Parameters
keepFacesGenerated from method MR.MeshTopology.deleteFace.

◆ deleteFaces()

unsafe void MR.MeshTopology.deleteFaces ( MR.Const_FaceBitSet fs,
MR.Const_UndirectedEdgeBitSet? keepEdges = null )
inline

deletes multiple given faces by calling deleteFace for each Generated from method MR.MeshTopology.deleteFaces.

◆ edgeReserve()

unsafe void MR.MeshTopology.edgeReserve ( ulong newCapacity)
inline

sets the capacity of half-edges vector Generated from method MR.MeshTopology.edgeReserve.

◆ faceReserve()

unsafe void MR.MeshTopology.faceReserve ( ulong newCapacity)
inline

sets the capacity of faces vector Generated from method MR.MeshTopology.faceReserve.

◆ faceResize()

unsafe void MR.MeshTopology.faceResize ( ulong newSize)
inline

explicitly increases the size of faces vector Generated from method MR.MeshTopology.faceResize.

◆ faceResizeWithReserve()

unsafe void MR.MeshTopology.faceResizeWithReserve ( ulong newSize)
inline

explicitly increases the size of faces vector, doubling the current capacity if it was not enough Generated from method MR.MeshTopology.faceResizeWithReserve.

◆ flipEdge()

unsafe void MR.MeshTopology.flipEdge ( MR.EdgeId e)
inline

given the edge with left and right triangular faces, which form together a quadrangle, rotates the edge counter-clockwise inside the quadrangle Generated from method MR.MeshTopology.flipEdge.

◆ flipOrientation()

unsafe void MR.MeshTopology.flipOrientation ( MR.Const_UndirectedEdgeBitSet? fullComponents = null)
inline

flip orientation (normals) of

  • all mesh elements if
    Parameters
    fullComponentsis nullptr, or
  • given mesh components in
    Parameters
    fullComponents.The behavior is undefined if fullComponents is given but there are connected components with some edges included and not-included there. Generated from method MR.MeshTopology.flipOrientation.

◆ makeEdge()

unsafe MR.EdgeId MR.MeshTopology.makeEdge ( )
inline

creates an edge not associated with any vertex or face Generated from method MR.MeshTopology.makeEdge.

◆ pack() [1/2]

unsafe void MR.MeshTopology.pack ( MR.Const_PackMapping map)
inline

tightly packs all arrays eliminating lone edges and invalid faces and vertices; reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping Generated from method MR.MeshTopology.pack.

◆ pack() [2/2]

unsafe void MR.MeshTopology.pack ( MR.FaceMap? outFmap = null,
MR.VertMap? outVmap = null,
MR.WholeEdgeMap? outEmap = null,
bool? rearrangeTriangles = null )
inline

tightly packs all arrays eliminating lone edges and invalid faces and vertices

Parameters
outFmap,outVmap,outEmapif given returns mappings: old.id -> new.id;
rearrangeTrianglesif true then calls rotateTriangles() and selects the order of triangles according to the order of their vertices Generated from method MR.MeshTopology.pack. Parameter rearrangeTriangles defaults to false.

◆ packMinMem()

unsafe void MR.MeshTopology.packMinMem ( MR.Const_PackMapping map)
inline

tightly packs all arrays eliminating lone edges and invalid faces and vertices; reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping; unlike pack method, this method allocates minimal amount of memory for its operation but works much slower Generated from method MR.MeshTopology.packMinMem.

◆ preferEdges()

unsafe void MR.MeshTopology.preferEdges ( MR.Const_UndirectedEdgeBitSet stableEdges)
inline

for incident vertices and faces of given edges, remember one of them as edgeWithOrg and edgeWithLeft; this is important in parallel algorithms where other edges may change but stable ones will survive Generated from method MR.MeshTopology.preferEdges.

◆ read()

unsafe void MR.MeshTopology.read ( MR.Std.Istream s,
MR.Std._ByValue_Function_BoolFuncFromFloat? callback = null )
inline

loads from binary stream

Returns
text of error if any Generated from method MR.MeshTopology.read. Parameter callback defaults to {}.

◆ resizeBeforeParallelAdd()

unsafe void MR.MeshTopology.resizeBeforeParallelAdd ( ulong edgeSize,
ulong vertSize,
ulong faceSize )
inline

These function are for parallel mesh creation from different threads. If you are not sure, do not use them.

resizes all internal vectors and sets the numbers of valid elements in preparation for addPackedPart; edges are resized without initialization (so the user must initialize them using addPackedPart) Generated from method MR.MeshTopology.resizeBeforeParallelAdd.

◆ rotateTriangles()

unsafe void MR.MeshTopology.rotateTriangles ( )
inline

for each triangle selects edgeWithLeft with minimal origin vertex Generated from method MR.MeshTopology.rotateTriangles.

◆ setLeft()

unsafe void MR.MeshTopology.setLeft ( MR.EdgeId a,
MR.FaceId f )
inline

sets new left face to the full left ring including this edge; edgePerFace_ table is updated accordingly Generated from method MR.MeshTopology.setLeft.

◆ setOrg()

unsafe void MR.MeshTopology.setOrg ( MR.EdgeId a,
MR.VertId v )
inline

sets new origin to the full origin ring including this edge; edgePerVertex_ table is updated accordingly Generated from method MR.MeshTopology.setOrg.

◆ shrinkToFit()

unsafe void MR.MeshTopology.shrinkToFit ( )
inline

requests the removal of unused capacity Generated from method MR.MeshTopology.shrinkToFit.

◆ splice()

unsafe void MR.MeshTopology.splice ( MR.EdgeId a,
MR.EdgeId b )
inline

given two half edges do either of two: 1) if a and b were from distinct rings, puts them in one ring; 2) if a and b were from the same ring, puts them in separate rings; the cut in rings in both cases is made after a and b Generated from method MR.MeshTopology.splice.

◆ splitEdge()

unsafe MR.EdgeId MR.MeshTopology.splitEdge ( MR.EdgeId e,
MR.FaceBitSet? region = null,
MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old = null )
inline

split given edge on two parts: dest(returned-edge) = org(e) - newly created vertex, org(returned-edge) = org(e-before-split), dest(e) = dest(e-before-split)

left and right faces of given edge if valid are also subdivided on two parts each; the split edge will keep both face IDs and their degrees, and the new edge will have new face IDs and new faces are triangular; if left or right faces of the original edge were in the region, then include new parts of these faces in the region

Parameters
new2Oldreceive mapping from newly appeared triangle to its original triangle (part to full) Generated from method MR.MeshTopology.splitEdge.

◆ splitFace()

unsafe MR.VertId MR.MeshTopology.splitFace ( MR.FaceId f,
MR.FaceBitSet? region = null,
MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old = null )
inline

split given triangle on three triangles, introducing new vertex (which is returned) inside original triangle and connecting it to its vertices

if region is given, then it must include (f) and new faces will be added there as well

Parameters
new2Oldreceive mapping from newly appeared triangle to its original triangle (part to full) Generated from method MR.MeshTopology.splitFace.

◆ stopUpdatingValids()

unsafe void MR.MeshTopology.stopUpdatingValids ( )
inline

stops updating validVerts(), validFaces(), numValidVerts(), numValidFaces() for parallel processing of mesh parts Generated from method MR.MeshTopology.stopUpdatingValids.

◆ vertReserve()

unsafe void MR.MeshTopology.vertReserve ( ulong newCapacity)
inline

sets the capacity of vertices vector Generated from method MR.MeshTopology.vertReserve.

◆ vertResize()

unsafe void MR.MeshTopology.vertResize ( ulong newSize)
inline

explicitly increases the size of vertices vector Generated from method MR.MeshTopology.vertResize.

◆ vertResizeWithReserve()

unsafe void MR.MeshTopology.vertResizeWithReserve ( ulong newSize)
inline

explicitly increases the size of vertices vector, doubling the current capacity if it was not enough Generated from method MR.MeshTopology.vertResizeWithReserve.


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