MeshLib C# Docs
Loading...
Searching...
No Matches
MR.Const_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 const half of the class. More...

+ Inheritance diagram for MR.Const_Mesh:

Classes

struct  _Underlying
 
struct  _UnderlyingShared
 

Public Member Functions

virtual void Dispose ()
 
unsafe Const_Mesh ()
 Constructs an empty (default-constructed) instance.
 
unsafe Const_Mesh (MR._ByValue_Mesh _other)
 Generated from constructor MR.Mesh.Mesh.
 
unsafe MR.Vector3f orgPnt (MR.EdgeId e)
 returns coordinates of the edge origin Generated from method MR.Mesh.orgPnt.
 
unsafe MR.Vector3f destPnt (MR.EdgeId e)
 returns coordinates of the edge destination Generated from method MR.Mesh.destPnt.
 
unsafe MR.Vector3f edgeVector (MR.EdgeId e)
 returns vector equal to edge destination point minus edge origin point Generated from method MR.Mesh.edgeVector.
 
unsafe MR.LineSegm3f edgeSegment (MR.EdgeId e)
 returns line segment of given edge Generated from method MR.Mesh.edgeSegment.
 
unsafe MR.Vector3f edgePoint (MR.EdgeId e, float f)
 returns a point on the edge: origin point for f=0 and destination point for f=1 Generated from method MR.Mesh.edgePoint.
 
unsafe MR.Vector3f edgePoint (MR.Const_EdgePoint ep)
 computes coordinates of point given as edge and relative position on it Generated from method MR.Mesh.edgePoint.
 
unsafe MR.Vector3f edgeCenter (MR.UndirectedEdgeId e)
 computes the center of given edge Generated from method MR.Mesh.edgeCenter.
 
unsafe void getLeftTriPoints (MR.EdgeId e, ref MR.Vector3f v0, ref MR.Vector3f v1, ref MR.Vector3f v2)
 returns three points of left face of e: v0 = orgPnt( e ), v1 = destPnt( e ) Generated from method MR.Mesh.getLeftTriPoints.
 
unsafe MR.Std.Array_MRVector3f_3 getLeftTriPoints (MR.EdgeId e)
 returns three points of left face of e: res[0] = orgPnt( e ), res[1] = destPnt( e ) Generated from method MR.Mesh.getLeftTriPoints.
 
unsafe void getTriPoints (MR.FaceId f, ref MR.Vector3f v0, ref MR.Vector3f v1, ref MR.Vector3f v2)
 returns three points of given face Generated from method MR.Mesh.getTriPoints.
 
unsafe MR.Std.Array_MRVector3f_3 getTriPoints (MR.FaceId f)
 returns three points of given face Generated from method MR.Mesh.getTriPoints.
 
unsafe MR.Vector3f triPoint (MR.Const_MeshTriPoint p)
 computes coordinates of point given as face and barycentric representation Generated from method MR.Mesh.triPoint.
 
unsafe MR.Vector3f triCenter (MR.FaceId f)
 returns the centroid of given triangle Generated from method MR.Mesh.triCenter.
 
unsafe float triangleAspectRatio (MR.FaceId f)
 returns aspect ratio of given mesh triangle equal to the ratio of the circum-radius to twice its in-radius Generated from method MR.Mesh.triangleAspectRatio.
 
unsafe float circumcircleDiameterSq (MR.FaceId f)
 returns squared circumcircle diameter of given mesh triangle Generated from method MR.Mesh.circumcircleDiameterSq.
 
unsafe float circumcircleDiameter (MR.FaceId f)
 returns circumcircle diameter of given mesh triangle Generated from method MR.Mesh.circumcircleDiameter.
 
unsafe MR.MeshTriPoint toTriPoint (MR.VertId v)
 converts vertex into barycentric representation Generated from method MR.Mesh.toTriPoint.
 
unsafe MR.MeshTriPoint toTriPoint (MR.FaceId f, in MR.Vector3f p)
 converts face id and 3d point into barycentric representation Generated from method MR.Mesh.toTriPoint.
 
unsafe MR.MeshTriPoint toTriPoint (MR.Const_PointOnFace p)
 converts face id and 3d point into barycentric representation Generated from method MR.Mesh.toTriPoint.
 
unsafe MR.EdgePoint toEdgePoint (MR.VertId v)
 converts vertex into edge-point representation Generated from method MR.Mesh.toEdgePoint.
 
unsafe MR.EdgePoint toEdgePoint (MR.EdgeId e, in MR.Vector3f p)
 converts edge and 3d point into edge-point representation Generated from method MR.Mesh.toEdgePoint.
 
unsafe MR.VertId getClosestVertex (MR.Const_PointOnFace p)
 returns one of three face vertices, closest to given point Generated from method MR.Mesh.getClosestVertex.
 
unsafe MR.VertId getClosestVertex (MR.Const_MeshTriPoint p)
 returns one of three face vertices, closest to given point Generated from method MR.Mesh.getClosestVertex.
 
unsafe MR.UndirectedEdgeId getClosestEdge (MR.Const_PointOnFace p)
 returns one of three face edges, closest to given point Generated from method MR.Mesh.getClosestEdge.
 
unsafe MR.UndirectedEdgeId getClosestEdge (MR.Const_MeshTriPoint p)
 returns one of three face edges, closest to given point Generated from method MR.Mesh.getClosestEdge.
 
unsafe float edgeLength (MR.UndirectedEdgeId e)
 returns Euclidean length of the edge Generated from method MR.Mesh.edgeLength.
 
unsafe MR.UndirectedEdgeScalars edgeLengths ()
 computes and returns the lengths of all edges in the mesh Generated from method MR.Mesh.edgeLengths.
 
unsafe float edgeLengthSq (MR.UndirectedEdgeId e)
 returns squared Euclidean length of the edge (faster to compute than length) Generated from method MR.Mesh.edgeLengthSq.
 
unsafe MR.Vector3f leftDirDblArea (MR.EdgeId e)
 computes directed double area of left triangular face of given edge Generated from method MR.Mesh.leftDirDblArea.
 
unsafe MR.Vector3f dirDblArea (MR.FaceId f)
 computes directed double area for a triangular face from its vertices Generated from method MR.Mesh.dirDblArea.
 
unsafe float dblArea (MR.FaceId f)
 returns twice the area of given face Generated from method MR.Mesh.dblArea.
 
unsafe float area (MR.FaceId f)
 returns the area of given face Generated from method MR.Mesh.area.
 
unsafe double area (MR.Const_FaceBitSet? fs=null)
 computes the area of given face-region (or whole mesh) Generated from method MR.Mesh.area.
 
unsafe MR.Vector3d dirArea (MR.Const_FaceBitSet? fs=null)
 computes the sum of directed areas for faces from given region (or whole mesh) Generated from method MR.Mesh.dirArea.
 
unsafe double projArea (in MR.Vector3f dir, MR.Const_FaceBitSet? fs=null)
 computes the sum of absolute projected area of faces from given region (or whole mesh) as visible if look from given direction Generated from method MR.Mesh.projArea.
 
unsafe double volume (MR.Const_FaceBitSet? region=null)
 returns volume of the object surrounded by given region (or whole mesh if (region) is nullptr); if the region has holes then each hole will be virtually filled by adding triangles for each edge and the hole's geometrical center Generated from method MR.Mesh.volume.
 
unsafe double holePerimeter (MR.EdgeId e)
 computes the perimeter of the hole specified by one of its edges with no valid left face (left is hole) Generated from method MR.Mesh.holePerimeter.
 
unsafe MR.Vector3d holeDirArea (MR.EdgeId e)
 computes directed area of the hole specified by one of its edges with no valid left face (left is hole); if the hole is planar then returned vector is orthogonal to the plane pointing outside and its magnitude is equal to hole area Generated from method MR.Mesh.holeDirArea.
 
unsafe MR.Vector3f leftTangent (MR.EdgeId e)
 computes unit vector that is both orthogonal to given edge and to the normal of its left triangle, the vector is directed inside left triangle Generated from method MR.Mesh.leftTangent.
 
unsafe MR.Vector3f leftNormal (MR.EdgeId e)
 computes triangular face normal from its vertices Generated from method MR.Mesh.leftNormal.
 
unsafe MR.Vector3f normal (MR.FaceId f)
 computes triangular face normal from its vertices Generated from method MR.Mesh.normal.
 
unsafe MR.Plane3f getPlane3f (MR.FaceId f)
 returns the plane containing given triangular face with normal looking outwards Generated from method MR.Mesh.getPlane3f.
 
unsafe MR.Plane3d getPlane3d (MR.FaceId f)
 Generated from method MR.Mesh.getPlane3d.
 
unsafe MR.Vector3f dirDblArea (MR.VertId v)
 computes sum of directed double areas of all triangles around given vertex Generated from method MR.Mesh.dirDblArea.
 
unsafe float dblArea (MR.VertId v)
 computes the length of summed directed double areas of all triangles around given vertex Generated from method MR.Mesh.dblArea.
 
unsafe MR.Vector3f normal (MR.VertId v)
 computes normal in a vertex using sum of directed areas of neighboring triangles Generated from method MR.Mesh.normal.
 
unsafe MR.Vector3f normal (MR.Const_MeshTriPoint p)
 computes normal in three vertices of p's triangle, then interpolates them using barycentric coordinates and normalizes again; this is the same normal as in rendering with smooth shading Generated from method MR.Mesh.normal.
 
unsafe MR.Vector3f pseudonormal (MR.VertId v, MR.Const_FaceBitSet? region=null)
 computes angle-weighted sum of normals of incident faces of given vertex (only (region) faces will be considered); the sum is normalized before returning Generated from method MR.Mesh.pseudonormal.
 
unsafe MR.Vector3f pseudonormal (MR.UndirectedEdgeId e, MR.Const_FaceBitSet? region=null)
 computes normalized half sum of face normals sharing given edge (only (region) faces will be considered); Generated from method MR.Mesh.pseudonormal.
 
unsafe MR.Vector3f pseudonormal (MR.Const_MeshTriPoint p, MR.Const_FaceBitSet? region=null)
 returns pseudonormal in corresponding face/edge/vertex for signed distance calculation as suggested in the article "Signed Distance Computation Using the Angle Weighted Pseudonormal" by J. Andreas Baerentzen and Henrik Aanaes, https://backend.orbit.dtu.dk/ws/portalfiles/portal/3977815/B_rentzen.pdf unlike normal( const MeshTriPoint & p ), this is not a smooth function Generated from method MR.Mesh.pseudonormal.
 
unsafe float signedDistance (in MR.Vector3f pt, MR.Const_MeshProjectionResult proj, MR.Const_FaceBitSet? region=null)
 given a point (pt) in 3D and the closest point to in on mesh (proj),
 
unsafe float signedDistance (in MR.Vector3f pt)
 given a point (pt) in 3D, computes the closest point on mesh, and
 
unsafe MR.Std.Optional_Float signedDistance (in MR.Vector3f pt, float maxDistSq, MR.Const_FaceBitSet? region=null)
 given a point (pt) in 3D, computes the closest point on mesh, and
 
unsafe float calcFastWindingNumber (in MR.Vector3f pt, float? beta=null)
 computes generalized winding number in a point (pt), which is
 
unsafe bool isOutside (in MR.Vector3f pt, float? windingNumberThreshold=null, float? beta=null)
 computes whether a point (pt) is located outside the object surrounded by this mesh using generalized winding number
 
unsafe bool isOutsideByProjNorm (in MR.Vector3f pt, MR.Const_MeshProjectionResult proj, MR.Const_FaceBitSet? region=null)
 computes whether a point (pt) is located outside the object surrounded by this mesh using pseudonormal at the closest point to in on mesh (proj); this method works much faster than isOutside but can return wrong sign if the closest point is located on self-intersecting part of the mesh Generated from method MR.Mesh.isOutsideByProjNorm.
 
unsafe float sumAngles (MR.VertId v, MR.Misc.InOut< bool >? outBoundaryVert=null)
 computes the sum of triangle angles at given vertex; optionally returns whether the vertex is on boundary Generated from method MR.Mesh.sumAngles.
 
unsafe MR.VertBitSet findSpikeVertices (float minSumAngle, MR.Const_VertBitSet? region=null, MR.Std.Const_Function_BoolFuncFromFloat? cb=null)
 returns vertices where the sum of triangle angles is below given threshold Generated from method MR.Mesh.findSpikeVertices. Parameter cb defaults to {}.
 
unsafe float dihedralAngleSin (MR.UndirectedEdgeId e)
 given an edge between two triangular faces, computes sine of dihedral angle between them: 0 if both faces are in the same plane, positive if the faces form convex surface, negative if the faces form concave surface Generated from method MR.Mesh.dihedralAngleSin.
 
unsafe float dihedralAngleCos (MR.UndirectedEdgeId e)
 given an edge between two triangular faces, computes cosine of dihedral angle between them: 1 if both faces are in the same plane, 0 if the surface makes right angle turn at the edge, -1 if the faces overlap one another Generated from method MR.Mesh.dihedralAngleCos.
 
unsafe float dihedralAngle (MR.UndirectedEdgeId e)
 given an edge between two triangular faces, computes the dihedral angle between them: 0 if both faces are in the same plane, positive if the faces form convex surface, negative if the faces form concave surface; please consider the usage of faster dihedralAngleSin(e) and dihedralAngleCos(e) Generated from method MR.Mesh.dihedralAngle.
 
unsafe float discreteMeanCurvature (MR.VertId v)
 computes discrete mean curvature in given vertex, measures in length^-1; 0 for planar regions, positive for convex surface, negative for concave surface Generated from method MR.Mesh.discreteMeanCurvature.
 
unsafe float discreteMeanCurvature (MR.UndirectedEdgeId e)
 computes discrete mean curvature in given edge, measures in length^-1; 0 for planar regions, positive for convex surface, negative for concave surface Generated from method MR.Mesh.discreteMeanCurvature.
 
unsafe float discreteGaussianCurvature (MR.VertId v, MR.Misc.InOut< bool >? outBoundaryVert=null)
 computes discrete Gaussian curvature (or angle defect) at given vertex, which 0 in inner vertices on planar mesh parts and reaches 2*pi on needle's tip, see http://math.uchicago.edu/~may/REU2015/REUPapers/Upadhyay.pdf optionally returns whether the vertex is on boundary Generated from method MR.Mesh.discreteGaussianCurvature.
 
unsafe MR.UndirectedEdgeBitSet findCreaseEdges (float angleFromPlanar)
 finds all mesh edges where dihedral angle is distinct from planar PI angle on at least given value Generated from method MR.Mesh.findCreaseEdges.
 
unsafe float leftCotan (MR.EdgeId e)
 computes cotangent of the angle in the left( e ) triangle opposite to e, and returns 0 if left face does not exist Generated from method MR.Mesh.leftCotan.
 
unsafe float cotan (MR.UndirectedEdgeId ue)
 computes sum of cotangents of the angle in the left and right triangles opposite to given edge, consider cotangents zero for not existing triangles Generated from method MR.Mesh.cotan.
 
unsafe MR.QuadraticForm3f quadraticForm (MR.VertId v, bool angleWeigted, MR.Const_FaceBitSet? region=null, MR.Const_UndirectedEdgeBitSet? creases=null)
 computes quadratic form in the vertex as the sum of squared distances from 1) planes of adjacent triangles, with the weight equal to the angle of adjacent triangle at this vertex divided on PI in case of angleWeigted=true; 2) lines of adjacent boundary and crease edges Generated from method MR.Mesh.quadraticForm.
 
unsafe MR.Box3f getBoundingBox ()
 returns the bounding box containing all valid vertices (implemented via getAABBTree()) this bounding box is insignificantly bigger that minimal box due to AABB algorithms precision Generated from method MR.Mesh.getBoundingBox.
 
unsafe MR.Box3f computeBoundingBox (MR.AffineXf3f? toWorld=null)
 passes through all valid vertices and finds the minimal bounding box containing all of them; if toWorld transformation is given then returns minimal bounding box in world space Generated from method MR.Mesh.computeBoundingBox.
 
unsafe MR.Box3f computeBoundingBox (MR.Const_FaceBitSet? region, MR.AffineXf3f? toWorld=null)
 passes through all given faces (or whole mesh if region == null) and finds the minimal bounding box containing all of them if toWorld transformation is given then returns minimal bounding box in world space Generated from method MR.Mesh.computeBoundingBox.
 
unsafe float averageEdgeLength ()
 computes average length of an edge in this mesh Generated from method MR.Mesh.averageEdgeLength.
 
unsafe MR.Vector3f findCenterFromPoints ()
 computes average position of all valid mesh vertices Generated from method MR.Mesh.findCenterFromPoints.
 
unsafe MR.Vector3f findCenterFromFaces ()
 computes center of mass considering that density of all triangles is the same Generated from method MR.Mesh.findCenterFromFaces.
 
unsafe MR.Vector3f findCenterFromBBox ()
 computes bounding box and returns its center Generated from method MR.Mesh.findCenterFromBBox.
 
unsafe MR.Mesh cloneRegion (MR.Const_FaceBitSet region, bool? flipOrientation=null, MR.Const_PartMapping? map=null)
 creates new mesh from given triangles of this mesh Generated from method MR.Mesh.cloneRegion. Parameter flipOrientation defaults to false. Parameter map defaults to {}.
 
unsafe bool projectPoint (in MR.Vector3f point, MR.PointOnFace res, float? maxDistSq=null, MR.Const_FaceBitSet? region=null, MR.AffineXf3f? xf=null)
 finds the closest mesh point on this mesh (or its region) to given point;
 
unsafe bool projectPoint (in MR.Vector3f point, MR.MeshProjectionResult res, float? maxDistSq=null, MR.Const_FaceBitSet? region=null, MR.AffineXf3f? xf=null)
 finds the closest mesh point on this mesh (or its region) to given point;
 
unsafe bool findClosestPoint (in MR.Vector3f point, MR.MeshProjectionResult res, float? maxDistSq=null, MR.Const_FaceBitSet? region=null, MR.AffineXf3f? xf=null)
 Generated from method MR.Mesh.findClosestPoint. Parameter maxDistSq defaults to 3.40282347e38f.
 
unsafe MR.MeshProjectionResult projectPoint (in MR.Vector3f point, float? maxDistSq=null, MR.Const_FaceBitSet? region=null, MR.AffineXf3f? xf=null)
 finds the closest mesh point on this mesh (or its region) to given point;
 
unsafe MR.MeshProjectionResult findClosestPoint (in MR.Vector3f point, float? maxDistSq=null, MR.Const_FaceBitSet? region=null, MR.AffineXf3f? xf=null)
 Generated from method MR.Mesh.findClosestPoint. Parameter maxDistSq defaults to 3.40282347e38f.
 
unsafe MR.Const_AABBTree getAABBTree ()
 returns cached aabb-tree for this mesh, creating it if it did not exist in a thread-safe manner Generated from method MR.Mesh.getAABBTree.
 
unsafe MR.? Const_AABBTree getAABBTreeNotCreate ()
 returns cached aabb-tree for this mesh, but does not create it if it did not exist Generated from method MR.Mesh.getAABBTreeNotCreate.
 
unsafe MR.Const_AABBTreePoints getAABBTreePoints ()
 returns cached aabb-tree for points of this mesh, creating it if it did not exist in a thread-safe manner Generated from method MR.Mesh.getAABBTreePoints.
 
unsafe MR.? Const_AABBTreePoints getAABBTreePointsNotCreate ()
 returns cached aabb-tree for points of this mesh, but does not create it if it did not exist Generated from method MR.Mesh.getAABBTreePointsNotCreate.
 
unsafe MR.Const_Dipoles getDipoles ()
 returns cached dipoles of aabb-tree nodes for this mesh, creating it if it did not exist in a thread-safe manner Generated from method MR.Mesh.getDipoles.
 
unsafe MR.? Const_Dipoles getDipolesNotCreate ()
 returns cached dipoles of aabb-tree nodes for this mesh, but does not create it if it did not exist Generated from method MR.Mesh.getDipolesNotCreate.
 
unsafe ulong heapBytes ()
 Generated from method MR.Mesh.heapBytes.
 
bool Equals (MR.Const_Mesh? b)
 
override bool Equals (object? other)
 

Static Public Member Functions

static unsafe MR.Mesh fromTriangles (MR._ByValue_VertCoords vertexCoordinates, MR.Const_Triangulation t, MR.MeshBuilder.Const_BuildSettings? settings=null, MR.Std._ByValue_Function_BoolFuncFromFloat? cb=null)
 construct mesh from vertex coordinates and a set of triangles with given ids Generated from method MR.Mesh.fromTriangles. Parameter settings defaults to {}. Parameter cb defaults to {}.
 
static unsafe MR.Mesh fromTriMesh (MR.Misc._Moved< MR.TriMesh > triMesh, MR.MeshBuilder.Const_BuildSettings? settings=null, MR.Std._ByValue_Function_BoolFuncFromFloat? cb=null)
 construct mesh from TriMesh representation Generated from method MR.Mesh.fromTriMesh. Parameter settings defaults to {}. Parameter cb defaults to {}.
 
static unsafe MR.Mesh fromTrianglesDuplicatingNonManifoldVertices (MR._ByValue_VertCoords vertexCoordinates, MR.Triangulation t, MR.Std.Vector_MRMeshBuilderVertDuplication? dups=null, MR.MeshBuilder.Const_BuildSettings? settings=null)
 construct mesh from vertex coordinates and a set of triangles with given ids; unlike simple fromTriangles() it tries to resolve non-manifold vertices by creating duplicate vertices Generated from method MR.Mesh.fromTrianglesDuplicatingNonManifoldVertices. Parameter settings defaults to {}.
 
static unsafe MR.Mesh fromFaceSoup (MR._ByValue_VertCoords vertexCoordinates, MR.Std.Const_Vector_MRVertId verts, MR.Const_Vector_MRMeshBuilderVertSpan_MRFaceId faces, MR.MeshBuilder.Const_BuildSettings? settings=null, MR.Std._ByValue_Function_BoolFuncFromFloat? cb=null)
 construct mesh from vertex coordinates and construct mesh topology from face soup, where each face can have arbitrary degree (not only triangles); all non-triangular faces will be automatically subdivided on triangles Generated from method MR.Mesh.fromFaceSoup. Parameter settings defaults to {}. Parameter cb defaults to {}.
 
static unsafe MR.Mesh fromPointTriples (MR.Std.Const_Vector_StdArrayMRVector3f3 posTriples, bool duplicateNonManifoldVertices)
 construct mesh from point triples;
 
static unsafe bool operator== (MR.Const_Mesh _this, MR.Const_Mesh b)
 compare that two meshes are exactly the same Generated from method MR.Mesh.operator==.
 
static unsafe bool operator!= (MR.Const_Mesh _this, MR.Const_Mesh b)
 

Protected Member Functions

unsafe void _LateMakeShared (_Underlying *ptr)
 
virtual unsafe void Dispose (bool disposing)
 

Properties

override unsafe bool _IsOwning [get]
 Check if the underlying shared pointer is owning or not.
 
unsafe MR.Const_MeshTopology topology [get]
 
unsafe MR.Const_VertCoords points [get]
 
- Properties inherited from MR.Misc.SharedObject< Const_Mesh >
override bool _IsOwning [get]
 This checks if the shared_ptr itself is owning or not, rather than whether we own our shared_ptr, which isn't a given. The derived classes have to implement this, since it depends on the specific shared_ptr type.
 
bool _IsOwningSharedPtr [get]
 This checks if we own the underlying shared_ptr instance, regardless of whether it owns the underlying object, which is orthogonal. We repurpose _IsOwningVal for this.
 

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 const half of the class.

Member Function Documentation

◆ calcFastWindingNumber()

unsafe float MR.Const_Mesh.calcFastWindingNumber ( in MR.Vector3f pt,
float? beta = null )
inline

computes generalized winding number in a point (pt), which is

  • for closed mesh with normals outside: 1 inside, 0 outside;
  • for planar mesh: 0.5 inside, -0.5 outside; and in general is equal to (portion of solid angle where inside part of mesh is observable) minus (portion of solid angle where outside part of mesh is observable)
    Parameters
    betadetermines the precision of fast approximation: the more the better, recommended value 2 or more Generated from method MR.Mesh.calcFastWindingNumber. Parameter beta defaults to 2.

◆ fromPointTriples()

static unsafe MR.Mesh MR.Const_Mesh.fromPointTriples ( MR.Std.Const_Vector_StdArrayMRVector3f3 posTriples,
bool duplicateNonManifoldVertices )
inlinestatic

construct mesh from point triples;

Parameters
duplicateNonManifoldVertices= false, all coinciding points are given the same VertId in the result; duplicateNonManifoldVertices = true, it tries to avoid non-manifold vertices by creating duplicate vertices with same coordinates Generated from method MR.Mesh.fromPointTriples.

◆ isOutside()

unsafe bool MR.Const_Mesh.isOutside ( in MR.Vector3f pt,
float? windingNumberThreshold = null,
float? beta = null )
inline

computes whether a point (pt) is located outside the object surrounded by this mesh using generalized winding number

Parameters
betadetermines the precision of winding number computation: the more the better, recommended value 2 or more Generated from method MR.Mesh.isOutside. Parameter windingNumberThreshold defaults to 0.5f. Parameter beta defaults to 2.

◆ projectPoint() [1/3]

unsafe MR.MeshProjectionResult MR.Const_Mesh.projectPoint ( in MR.Vector3f point,
float? maxDistSq = null,
MR.Const_FaceBitSet? region = null,
MR.AffineXf3f? xf = null )
inline

finds the closest mesh point on this mesh (or its region) to given point;

Parameters
pointsource location to look the closest to
maxDistSqsearch only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance
xfis mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster;
Returns
found closest point including Euclidean coordinates, barycentric coordinates, FaceId and squared distance to point or std.nullopt if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point Generated from method MR.Mesh.projectPoint. Parameter maxDistSq defaults to 3.40282347e38f.

◆ projectPoint() [2/3]

unsafe bool MR.Const_Mesh.projectPoint ( in MR.Vector3f point,
MR.MeshProjectionResult res,
float? maxDistSq = null,
MR.Const_FaceBitSet? region = null,
MR.AffineXf3f? xf = null )
inline

finds the closest mesh point on this mesh (or its region) to given point;

Parameters
pointsource location to look the closest to
resfound closest point including Euclidean coordinates, barycentric coordinates, FaceId and squared distance to point
maxDistSqsearch only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance
xfis mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster;
Returns
false if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point Generated from method MR.Mesh.projectPoint. Parameter maxDistSq defaults to 3.40282347e38f.

◆ projectPoint() [3/3]

unsafe bool MR.Const_Mesh.projectPoint ( in MR.Vector3f point,
MR.PointOnFace res,
float? maxDistSq = null,
MR.Const_FaceBitSet? region = null,
MR.AffineXf3f? xf = null )
inline

finds the closest mesh point on this mesh (or its region) to given point;

Parameters
pointsource location to look the closest to
resfound closest point including Euclidean coordinates and FaceId
maxDistSqsearch only in the ball with sqrt(maxDistSq) radius around given point, smaller value here increases performance
xfis mesh-to-point transformation, if not specified then identity transformation is assumed and works much faster;
Returns
false if no mesh point is found in the ball with sqrt(maxDistSq) radius around given point Generated from method MR.Mesh.projectPoint. Parameter maxDistSq defaults to 3.40282347e38f.

◆ signedDistance() [1/3]

unsafe float MR.Const_Mesh.signedDistance ( in MR.Vector3f pt)
inline

given a point (pt) in 3D, computes the closest point on mesh, and

Returns
signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh Generated from method MR.Mesh.signedDistance.

◆ signedDistance() [2/3]

unsafe MR.Std.Optional_Float MR.Const_Mesh.signedDistance ( in MR.Vector3f pt,
float maxDistSq,
MR.Const_FaceBitSet? region = null )
inline

given a point (pt) in 3D, computes the closest point on mesh, and

Returns
signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh; or std.nullopt if the projection point is not within maxDist; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh Generated from method MR.Mesh.signedDistance.

◆ signedDistance() [3/3]

unsafe float MR.Const_Mesh.signedDistance ( in MR.Vector3f pt,
MR.Const_MeshProjectionResult proj,
MR.Const_FaceBitSet? region = null )
inline

given a point (pt) in 3D and the closest point to in on mesh (proj),

Returns
signed distance from pt to mesh: positive value - outside mesh, negative - inside mesh; this method can return wrong sign if the closest point is located on self-intersecting part of the mesh Generated from method MR.Mesh.signedDistance.

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