MeshLib Java Docs
Loading...
Searching...
No Matches
Inheritance diagram for meshlib.Mesh:

Public Member Functions

 Mesh (java.lang.foreign.MemorySegment ptr, boolean owned, java.lang.Object owner)
 Mesh ()
 Mesh (meshlib.Mesh _other)
meshlib.Mesh assignFromAnother (meshlib.Mesh _other)
boolean opEqual (meshlib.Mesh b)
boolean opNotEqual (meshlib.Mesh b)
meshlib.Vector3f orgPnt (meshlib.EdgeId e)
meshlib.Vector3f destPnt (meshlib.EdgeId e)
meshlib.Vector3f edgeVector (meshlib.EdgeId e)
meshlib.LineSegm3f edgeSegment (meshlib.EdgeId e)
meshlib.Vector3f edgePoint (meshlib.EdgeId e, float f)
meshlib.Vector3f edgePoint (meshlib.EdgePoint ep)
meshlib.Vector3f edgeCenter (meshlib.UndirectedEdgeId e)
void getLeftTriPoints (meshlib.EdgeId e, meshlib.Vector3f v0, meshlib.Vector3f v1, meshlib.Vector3f v2)
meshlib.std_array_MR_Vector3f_3 getLeftTriPoints (meshlib.EdgeId e)
void getTriPoints (meshlib.FaceId f, meshlib.Vector3f v0, meshlib.Vector3f v1, meshlib.Vector3f v2)
meshlib.std_array_MR_Vector3f_3 getTriPoints (meshlib.FaceId f)
meshlib.Vector3f triPoint (meshlib.MeshTriPoint p)
meshlib.Vector3f triCenter (meshlib.FaceId f)
float triangleAspectRatio (meshlib.FaceId f)
float circumcircleDiameterSq (meshlib.FaceId f)
float circumcircleDiameter (meshlib.FaceId f)
meshlib.MeshTriPoint toTriPoint (meshlib.VertId v)
meshlib.MeshTriPoint toTriPoint (meshlib.FaceId f, meshlib.Vector3f p)
meshlib.MeshTriPoint toTriPoint (meshlib.PointOnFace p)
meshlib.EdgePoint toEdgePoint (meshlib.VertId v)
meshlib.EdgePoint toEdgePoint (meshlib.EdgeId e, meshlib.Vector3f p)
meshlib.VertId getClosestVertex (meshlib.PointOnFace p)
meshlib.VertId getClosestVertex (meshlib.MeshTriPoint p)
meshlib.UndirectedEdgeId getClosestEdge (meshlib.PointOnFace p)
meshlib.UndirectedEdgeId getClosestEdge (meshlib.MeshTriPoint p)
float edgeLength (meshlib.UndirectedEdgeId e)
meshlib.UndirectedEdgeScalars edgeLengths ()
float edgeLengthSq (meshlib.UndirectedEdgeId e)
meshlib.Vector3f leftDirDblArea (meshlib.EdgeId e)
meshlib.Vector3f dirDblArea (meshlib.FaceId f)
float dblArea (meshlib.FaceId f)
float area (meshlib.FaceId f)
double area (meshlib.FaceBitSet fs)
meshlib.Vector3d dirArea (meshlib.FaceBitSet fs)
double projArea (meshlib.Vector3f dir, meshlib.FaceBitSet fs)
double volume (meshlib.FaceBitSet region)
double holePerimeter (meshlib.EdgeId e)
meshlib.Vector3d holeDirArea (meshlib.EdgeId e)
meshlib.Vector3f leftTangent (meshlib.EdgeId e)
meshlib.Vector3f leftNormal (meshlib.EdgeId e)
meshlib.Vector3f normal (meshlib.FaceId f)
meshlib.Plane3f getPlane3f (meshlib.FaceId f)
meshlib.Plane3d getPlane3d (meshlib.FaceId f)
meshlib.Vector3f dirDblArea (meshlib.VertId v)
float dblArea (meshlib.VertId v)
meshlib.Vector3f normal (meshlib.VertId v)
meshlib.Vector3f normal (meshlib.MeshTriPoint p)
meshlib.Vector3f pseudonormal (meshlib.VertId v, meshlib.FaceBitSet region)
meshlib.Vector3f pseudonormal (meshlib.UndirectedEdgeId e, meshlib.FaceBitSet region)
meshlib.Vector3f pseudonormal (meshlib.MeshTriPoint p, meshlib.FaceBitSet region)
float signedDistance (meshlib.Vector3f pt, meshlib.MeshProjectionResult proj, meshlib.FaceBitSet region)
float signedDistance (meshlib.Vector3f pt)
meshlib.std_optional_float signedDistance (meshlib.Vector3f pt, float maxDistSq, meshlib.FaceBitSet region)
float calcFastWindingNumber (meshlib.Vector3f pt, java.lang.Float beta)
boolean isOutside (meshlib.Vector3f pt, java.lang.Float windingNumberThreshold, java.lang.Float beta)
boolean isOutsideByProjNorm (meshlib.Vector3f pt, meshlib.MeshProjectionResult proj, meshlib.FaceBitSet region)
float sumAngles (meshlib.VertId v, meshlib.bool_output outBoundaryVert)
meshlib.VertBitSet findSpikeVertices (float minSumAngle, meshlib.VertBitSet region, meshlib.std_function_bool_from_float cb)
float dihedralAngleSin (meshlib.UndirectedEdgeId e)
float dihedralAngleCos (meshlib.UndirectedEdgeId e)
float dihedralAngle (meshlib.UndirectedEdgeId e)
float discreteMeanCurvature (meshlib.VertId v)
float discreteMeanCurvature (meshlib.UndirectedEdgeId e)
float discreteGaussianCurvature (meshlib.VertId v, meshlib.bool_output outBoundaryVert)
meshlib.VertScalars discreteMeanCurvatures (meshlib.VertBitSet region)
meshlib.VertScalars discreteGaussianCurvatures (meshlib.VertBitSet region)
meshlib.UndirectedEdgeBitSet findSharpEdges (float minSharpCos, float maxSharpCos)
meshlib.UndirectedEdgeBitSet findCreaseEdges (float angleFromPlanar)
float leftCotan (meshlib.EdgeId e)
float cotan (meshlib.UndirectedEdgeId ue)
meshlib.QuadraticForm3f quadraticForm (meshlib.VertId v, boolean angleWeigted, meshlib.FaceBitSet region, meshlib.UndirectedEdgeBitSet creases)
meshlib.Box3f getBoundingBox ()
meshlib.Box3f computeBoundingBox (meshlib.AffineXf3f toWorld)
meshlib.Box3f computeBoundingBox (meshlib.FaceBitSet region, meshlib.AffineXf3f toWorld)
float averageEdgeLength ()
meshlib.Vector3f findCenterFromPoints ()
meshlib.Vector3f findCenterFromFaces ()
meshlib.Vector3f findCenterFromBBox ()
void zeroUnusedPoints ()
void transform (meshlib.AffineXf3f xf, meshlib.VertBitSet region)
meshlib.VertId addPoint (meshlib.Vector3f pos)
meshlib.EdgeId addSeparateEdgeLoop (meshlib.std_vector_MR_Vector3f contourPoints)
meshlib.EdgeId addSeparateContours (meshlib.std_vector_std_vector_MR_Vector3f contours, meshlib.AffineXf3f xf)
void attachEdgeLoopPart (meshlib.EdgeId first, meshlib.EdgeId last, meshlib.std_vector_MR_Vector3f contourPoints)
meshlib.EdgeId splitEdge (meshlib.EdgeId e, meshlib.Vector3f newVertPos, meshlib.FaceBitSet region, meshlib.phmap.phmap_flat_hash_map_MR_FaceId_MR_FaceId_phmap_Hash_MR_FaceId_phmap_EqualTo_MR_FaceId_MR_Allocator_st__dda91c58 new2Old)
meshlib.EdgeId splitEdge (meshlib.EdgeId e, meshlib.FaceBitSet region, meshlib.phmap.phmap_flat_hash_map_MR_FaceId_MR_FaceId_phmap_Hash_MR_FaceId_phmap_EqualTo_MR_FaceId_MR_Allocator_st__dda91c58 new2Old)
meshlib.VertId splitFace (meshlib.FaceId f, meshlib.Vector3f newVertPos, meshlib.FaceBitSet region, meshlib.phmap.phmap_flat_hash_map_MR_FaceId_MR_FaceId_phmap_Hash_MR_FaceId_phmap_EqualTo_MR_FaceId_MR_Allocator_st__dda91c58 new2Old)
meshlib.VertId splitFace (meshlib.FaceId f, meshlib.FaceBitSet region, meshlib.phmap.phmap_flat_hash_map_MR_FaceId_MR_FaceId_phmap_Hash_MR_FaceId_phmap_EqualTo_MR_FaceId_MR_Allocator_st__dda91c58 new2Old)
void addMesh (meshlib.Mesh from, meshlib.PartMapping map, java.lang.Boolean rearrangeTriangles)
void addMesh (meshlib.Mesh from, meshlib.FaceMap outFmap, meshlib.VertMap outVmap, meshlib.WholeEdgeMap outEmap, java.lang.Boolean rearrangeTriangles)
void addMeshPart (meshlib.MeshPart from, meshlib.PartMapping map, meshlib.VacantElements vacant)
boolean addMeshPart (meshlib.MeshPart from, java.lang.Boolean flipOrientation, meshlib.std_vector_std_vector_MR_EdgeId thisContours, meshlib.std_vector_std_vector_MR_EdgeId fromContours, meshlib.PartMapping map, meshlib.VacantElements vacant)
meshlib.Mesh cloneRegion (meshlib.FaceBitSet region, java.lang.Boolean flipOrientation, meshlib.PartMapping map)
void pack (meshlib.PartMapping map, java.lang.Boolean rearrangeTriangles)
void pack (meshlib.FaceMap outFmap, meshlib.VertMap outVmap, meshlib.WholeEdgeMap outEmap, java.lang.Boolean rearrangeTriangles)
void pack (meshlib.PackMapping map, meshlib.std_function_bool_from_float cb)
meshlib.PackMapping packOptimally (java.lang.Boolean preserveAABBTree)
meshlib.PackMapping packOptimally (boolean preserveAABBTree, meshlib.std_function_bool_from_float cb)
void deleteFaces (meshlib.FaceBitSet fs, meshlib.UndirectedEdgeBitSet keepEdges)
meshlib.VacantElements deleteFacesFindVacant (meshlib.FaceBitSet fs, meshlib.UndirectedEdgeBitSet keepEdges)
boolean projectPoint (meshlib.Vector3f point, meshlib.PointOnFace res, java.lang.Float maxDistSq, meshlib.FaceBitSet region, meshlib.AffineXf3f xf)
boolean projectPoint (meshlib.Vector3f point, meshlib.MeshProjectionResult res, java.lang.Float maxDistSq, meshlib.FaceBitSet region, meshlib.AffineXf3f xf)
boolean findClosestPoint (meshlib.Vector3f point, meshlib.MeshProjectionResult res, java.lang.Float maxDistSq, meshlib.FaceBitSet region, meshlib.AffineXf3f xf)
meshlib.MeshProjectionResult projectPoint (meshlib.Vector3f point, java.lang.Float maxDistSq, meshlib.FaceBitSet region, meshlib.AffineXf3f xf)
meshlib.MeshProjectionResult findClosestPoint (meshlib.Vector3f point, java.lang.Float maxDistSq, meshlib.FaceBitSet region, meshlib.AffineXf3f xf)
meshlib.AABBTree getAABBTree ()
meshlib.AABBTree getAABBTreeNotCreate ()
meshlib.AABBTreePoints getAABBTreePoints ()
meshlib.AABBTreePoints getAABBTreePointsNotCreate ()
meshlib.Dipoles getDipoles ()
meshlib.Dipoles getDipolesNotCreate ()
void invalidateCaches (java.lang.Boolean pointsChanged)
void updateCaches (meshlib.VertBitSet changedVerts)
void updateCachesAfterSplits (meshlib.phmap.phmap_flat_hash_map_MR_FaceId_MR_FaceId_phmap_Hash_MR_FaceId_phmap_EqualTo_MR_FaceId_MR_Allocator_st__dda91c58 new2Old)
void flipOrientation (meshlib.UndirectedEdgeBitSet fullComponents)
long heapBytes ()
void shrinkToFit ()
void mirror (meshlib.Plane3f plane)
meshlib.MeshTopology topology ()
void setTopology (meshlib.MeshTopology value)
meshlib.VertCoords points ()
void setPoints (meshlib.VertCoords value)
Public Member Functions inherited from meshlib.CppObject
final java.lang.foreign.MemorySegment rawPointer ()
final boolean isOwned ()
final void close ()
final java.lang.foreign.MemorySegment release ()

Static Public Member Functions

static meshlib.Mesh fromTriangles (meshlib.VertCoords vertexCoordinates, meshlib.Triangulation t, meshlib.meshbuilder.BuildSettings settings, meshlib.std_function_bool_from_float cb)
static meshlib.Mesh fromTriMesh (meshlib.TriMesh triMesh, meshlib.meshbuilder.BuildSettings settings, meshlib.std_function_bool_from_float cb)
static meshlib.Mesh fromTrianglesDuplicatingNonManifoldVertices (meshlib.VertCoords vertexCoordinates, meshlib.Triangulation t, meshlib.std_vector_MR_MeshBuilder_VertDuplication dups, meshlib.meshbuilder.BuildSettings settings, meshlib.std_function_bool_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId_MR_VertId betterCont)
static meshlib.Mesh fromFaceSoup (meshlib.VertCoords vertexCoordinates, meshlib.std_vector_MR_VertId verts, meshlib.Vector_MR_MeshBuilder_VertSpan_MR_FaceId faces, meshlib.meshbuilder.BuildSettings settings, meshlib.std_function_bool_from_float cb)
static meshlib.Mesh fromPointTriples (meshlib.std_vector_std_array_MR_Vector3f_3 posTriples, boolean duplicateNonManifoldVertices)

Additional Inherited Members

Protected Member Functions inherited from meshlib.CppObject
 CppObject (java.lang.foreign.MemorySegment ptr, java.util.function.Consumer< java.lang.foreign.MemorySegment > destroy, java.lang.Object owner)

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.

Instances created here own their C++ objects, see CppObject.

Constructor & Destructor Documentation

◆ Mesh() [1/3]

meshlib.Mesh.Mesh ( java.lang.foreign.MemorySegment ptr,
boolean owned,
java.lang.Object owner )

Wraps a pointer from the C bindings. If owned, the object is destroyed when the wrapper dies. owner is kept alive as long as this wrapper is. Not for normal use.

◆ Mesh() [2/3]

meshlib.Mesh.Mesh ( )

Constructs an empty (default-constructed) instance.

Calls MR_Mesh_DefaultConstruct().

◆ Mesh() [3/3]

meshlib.Mesh.Mesh ( meshlib.Mesh _other)

Generated from constructor MR::Mesh::Mesh. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object.

Calls MR_Mesh_ConstructFromAnother().

Member Function Documentation

◆ addMesh() [1/2]

void meshlib.Mesh.addMesh ( meshlib.Mesh from,
meshlib.FaceMap outFmap,
meshlib.VertMap outVmap,
meshlib.WholeEdgeMap outEmap,
java.lang.Boolean rearrangeTriangles )

Generated from method MR::Mesh::addMesh.

Calls MR_Mesh_addMesh_outMaps().

◆ addMesh() [2/2]

void meshlib.Mesh.addMesh ( meshlib.Mesh from,
meshlib.PartMapping map,
java.lang.Boolean rearrangeTriangles )

appends another mesh as separate connected component(s) to this Generated from method MR::Mesh::addMesh.

Calls MR_Mesh_addMesh().

◆ addMeshPart() [1/2]

boolean meshlib.Mesh.addMeshPart ( meshlib.MeshPart from,
java.lang.Boolean flipOrientation,
meshlib.std_vector_std_vector_MR_EdgeId thisContours,
meshlib.std_vector_std_vector_MR_EdgeId fromContours,
meshlib.PartMapping map,
meshlib.VacantElements vacant )

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 optional
vacantcan be passed to copy elements not at the end, but over given ones, which the user guaranties to be free/lone
Returns
false if the given contours cannot be stitched, and this mesh is left unmodified then (the src2tgt mappings in (map) argument can be partially filled nevertheless) Generated from method MR::Mesh::addMeshPart.

Calls MR_Mesh_addMeshPart().

◆ addMeshPart() [2/2]

void meshlib.Mesh.addMeshPart ( meshlib.MeshPart from,
meshlib.PartMapping map,
meshlib.VacantElements vacant )

appends whole or part of another mesh as separate connected component(s) to this optional

Parameters
vacantcan be passed to copy elements not at the end, but over given ones, which the user guaranties to be free/lone Generated from method MR::Mesh::addMeshPart.

Calls MR_Mesh_addMeshPart_mapping().

◆ addPoint()

meshlib.VertId meshlib.Mesh.addPoint ( meshlib.Vector3f pos)

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

Calls MR_Mesh_addPoint().

◆ addSeparateContours()

meshlib.EdgeId meshlib.Mesh.addSeparateContours ( meshlib.std_vector_std_vector_MR_Vector3f contours,
meshlib.AffineXf3f xf )

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

Calls MR_Mesh_addSeparateContours().

◆ addSeparateEdgeLoop()

meshlib.EdgeId meshlib.Mesh.addSeparateEdgeLoop ( meshlib.std_vector_MR_Vector3f contourPoints)

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

Calls MR_Mesh_addSeparateEdgeLoop().

◆ area() [1/2]

double meshlib.Mesh.area ( meshlib.FaceBitSet fs)

computes the area of given face-region (or whole mesh) Generated from method MR::Mesh::area.

Calls MR_Mesh_area_const_MR_FaceBitSet_ptr().

◆ area() [2/2]

float meshlib.Mesh.area ( meshlib.FaceId f)

returns the area of given face Generated from method MR::Mesh::area.

Calls MR_Mesh_area_MR_FaceId().

◆ assignFromAnother()

meshlib.Mesh meshlib.Mesh.assignFromAnother ( meshlib.Mesh _other)

Generated from method MR::Mesh::operator=. The reference to things referred to by the parameter _other (if any) might be preserved in this object.

Calls MR_Mesh_AssignFromAnother().

◆ attachEdgeLoopPart()

void meshlib.Mesh.attachEdgeLoopPart ( meshlib.EdgeId first,
meshlib.EdgeId last,
meshlib.std_vector_MR_Vector3f 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.

Calls MR_Mesh_attachEdgeLoopPart().

◆ averageEdgeLength()

float meshlib.Mesh.averageEdgeLength ( )

computes average length of an edge in this mesh Generated from method MR::Mesh::averageEdgeLength.

Calls MR_Mesh_averageEdgeLength().

◆ calcFastWindingNumber()

float meshlib.Mesh.calcFastWindingNumber ( meshlib.Vector3f pt,
java.lang.Float beta )

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.
    Calls MR_Mesh_calcFastWindingNumber().

◆ circumcircleDiameter()

float meshlib.Mesh.circumcircleDiameter ( meshlib.FaceId f)

returns circumcircle diameter of given mesh triangle Generated from method MR::Mesh::circumcircleDiameter.

Calls MR_Mesh_circumcircleDiameter().

◆ circumcircleDiameterSq()

float meshlib.Mesh.circumcircleDiameterSq ( meshlib.FaceId f)

returns squared circumcircle diameter of given mesh triangle Generated from method MR::Mesh::circumcircleDiameterSq.

Calls MR_Mesh_circumcircleDiameterSq().

◆ cloneRegion()

meshlib.Mesh meshlib.Mesh.cloneRegion ( meshlib.FaceBitSet region,
java.lang.Boolean flipOrientation,
meshlib.PartMapping map )

creates new mesh from given triangles of this mesh Generated from method MR::Mesh::cloneRegion.

Calls MR_Mesh_cloneRegion().

◆ computeBoundingBox() [1/2]

meshlib.Box3f meshlib.Mesh.computeBoundingBox ( meshlib.AffineXf3f toWorld)

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.

Calls MR_Mesh_computeBoundingBox().

◆ computeBoundingBox() [2/2]

meshlib.Box3f meshlib.Mesh.computeBoundingBox ( meshlib.FaceBitSet region,
meshlib.AffineXf3f toWorld )

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.

Calls MR_Mesh_computeBoundingBox_region().

◆ cotan()

float meshlib.Mesh.cotan ( meshlib.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.

Calls MR_Mesh_cotan().

◆ dblArea() [1/2]

float meshlib.Mesh.dblArea ( meshlib.FaceId f)

returns twice the area of given face Generated from method MR::Mesh::dblArea.

Calls MR_Mesh_dblArea_MR_FaceId().

◆ dblArea() [2/2]

float meshlib.Mesh.dblArea ( meshlib.VertId v)

computes the length of summed directed double areas of all triangles around given vertex Generated from method MR::Mesh::dblArea.

Calls MR_Mesh_dblArea_MR_VertId().

◆ deleteFaces()

void meshlib.Mesh.deleteFaces ( meshlib.FaceBitSet fs,
meshlib.UndirectedEdgeBitSet keepEdges )

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

Parameters
keepEdges;the edges that had no left and no right face before the call are not touched, see MeshTopology.deleteFaces Generated from method MR::Mesh::deleteFaces.

Calls MR_Mesh_deleteFaces().

◆ deleteFacesFindVacant()

meshlib.VacantElements meshlib.Mesh.deleteFacesFindVacant ( meshlib.FaceBitSet fs,
meshlib.UndirectedEdgeBitSet keepEdges )

same as deleteFaces, but also makes lone all edges without faces in this mesh, and returns bit sets of all vacant elements in this mesh after deletion, see MeshTopology.deleteFacesFindVacant Generated from method MR::Mesh::deleteFacesFindVacant.

Calls MR_Mesh_deleteFacesFindVacant().

◆ destPnt()

meshlib.Vector3f meshlib.Mesh.destPnt ( meshlib.EdgeId e)

returns coordinates of the edge destination Generated from method MR::Mesh::destPnt.

Calls MR_Mesh_destPnt().

◆ dihedralAngle()

float meshlib.Mesh.dihedralAngle ( meshlib.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.

Calls MR_Mesh_dihedralAngle().

◆ dihedralAngleCos()

float meshlib.Mesh.dihedralAngleCos ( meshlib.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.

Calls MR_Mesh_dihedralAngleCos().

◆ dihedralAngleSin()

float meshlib.Mesh.dihedralAngleSin ( meshlib.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.

Calls MR_Mesh_dihedralAngleSin().

◆ dirArea()

meshlib.Vector3d meshlib.Mesh.dirArea ( meshlib.FaceBitSet fs)

computes the sum of directed areas for faces from given region (or whole mesh) Generated from method MR::Mesh::dirArea.

Calls MR_Mesh_dirArea().

◆ dirDblArea() [1/2]

meshlib.Vector3f meshlib.Mesh.dirDblArea ( meshlib.FaceId f)

computes directed double area for a triangular face from its vertices Generated from method MR::Mesh::dirDblArea.

Calls MR_Mesh_dirDblArea_MR_FaceId().

◆ dirDblArea() [2/2]

meshlib.Vector3f meshlib.Mesh.dirDblArea ( meshlib.VertId v)

computes sum of directed double areas of all triangles around given vertex Generated from method MR::Mesh::dirDblArea.

Calls MR_Mesh_dirDblArea_MR_VertId().

◆ discreteGaussianCurvature()

float meshlib.Mesh.discreteGaussianCurvature ( meshlib.VertId v,
meshlib.bool_output outBoundaryVert )

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.

Calls MR_Mesh_discreteGaussianCurvature().

◆ discreteGaussianCurvatures()

meshlib.VertScalars meshlib.Mesh.discreteGaussianCurvatures ( meshlib.VertBitSet region)

computes discrete Gaussian curvature (see discreteGaussianCurvature( v )) in the vertices of given region (or in all valid vertices if region is null), and puts 0 in all other vertices Generated from method MR::Mesh::discreteGaussianCurvatures.

Calls MR_Mesh_discreteGaussianCurvatures().

◆ discreteMeanCurvature() [1/2]

float meshlib.Mesh.discreteMeanCurvature ( meshlib.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.

Calls MR_Mesh_discreteMeanCurvature_MR_UndirectedEdgeId().

◆ discreteMeanCurvature() [2/2]

float meshlib.Mesh.discreteMeanCurvature ( meshlib.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.

Calls MR_Mesh_discreteMeanCurvature_MR_VertId().

◆ discreteMeanCurvatures()

meshlib.VertScalars meshlib.Mesh.discreteMeanCurvatures ( meshlib.VertBitSet region)

computes discrete mean curvature (see discreteMeanCurvature( v )) in the vertices of given region (or in all valid vertices if region is null), and puts 0 in all other vertices Generated from method MR::Mesh::discreteMeanCurvatures.

Calls MR_Mesh_discreteMeanCurvatures().

◆ edgeCenter()

meshlib.Vector3f meshlib.Mesh.edgeCenter ( meshlib.UndirectedEdgeId e)

computes the center of given edge Generated from method MR::Mesh::edgeCenter.

Calls MR_Mesh_edgeCenter().

◆ edgeLength()

float meshlib.Mesh.edgeLength ( meshlib.UndirectedEdgeId e)

returns Euclidean length of the edge Generated from method MR::Mesh::edgeLength.

Calls MR_Mesh_edgeLength().

◆ edgeLengths()

meshlib.UndirectedEdgeScalars meshlib.Mesh.edgeLengths ( )

computes and returns the lengths of all edges in the mesh Generated from method MR::Mesh::edgeLengths.

Calls MR_Mesh_edgeLengths().

◆ edgeLengthSq()

float meshlib.Mesh.edgeLengthSq ( meshlib.UndirectedEdgeId e)

returns squared Euclidean length of the edge (faster to compute than length) Generated from method MR::Mesh::edgeLengthSq.

Calls MR_Mesh_edgeLengthSq().

◆ edgePoint() [1/2]

meshlib.Vector3f meshlib.Mesh.edgePoint ( meshlib.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.

Calls MR_Mesh_edgePoint_2().

◆ edgePoint() [2/2]

meshlib.Vector3f meshlib.Mesh.edgePoint ( meshlib.EdgePoint ep)

computes coordinates of point given as edge and relative position on it Generated from method MR::Mesh::edgePoint.

Calls MR_Mesh_edgePoint_1().

◆ edgeSegment()

meshlib.LineSegm3f meshlib.Mesh.edgeSegment ( meshlib.EdgeId e)

returns line segment of given edge Generated from method MR::Mesh::edgeSegment.

Calls MR_Mesh_edgeSegment().

◆ edgeVector()

meshlib.Vector3f meshlib.Mesh.edgeVector ( meshlib.EdgeId e)

returns vector equal to edge destination point minus edge origin point Generated from method MR::Mesh::edgeVector.

Calls MR_Mesh_edgeVector().

◆ findCenterFromBBox()

meshlib.Vector3f meshlib.Mesh.findCenterFromBBox ( )

computes bounding box and returns its center Generated from method MR::Mesh::findCenterFromBBox.

Calls MR_Mesh_findCenterFromBBox().

◆ findCenterFromFaces()

meshlib.Vector3f meshlib.Mesh.findCenterFromFaces ( )

computes center of mass considering that density of all triangles is the same Generated from method MR::Mesh::findCenterFromFaces.

Calls MR_Mesh_findCenterFromFaces().

◆ findCenterFromPoints()

meshlib.Vector3f meshlib.Mesh.findCenterFromPoints ( )

computes average position of all valid mesh vertices Generated from method MR::Mesh::findCenterFromPoints.

Calls MR_Mesh_findCenterFromPoints().

◆ findClosestPoint() [1/2]

meshlib.MeshProjectionResult meshlib.Mesh.findClosestPoint ( meshlib.Vector3f point,
java.lang.Float maxDistSq,
meshlib.FaceBitSet region,
meshlib.AffineXf3f xf )

Generated from method MR::Mesh::findClosestPoint.

Calls MR_Mesh_findClosestPoint_4().

◆ findClosestPoint() [2/2]

boolean meshlib.Mesh.findClosestPoint ( meshlib.Vector3f point,
meshlib.MeshProjectionResult res,
java.lang.Float maxDistSq,
meshlib.FaceBitSet region,
meshlib.AffineXf3f xf )

Generated from method MR::Mesh::findClosestPoint.

Calls MR_Mesh_findClosestPoint_5().

◆ findCreaseEdges()

meshlib.UndirectedEdgeBitSet meshlib.Mesh.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.

Calls MR_Mesh_findCreaseEdges().

◆ findSharpEdges()

meshlib.UndirectedEdgeBitSet meshlib.Mesh.findSharpEdges ( float minSharpCos,
float maxSharpCos )

finds all mesh edges with the cosine of dihedral angle (see dihedralAngleCos) in [minSharpCos, maxSharpCos] Generated from method MR::Mesh::findSharpEdges.

Calls MR_Mesh_findSharpEdges().

◆ findSpikeVertices()

meshlib.VertBitSet meshlib.Mesh.findSpikeVertices ( float minSumAngle,
meshlib.VertBitSet region,
meshlib.std_function_bool_from_float cb )

returns vertices where the sum of triangle angles is below given threshold Generated from method MR::Mesh::findSpikeVertices.

Calls MR_Mesh_findSpikeVertices(). The C++ function returns expected<MR::VertBitSet, std::string>: the value is returned and an error is thrown as UnexpectedResultException.

◆ flipOrientation()

void meshlib.Mesh.flipOrientation ( meshlib.UndirectedEdgeBitSet fullComponents)

changes the orientation of all triangles, or only of the components with given edges as MeshTopology.flipOrientation() does, and updates existing AABB tree instead of rebuilding it Generated from method MR::Mesh::flipOrientation.

Calls MR_Mesh_flipOrientation().

◆ fromFaceSoup()

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.

Calls MR_Mesh_fromFaceSoup().

◆ fromPointTriples()

meshlib.Mesh meshlib.Mesh.fromPointTriples ( meshlib.std_vector_std_array_MR_Vector3f_3 posTriples,
boolean duplicateNonManifoldVertices )
static

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.

Calls MR_Mesh_fromPointTriples().

◆ fromTriangles()

meshlib.Mesh meshlib.Mesh.fromTriangles ( meshlib.VertCoords vertexCoordinates,
meshlib.Triangulation t,
meshlib.meshbuilder.BuildSettings settings,
meshlib.std_function_bool_from_float cb )
static

construct mesh from vertex coordinates and a set of triangles with given ids Generated from method MR::Mesh::fromTriangles.

Calls MR_Mesh_fromTriangles().

◆ fromTrianglesDuplicatingNonManifoldVertices()

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; betterCont (if given) selects the best triangle among several possible continuations during the duplication Generated from method MR::Mesh::fromTrianglesDuplicatingNonManifoldVertices.

Calls MR_Mesh_fromTrianglesDuplicatingNonManifoldVertices().

◆ fromTriMesh()

meshlib.Mesh meshlib.Mesh.fromTriMesh ( meshlib.TriMesh triMesh,
meshlib.meshbuilder.BuildSettings settings,
meshlib.std_function_bool_from_float cb )
static

construct mesh from TriMesh representation Generated from method MR::Mesh::fromTriMesh.

Calls MR_Mesh_fromTriMesh().

◆ getAABBTree()

meshlib.AABBTree meshlib.Mesh.getAABBTree ( )

returns cached aabb-tree of this mesh's triangles, creating it if it did not exist in a thread-safe manner Generated from method MR::Mesh::getAABBTree.

Calls MR_Mesh_getAABBTree().

◆ getAABBTreeNotCreate()

meshlib.AABBTree meshlib.Mesh.getAABBTreeNotCreate ( )

returns cached aabb-tree of this mesh's triangles, but does not create it if it did not exist Generated from method MR::Mesh::getAABBTreeNotCreate.

Calls MR_Mesh_getAABBTreeNotCreate().

◆ getAABBTreePoints()

meshlib.AABBTreePoints meshlib.Mesh.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.

Calls MR_Mesh_getAABBTreePoints().

◆ getAABBTreePointsNotCreate()

meshlib.AABBTreePoints meshlib.Mesh.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.

Calls MR_Mesh_getAABBTreePointsNotCreate().

◆ getBoundingBox()

meshlib.Box3f meshlib.Mesh.getBoundingBox ( )

returns the bounding box containing all valid vertices (the root box of AABBTree) this bounding box is insignificantly bigger that minimal box due to AABB algorithms precision Generated from method MR::Mesh::getBoundingBox.

Calls MR_Mesh_getBoundingBox().

◆ getClosestEdge() [1/2]

meshlib.UndirectedEdgeId meshlib.Mesh.getClosestEdge ( meshlib.MeshTriPoint p)

returns one of three face edges, closest to given point Generated from method MR::Mesh::getClosestEdge.

Calls MR_Mesh_getClosestEdge_MR_MeshTriPoint().

◆ getClosestEdge() [2/2]

meshlib.UndirectedEdgeId meshlib.Mesh.getClosestEdge ( meshlib.PointOnFace p)

returns one of three face edges, closest to given point Generated from method MR::Mesh::getClosestEdge.

Calls MR_Mesh_getClosestEdge_MR_PointOnFace().

◆ getClosestVertex() [1/2]

meshlib.VertId meshlib.Mesh.getClosestVertex ( meshlib.MeshTriPoint p)

returns one of three face vertices, closest to given point Generated from method MR::Mesh::getClosestVertex.

Calls MR_Mesh_getClosestVertex_MR_MeshTriPoint().

◆ getClosestVertex() [2/2]

meshlib.VertId meshlib.Mesh.getClosestVertex ( meshlib.PointOnFace p)

returns one of three face vertices, closest to given point Generated from method MR::Mesh::getClosestVertex.

Calls MR_Mesh_getClosestVertex_MR_PointOnFace().

◆ getDipoles()

meshlib.Dipoles meshlib.Mesh.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.

Calls MR_Mesh_getDipoles().

◆ getDipolesNotCreate()

meshlib.Dipoles meshlib.Mesh.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.

Calls MR_Mesh_getDipolesNotCreate().

◆ getLeftTriPoints() [1/2]

meshlib.std_array_MR_Vector3f_3 meshlib.Mesh.getLeftTriPoints ( meshlib.EdgeId e)

returns three points of left face of e: res[0] = orgPnt( e ), res[1] = destPnt( e ) Generated from method MR::Mesh::getLeftTriPoints.

Calls MR_Mesh_getLeftTriPoints_1().

◆ getLeftTriPoints() [2/2]

void meshlib.Mesh.getLeftTriPoints ( meshlib.EdgeId e,
meshlib.Vector3f v0,
meshlib.Vector3f v1,
meshlib.Vector3f v2 )

returns three points of left face of e: v0 = orgPnt( e ), v1 = destPnt( e ) Generated from method MR::Mesh::getLeftTriPoints.

Calls MR_Mesh_getLeftTriPoints_4().

◆ getPlane3d()

meshlib.Plane3d meshlib.Mesh.getPlane3d ( meshlib.FaceId f)

Generated from method MR::Mesh::getPlane3d.

Calls MR_Mesh_getPlane3d().

◆ getPlane3f()

meshlib.Plane3f meshlib.Mesh.getPlane3f ( meshlib.FaceId f)

returns the plane containing given triangular face with normal looking outwards Generated from method MR::Mesh::getPlane3f.

Calls MR_Mesh_getPlane3f().

◆ getTriPoints() [1/2]

meshlib.std_array_MR_Vector3f_3 meshlib.Mesh.getTriPoints ( meshlib.FaceId f)

returns three points of given face Generated from method MR::Mesh::getTriPoints.

Calls MR_Mesh_getTriPoints_1().

◆ getTriPoints() [2/2]

void meshlib.Mesh.getTriPoints ( meshlib.FaceId f,
meshlib.Vector3f v0,
meshlib.Vector3f v1,
meshlib.Vector3f v2 )

returns three points of given face Generated from method MR::Mesh::getTriPoints.

Calls MR_Mesh_getTriPoints_4().

◆ heapBytes()

long meshlib.Mesh.heapBytes ( )

returns the amount of memory this object occupies on heap Generated from method MR::Mesh::heapBytes.

Calls MR_Mesh_heapBytes().

◆ holeDirArea()

meshlib.Vector3d meshlib.Mesh.holeDirArea ( meshlib.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.

Calls MR_Mesh_holeDirArea().

◆ holePerimeter()

double meshlib.Mesh.holePerimeter ( meshlib.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.

Calls MR_Mesh_holePerimeter().

◆ invalidateCaches()

void meshlib.Mesh.invalidateCaches ( java.lang.Boolean pointsChanged)

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.

Calls MR_Mesh_invalidateCaches().

◆ isOutside()

boolean meshlib.Mesh.isOutside ( meshlib.Vector3f pt,
java.lang.Float windingNumberThreshold,
java.lang.Float beta )

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.

Calls MR_Mesh_isOutside().

◆ isOutsideByProjNorm()

boolean meshlib.Mesh.isOutsideByProjNorm ( meshlib.Vector3f pt,
meshlib.MeshProjectionResult proj,
meshlib.FaceBitSet region )

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.

Calls MR_Mesh_isOutsideByProjNorm().

◆ leftCotan()

float meshlib.Mesh.leftCotan ( meshlib.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.

Calls MR_Mesh_leftCotan().

◆ leftDirDblArea()

meshlib.Vector3f meshlib.Mesh.leftDirDblArea ( meshlib.EdgeId e)

computes directed double area of left triangular face of given edge Generated from method MR::Mesh::leftDirDblArea.

Calls MR_Mesh_leftDirDblArea().

◆ leftNormal()

meshlib.Vector3f meshlib.Mesh.leftNormal ( meshlib.EdgeId e)

computes triangular face normal from its vertices Generated from method MR::Mesh::leftNormal.

Calls MR_Mesh_leftNormal().

◆ leftTangent()

meshlib.Vector3f meshlib.Mesh.leftTangent ( meshlib.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.

Calls MR_Mesh_leftTangent().

◆ mirror()

void meshlib.Mesh.mirror ( meshlib.Plane3f plane)

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

Calls MR_Mesh_mirror().

◆ normal() [1/3]

meshlib.Vector3f meshlib.Mesh.normal ( meshlib.FaceId f)

computes triangular face normal from its vertices Generated from method MR::Mesh::normal.

Calls MR_Mesh_normal_MR_FaceId().

◆ normal() [2/3]

meshlib.Vector3f meshlib.Mesh.normal ( meshlib.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.

Calls MR_Mesh_normal_MR_MeshTriPoint().

◆ normal() [3/3]

meshlib.Vector3f meshlib.Mesh.normal ( meshlib.VertId v)

computes normal in a vertex using sum of directed areas of neighboring triangles Generated from method MR::Mesh::normal.

Calls MR_Mesh_normal_MR_VertId().

◆ opEqual()

boolean meshlib.Mesh.opEqual ( meshlib.Mesh b)

compare that two meshes are exactly the same Generated from method MR::Mesh::operator==.

Calls MR_equal_MR_Mesh().

◆ opNotEqual()

boolean meshlib.Mesh.opNotEqual ( meshlib.Mesh b)

compare that two meshes are exactly the same Generated from method MR::Mesh::operator!=.

Calls MR_not_equal_MR_Mesh().

◆ orgPnt()

meshlib.Vector3f meshlib.Mesh.orgPnt ( meshlib.EdgeId e)

returns coordinates of the edge origin Generated from method MR::Mesh::orgPnt.

Calls MR_Mesh_orgPnt().

◆ pack() [1/3]

void meshlib.Mesh.pack ( meshlib.FaceMap outFmap,
meshlib.VertMap outVmap,
meshlib.WholeEdgeMap outEmap,
java.lang.Boolean rearrangeTriangles )

Generated from method MR::Mesh::pack.

Calls MR_Mesh_pack_4().

◆ pack() [2/3]

void meshlib.Mesh.pack ( meshlib.PackMapping map,
meshlib.std_function_bool_from_float cb )

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.

Calls MR_Mesh_pack_2_MR_PackMapping(). The C++ function returns expected<void, std::string>: the value is returned and an error is thrown as UnexpectedResultException.

◆ pack() [3/3]

void meshlib.Mesh.pack ( meshlib.PartMapping map,
java.lang.Boolean rearrangeTriangles )

tightly packs all arrays eliminating lone edges and invalid faces, vertices and points Generated from method MR::Mesh::pack.

Calls MR_Mesh_pack_2_MR_PartMapping().

◆ packOptimally() [1/2]

meshlib.PackMapping meshlib.Mesh.packOptimally ( boolean preserveAABBTree,
meshlib.std_function_bool_from_float cb )

Generated from method MR::Mesh::packOptimally.

Calls MR_Mesh_packOptimally_2(). The C++ function returns expected<MR::PackMapping, std::string>: the value is returned and an error is thrown as UnexpectedResultException.

◆ packOptimally() [2/2]

meshlib.PackMapping meshlib.Mesh.packOptimally ( java.lang.Boolean preserveAABBTree)

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); an already constructed tree is used for faster ordering of faces in any case Generated from method MR::Mesh::packOptimally.

Calls MR_Mesh_packOptimally_1().

◆ points()

meshlib.VertCoords meshlib.Mesh.points ( )

Returns a pointer to a member variable of class MR::Mesh named points. The reference to this object might be preserved as the return value.

Calls MR_Mesh_Get_points().

◆ projArea()

double meshlib.Mesh.projArea ( meshlib.Vector3f dir,
meshlib.FaceBitSet fs )

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.

Calls MR_Mesh_projArea().

◆ projectPoint() [1/3]

meshlib.MeshProjectionResult meshlib.Mesh.projectPoint ( meshlib.Vector3f point,
java.lang.Float maxDistSq,
meshlib.FaceBitSet region,
meshlib.AffineXf3f xf )

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.

Calls MR_Mesh_projectPoint_4().

◆ projectPoint() [2/3]

boolean meshlib.Mesh.projectPoint ( meshlib.Vector3f point,
meshlib.MeshProjectionResult res,
java.lang.Float maxDistSq,
meshlib.FaceBitSet region,
meshlib.AffineXf3f xf )

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.

Calls MR_Mesh_projectPoint_5_MR_MeshProjectionResult().

◆ projectPoint() [3/3]

boolean meshlib.Mesh.projectPoint ( meshlib.Vector3f point,
meshlib.PointOnFace res,
java.lang.Float maxDistSq,
meshlib.FaceBitSet region,
meshlib.AffineXf3f xf )

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.

Calls MR_Mesh_projectPoint_5_MR_PointOnFace().

◆ pseudonormal() [1/3]

meshlib.Vector3f meshlib.Mesh.pseudonormal ( meshlib.MeshTriPoint p,
meshlib.FaceBitSet region )

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.

Calls MR_Mesh_pseudonormal_MR_MeshTriPoint().

◆ pseudonormal() [2/3]

meshlib.Vector3f meshlib.Mesh.pseudonormal ( meshlib.UndirectedEdgeId e,
meshlib.FaceBitSet region )

computes normalized half sum of face normals sharing given edge (only (region) faces will be considered); Generated from method MR::Mesh::pseudonormal.

Calls MR_Mesh_pseudonormal_MR_UndirectedEdgeId().

◆ pseudonormal() [3/3]

meshlib.Vector3f meshlib.Mesh.pseudonormal ( meshlib.VertId v,
meshlib.FaceBitSet region )

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.

Calls MR_Mesh_pseudonormal_MR_VertId().

◆ quadraticForm()

meshlib.QuadraticForm3f meshlib.Mesh.quadraticForm ( meshlib.VertId v,
boolean angleWeigted,
meshlib.FaceBitSet region,
meshlib.UndirectedEdgeBitSet creases )

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.

Calls MR_Mesh_quadraticForm().

◆ setPoints()

void meshlib.Mesh.setPoints ( meshlib.VertCoords value)

Modifies a member variable of class MR::Mesh named points. The reference to the parameter value might be preserved in this object in element points.

Calls MR_Mesh_Set_points().

◆ setTopology()

void meshlib.Mesh.setTopology ( meshlib.MeshTopology value)

Modifies a member variable of class MR::Mesh named topology. The reference to the parameter value might be preserved in this object in element topology.

Calls MR_Mesh_Set_topology().

◆ shrinkToFit()

void meshlib.Mesh.shrinkToFit ( )

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

Calls MR_Mesh_shrinkToFit().

◆ signedDistance() [1/3]

float meshlib.Mesh.signedDistance ( meshlib.Vector3f pt)

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.

Calls MR_Mesh_signedDistance_1().

◆ signedDistance() [2/3]

meshlib.std_optional_float meshlib.Mesh.signedDistance ( meshlib.Vector3f pt,
float maxDistSq,
meshlib.FaceBitSet region )

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.

Calls MR_Mesh_signedDistance_3_float().

◆ signedDistance() [3/3]

float meshlib.Mesh.signedDistance ( meshlib.Vector3f pt,
meshlib.MeshProjectionResult proj,
meshlib.FaceBitSet region )

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.

Calls MR_Mesh_signedDistance_3_MR_MeshProjectionResult().

◆ splitEdge() [1/2]

same, but split given edge on two equal parts Generated from method MR::Mesh::splitEdge.

Calls MR_Mesh_splitEdge_3().

◆ splitEdge() [2/2]

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.

Calls MR_Mesh_splitEdge_4().

◆ splitFace() [1/2]

same, putting new vertex in the centroid of original triangle Generated from method MR::Mesh::splitFace.

Calls MR_Mesh_splitFace_3().

◆ splitFace() [2/2]

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.

Calls MR_Mesh_splitFace_4().

◆ sumAngles()

float meshlib.Mesh.sumAngles ( meshlib.VertId v,
meshlib.bool_output outBoundaryVert )

computes the sum of triangle angles at given vertex; optionally returns whether the vertex is on boundary Generated from method MR::Mesh::sumAngles.

Calls MR_Mesh_sumAngles().

◆ toEdgePoint() [1/2]

meshlib.EdgePoint meshlib.Mesh.toEdgePoint ( meshlib.EdgeId e,
meshlib.Vector3f p )

converts edge and 3d point into edge-point representation Generated from method MR::Mesh::toEdgePoint.

Calls MR_Mesh_toEdgePoint_2().

◆ toEdgePoint() [2/2]

meshlib.EdgePoint meshlib.Mesh.toEdgePoint ( meshlib.VertId v)

converts vertex into edge-point representation Generated from method MR::Mesh::toEdgePoint.

Calls MR_Mesh_toEdgePoint_1().

◆ topology()

meshlib.MeshTopology meshlib.Mesh.topology ( )

Returns a pointer to a member variable of class MR::Mesh named topology. The reference to this object might be preserved as the return value.

Calls MR_Mesh_Get_topology().

◆ toTriPoint() [1/3]

meshlib.MeshTriPoint meshlib.Mesh.toTriPoint ( meshlib.FaceId f,
meshlib.Vector3f p )

converts face id and 3d point into barycentric representation Generated from method MR::Mesh::toTriPoint.

Calls MR_Mesh_toTriPoint_2().

◆ toTriPoint() [2/3]

meshlib.MeshTriPoint meshlib.Mesh.toTriPoint ( meshlib.PointOnFace p)

converts face id and 3d point into barycentric representation Generated from method MR::Mesh::toTriPoint.

Calls MR_Mesh_toTriPoint_1_MR_PointOnFace().

◆ toTriPoint() [3/3]

meshlib.MeshTriPoint meshlib.Mesh.toTriPoint ( meshlib.VertId v)

converts vertex into barycentric representation Generated from method MR::Mesh::toTriPoint.

Calls MR_Mesh_toTriPoint_1_MR_VertId().

◆ transform()

void meshlib.Mesh.transform ( meshlib.AffineXf3f xf,
meshlib.VertBitSet region )

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

Generated from method MR::Mesh::transform.

Calls MR_Mesh_transform().

◆ triangleAspectRatio()

float meshlib.Mesh.triangleAspectRatio ( meshlib.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.

Calls MR_Mesh_triangleAspectRatio().

◆ triCenter()

meshlib.Vector3f meshlib.Mesh.triCenter ( meshlib.FaceId f)

returns the centroid of given triangle Generated from method MR::Mesh::triCenter.

Calls MR_Mesh_triCenter().

◆ triPoint()

meshlib.Vector3f meshlib.Mesh.triPoint ( meshlib.MeshTriPoint p)

computes coordinates of point given as face and barycentric representation Generated from method MR::Mesh::triPoint.

Calls MR_Mesh_triPoint().

◆ updateCaches()

void meshlib.Mesh.updateCaches ( meshlib.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

Parameters
changedVertsvertices with modified coordinates, nullptr means all valid vertices Generated from method MR::Mesh::updateCaches.

Calls MR_Mesh_updateCaches().

◆ updateCachesAfterSplits()

updates existing caches after some faces were split into parts (e.g. by splitFace() or splitEdge()) with no other changes in the mesh; it shall be considered as a faster alternative to invalidateCaches() and following rebuild of AABB tree

Parameters
new2Oldmaps every face appeared after the splits to the face it was split from (as filled by splitFace() and splitEdge()); it must contain only the splits made since the AABB tree was built or last updated: a map accumulated over several updates would add the earlier faces to the tree once more Generated from method MR::Mesh::updateCachesAfterSplits.

Calls MR_Mesh_updateCachesAfterSplits().

◆ volume()

double meshlib.Mesh.volume ( meshlib.FaceBitSet region)

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.

Calls MR_Mesh_volume().

◆ zeroUnusedPoints()

void meshlib.Mesh.zeroUnusedPoints ( )

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

Calls MR_Mesh_zeroUnusedPoints().


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