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

This class represents a mesh, including topology (connectivity) information and point coordinates, as well as some caches to accelerate search algorithms Generated from class MR.Mesh. This is the non-const half of the class. More...

+ Inheritance diagram for MR.Mesh:

Public Member Functions

unsafe Mesh ()
 Constructs an empty (default-constructed) instance.
 
unsafe Mesh (MR._ByValue_Mesh _other)
 Generated from constructor MR.Mesh.Mesh.
 
 Mesh (Const_Mesh _other)
 Generated from constructor MR.Mesh.Mesh.
 
 Mesh (Mesh _other)
 Generated from constructor MR.Mesh.Mesh.
 
unsafe MR.Mesh assign (MR._ByValue_Mesh _other)
 Generated from method MR.Mesh.operator=.
 
unsafe void zeroUnusedPoints ()
 for all points not in topology.getValidVerts() sets coordinates to (0,0,0) Generated from method MR.Mesh.zeroUnusedPoints.
 
unsafe void transform (in MR.AffineXf3f xf, MR.Const_VertBitSet? region=null)
 applies given transformation to specified vertices if region is nullptr, all valid mesh vertices are used
 
unsafe MR.VertId addPoint (in MR.Vector3f pos)
 creates new point and assigns given position to it Generated from method MR.Mesh.addPoint.
 
unsafe MR.EdgeId addSeparateEdgeLoop (MR.Std.Const_Vector_MRVector3f contourPoints)
 append points to mesh and connect them as closed edge loop returns first EdgeId of new edges Generated from method MR.Mesh.addSeparateEdgeLoop.
 
unsafe MR.EdgeId addSeparateContours (MR.Std.Const_Vector_StdVectorMRVector3f contours, MR.AffineXf3f? xf=null)
 append points to mesh and connect them returns first EdgeId of new edges Generated from method MR.Mesh.addSeparateContours.
 
unsafe void attachEdgeLoopPart (MR.EdgeId first, MR.EdgeId last, MR.Std.Const_Vector_MRVector3f contourPoints)
 append points to mesh and connect them to given edges making edge loop first point connects with first edge dest last point connects with last edge org note that first and last edge should have no left face Generated from method MR.Mesh.attachEdgeLoopPart.
 
unsafe MR.EdgeId splitEdge (MR.EdgeId e, in MR.Vector3f newVertPos, 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.EdgeId splitEdge (MR.EdgeId e, MR.FaceBitSet? region=null, MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old=null)
 Generated from method MR.Mesh.splitEdge.
 
unsafe MR.VertId splitFace (MR.FaceId f, in MR.Vector3f newVertPos, MR.FaceBitSet? region=null, MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old=null)
 split given triangle on three triangles, introducing new vertex with given coordinates and connecting it to original triangle vertices; if region is given, then it must include (f) and new faces will be added there as well
 
unsafe MR.VertId splitFace (MR.FaceId f, MR.FaceBitSet? region=null, MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old=null)
 Generated from method MR.Mesh.splitFace.
 
unsafe void addMesh (MR.Const_Mesh from, MR.Const_PartMapping? map=null, bool? rearrangeTriangles=null)
 appends another mesh as separate connected component(s) to this Generated from method MR.Mesh.addMesh. Parameter map defaults to {}. Parameter rearrangeTriangles defaults to false.
 
unsafe void addMesh (MR.Const_Mesh from, MR.FaceMap? outFmap, MR.VertMap? outVmap=null, MR.WholeEdgeMap? outEmap=null, bool? rearrangeTriangles=null)
 Generated from method MR.Mesh.addMesh. Parameter rearrangeTriangles defaults to false.
 
unsafe void addMeshPart (MR.Const_MeshPart from, MR.Const_PartMapping map)
 appends whole or part of another mesh as separate connected component(s) to this Generated from method MR.Mesh.addMeshPart.
 
unsafe void addMeshPart (MR.Const_MeshPart from, bool? flipOrientation=null, MR.Std.Const_Vector_StdVectorMREdgeId? thisContours=null, MR.Std.Const_Vector_StdVectorMREdgeId? fromContours=null, MR.Const_PartMapping? map=null)
 appends whole or part of another mesh to this joining added faces with existed ones along given contours
 
unsafe void pack (MR.Const_PartMapping? map=null, bool? rearrangeTriangles=null)
 tightly packs all arrays eliminating lone edges and invalid faces, vertices and points Generated from method MR.Mesh.pack. Parameter map defaults to {}. Parameter rearrangeTriangles defaults to false.
 
unsafe void pack (MR.FaceMap? outFmap, MR.VertMap? outVmap=null, MR.WholeEdgeMap? outEmap=null, bool? rearrangeTriangles=null)
 Generated from method MR.Mesh.pack. Parameter rearrangeTriangles defaults to false.
 
unsafe void pack (MR.Const_PackMapping map, MR.Std._ByValue_Function_BoolFuncFromFloat? cb=null)
 tightly packs all arrays eliminating lone edges and invalid faces, vertices and points, reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping Generated from method MR.Mesh.pack. Parameter cb defaults to {}.
 
unsafe MR.PackMapping packOptimally (bool? preserveAABBTree=null)
 packs tightly and rearranges vertices, triangles and edges to put close in space elements in close indices
 
unsafe MR.PackMapping packOptimally (bool preserveAABBTree, MR.Std._ByValue_Function_BoolFuncFromFloat cb)
 Generated from method MR.Mesh.packOptimally.
 
unsafe void deleteFaces (MR.Const_FaceBitSet fs, MR.Const_UndirectedEdgeBitSet? keepEdges=null)
 deletes multiple given faces, also deletes adjacent edges and vertices if they were not shared by remaining faces and not in
 
unsafe void invalidateCaches (bool? pointsChanged=null)
 invalidates caches (aabb-trees) after any change in mesh geometry or topology
 
unsafe void updateCaches (MR.Const_VertBitSet changedVerts)
 updates existing caches in case of few vertices were changed insignificantly, and topology remained unchanged; it shall be considered as a faster alternative to invalidateCaches() and following rebuild of trees Generated from method MR.Mesh.updateCaches.
 
unsafe void shrinkToFit ()
 requests the removal of unused capacity Generated from method MR.Mesh.shrinkToFit.
 
unsafe void mirror (MR.Const_Plane3f plane)
 reflects the mesh from a given plane Generated from method MR.Mesh.mirror.
 

Properties

new unsafe MR.MeshTopology topology [get, protected set]
 
new unsafe MR.VertCoords points [get, protected set]
 

Detailed Description

This class represents a mesh, including topology (connectivity) information and point coordinates, as well as some caches to accelerate search algorithms Generated from class MR.Mesh. This is the non-const half of the class.

Constructor & Destructor Documentation

◆ Mesh() [1/4]

unsafe MR.Mesh.Mesh ( )
inline

Constructs an empty (default-constructed) instance.

◆ Mesh() [2/4]

unsafe MR.Mesh.Mesh ( MR._ByValue_Mesh _other)
inline

Generated from constructor MR.Mesh.Mesh.

◆ Mesh() [3/4]

MR.Mesh.Mesh ( Const_Mesh _other)
inline

Generated from constructor MR.Mesh.Mesh.

◆ Mesh() [4/4]

MR.Mesh.Mesh ( Mesh _other)
inline

Generated from constructor MR.Mesh.Mesh.

Member Function Documentation

◆ addMesh() [1/2]

unsafe void MR.Mesh.addMesh ( MR.Const_Mesh from,
MR.Const_PartMapping? map = null,
bool? rearrangeTriangles = null )
inline

appends another mesh as separate connected component(s) to this Generated from method MR.Mesh.addMesh. Parameter map defaults to {}. Parameter rearrangeTriangles defaults to false.

◆ addMesh() [2/2]

unsafe void MR.Mesh.addMesh ( MR.Const_Mesh from,
MR.FaceMap? outFmap,
MR.VertMap? outVmap = null,
MR.WholeEdgeMap? outEmap = null,
bool? rearrangeTriangles = null )
inline

Generated from method MR.Mesh.addMesh. Parameter rearrangeTriangles defaults to false.

◆ addMeshPart() [1/2]

unsafe void MR.Mesh.addMeshPart ( MR.Const_MeshPart from,
bool? flipOrientation = null,
MR.Std.Const_Vector_StdVectorMREdgeId? thisContours = null,
MR.Std.Const_Vector_StdVectorMREdgeId? fromContours = null,
MR.Const_PartMapping? map = null )
inline

appends whole or part of another mesh to this joining added faces with existed ones along given contours

Parameters
flipOrientationtrue means that every (from) triangle is inverted before adding Generated from method MR.Mesh.addMeshPart. Parameter flipOrientation defaults to false. Parameter thisContours defaults to {}. Parameter fromContours defaults to {}. Parameter map defaults to {}.

◆ addMeshPart() [2/2]

unsafe void MR.Mesh.addMeshPart ( MR.Const_MeshPart from,
MR.Const_PartMapping map )
inline

appends whole or part of another mesh as separate connected component(s) to this Generated from method MR.Mesh.addMeshPart.

◆ addPoint()

unsafe MR.VertId MR.Mesh.addPoint ( in MR.Vector3f pos)
inline

creates new point and assigns given position to it Generated from method MR.Mesh.addPoint.

◆ addSeparateContours()

unsafe MR.EdgeId MR.Mesh.addSeparateContours ( MR.Std.Const_Vector_StdVectorMRVector3f contours,
MR.AffineXf3f? xf = null )
inline

append points to mesh and connect them returns first EdgeId of new edges Generated from method MR.Mesh.addSeparateContours.

◆ addSeparateEdgeLoop()

unsafe MR.EdgeId MR.Mesh.addSeparateEdgeLoop ( MR.Std.Const_Vector_MRVector3f contourPoints)
inline

append points to mesh and connect them as closed edge loop returns first EdgeId of new edges Generated from method MR.Mesh.addSeparateEdgeLoop.

◆ assign()

unsafe MR.Mesh MR.Mesh.assign ( MR._ByValue_Mesh _other)
inline

Generated from method MR.Mesh.operator=.

◆ attachEdgeLoopPart()

unsafe void MR.Mesh.attachEdgeLoopPart ( MR.EdgeId first,
MR.EdgeId last,
MR.Std.Const_Vector_MRVector3f contourPoints )
inline

append points to mesh and connect them to given edges making edge loop first point connects with first edge dest last point connects with last edge org note that first and last edge should have no left face Generated from method MR.Mesh.attachEdgeLoopPart.

◆ deleteFaces()

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

deletes multiple given faces, also deletes adjacent edges and vertices if they were not shared by remaining faces and not in

Parameters
keepEdgesGenerated from method MR.Mesh.deleteFaces.

◆ invalidateCaches()

unsafe void MR.Mesh.invalidateCaches ( bool? pointsChanged = null)
inline

invalidates caches (aabb-trees) after any change in mesh geometry or topology

Parameters
pointsChangedspecifies whether points have changed (otherwise only topology has changed) Generated from method MR.Mesh.invalidateCaches. Parameter pointsChanged defaults to true.

◆ mirror()

unsafe void MR.Mesh.mirror ( MR.Const_Plane3f plane)
inline

reflects the mesh from a given plane Generated from method MR.Mesh.mirror.

◆ pack() [1/3]

unsafe void MR.Mesh.pack ( MR.Const_PackMapping map,
MR.Std._ByValue_Function_BoolFuncFromFloat? cb = null )
inline

tightly packs all arrays eliminating lone edges and invalid faces, vertices and points, reorder all faces, vertices and edges according to given maps, each containing old id -> new id mapping Generated from method MR.Mesh.pack. Parameter cb defaults to {}.

◆ pack() [2/3]

unsafe void MR.Mesh.pack ( MR.Const_PartMapping? map = null,
bool? rearrangeTriangles = null )
inline

tightly packs all arrays eliminating lone edges and invalid faces, vertices and points Generated from method MR.Mesh.pack. Parameter map defaults to {}. Parameter rearrangeTriangles defaults to false.

◆ pack() [3/3]

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

Generated from method MR.Mesh.pack. Parameter rearrangeTriangles defaults to false.

◆ packOptimally() [1/2]

unsafe MR.PackMapping MR.Mesh.packOptimally ( bool preserveAABBTree,
MR.Std._ByValue_Function_BoolFuncFromFloat cb )
inline

Generated from method MR.Mesh.packOptimally.

◆ packOptimally() [2/2]

unsafe MR.PackMapping MR.Mesh.packOptimally ( bool? preserveAABBTree = null)
inline

packs tightly and rearranges vertices, triangles and edges to put close in space elements in close indices

Parameters
preserveAABBTreewhether to keep valid mesh's AABB tree after return (it will take longer to compute and it will occupy more memory) Generated from method MR.Mesh.packOptimally. Parameter preserveAABBTree defaults to true.

◆ shrinkToFit()

unsafe void MR.Mesh.shrinkToFit ( )
inline

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

◆ splitEdge() [1/2]

unsafe MR.EdgeId MR.Mesh.splitEdge ( MR.EdgeId e,
in MR.Vector3f newVertPos,
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.Mesh.splitEdge.

◆ splitEdge() [2/2]

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

Generated from method MR.Mesh.splitEdge.

◆ splitFace() [1/2]

unsafe MR.VertId MR.Mesh.splitFace ( MR.FaceId f,
in MR.Vector3f newVertPos,
MR.FaceBitSet? region = null,
MR.Phmap.FlatHashMap_MRFaceId_MRFaceId? new2Old = null )
inline

split given triangle on three triangles, introducing new vertex with given coordinates and connecting it to original triangle 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.Mesh.splitFace.

◆ splitFace() [2/2]

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

Generated from method MR.Mesh.splitFace.

◆ transform()

unsafe void MR.Mesh.transform ( in MR.AffineXf3f xf,
MR.Const_VertBitSet? region = null )
inline

applies given transformation to specified vertices if region is nullptr, all valid mesh vertices are used

Generated from method MR.Mesh.transform.

◆ updateCaches()

unsafe void MR.Mesh.updateCaches ( MR.Const_VertBitSet changedVerts)
inline

updates existing caches in case of few vertices were changed insignificantly, and topology remained unchanged; it shall be considered as a faster alternative to invalidateCaches() and following rebuild of trees Generated from method MR.Mesh.updateCaches.

◆ zeroUnusedPoints()

unsafe void MR.Mesh.zeroUnusedPoints ( )
inline

for all points not in topology.getValidVerts() sets coordinates to (0,0,0) Generated from method MR.Mesh.zeroUnusedPoints.

Property Documentation

◆ points

new unsafe MR.VertCoords MR.Mesh.points
getprotected set

◆ topology

new unsafe MR.MeshTopology MR.Mesh.topology
getprotected set

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