MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshMath.h File Reference
#include "MRVector.h"
#include "MRMeshTopology.h"
#include "MRLineSegm.h"
#include "MRPointOnFace.h"

Go to the source code of this file.

Namespaces

namespace  MR
 

Functions

Vector3f MR::orgPnt (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 returns coordinates of the edge origin
 
Vector3f MR::destPnt (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 returns coordinates of the edge destination
 
Vector3f MR::edgeVector (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 returns vector equal to edge destination point minus edge origin point
 
LineSegm3f MR::edgeSegment (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 returns line segment of given edge
 
Vector3f MR::edgePoint (const MeshTopology &topology, const VertCoords &points, EdgeId e, float f)
 returns a point on the edge: origin point for f=0 and destination point for f=1
 
Vector3f MR::edgePoint (const MeshTopology &topology, const VertCoords &points, const MeshEdgePoint &ep)
 computes coordinates of point given as edge and relative position on it
 
Vector3f MR::edgeCenter (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 computes the center of given edge
 
MRMESH_API void MR::getLeftTriPoints (const MeshTopology &topology, const VertCoords &points, EdgeId e, Vector3f &v0, Vector3f &v1, Vector3f &v2)
 returns three points of left face of e: v0 = orgPnt( e ), v1 = destPnt( e )
 
void MR::getLeftTriPoints (const MeshTopology &topology, const VertCoords &points, EdgeId e, Vector3f(&v)[3])
 returns three points of left face of e: v[0] = orgPnt( e ), v[1] = destPnt( e )
 
Triangle3f MR::getLeftTriPoints (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 returns three points of left face of e: res[0] = orgPnt( e ), res[1] = destPnt( e )
 
void MR::getTriPoints (const MeshTopology &topology, const VertCoords &points, FaceId f, Vector3f &v0, Vector3f &v1, Vector3f &v2)
 returns three points of given face
 
void MR::getTriPoints (const MeshTopology &topology, const VertCoords &points, FaceId f, Vector3f(&v)[3])
 returns three points of given face
 
Triangle3f MR::getTriPoints (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns three points of given face
 
MRMESH_API Vector3f MR::triPoint (const MeshTopology &topology, const VertCoords &points, const MeshTriPoint &p)
 computes coordinates of point given as face and barycentric representation
 
MRMESH_API Vector3f MR::triCenter (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns the centroid of given triangle
 
MRMESH_API float MR::triangleAspectRatio (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns aspect ratio of given mesh triangle equal to the ratio of the circum-radius to twice its in-radius
 
MRMESH_API float MR::circumcircleDiameterSq (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns squared circumcircle diameter of given mesh triangle
 
MRMESH_API float MR::circumcircleDiameter (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns circumcircle diameter of given mesh triangle
 
MRMESH_API MeshTriPoint MR::toTriPoint (const MeshTopology &topology, const VertCoords &points, FaceId f, const Vector3f &p)
 converts face id and 3d point into barycentric representation
 
MRMESH_API MeshTriPoint MR::toTriPoint (const MeshTopology &topology, const VertCoords &points, const PointOnFace &p)
 converts face id and 3d point into barycentric representation
 
MRMESH_API MeshEdgePoint MR::toEdgePoint (const MeshTopology &topology, const VertCoords &points, EdgeId e, const Vector3f &p)
 converts edge and 3d point into edge-point representation
 
MRMESH_API VertId MR::getClosestVertex (const MeshTopology &topology, const VertCoords &points, const PointOnFace &p)
 returns one of three face vertices, closest to given point
 
VertId MR::getClosestVertex (const MeshTopology &topology, const VertCoords &points, const MeshTriPoint &p)
 returns one of three face vertices, closest to given point
 
MRMESH_API UndirectedEdgeId MR::getClosestEdge (const MeshTopology &topology, const VertCoords &points, const PointOnFace &p)
 returns one of three face edges, closest to given point
 
UndirectedEdgeId MR::getClosestEdge (const MeshTopology &topology, const VertCoords &points, const MeshTriPoint &p)
 returns one of three face edges, closest to given point
 
float MR::edgeLength (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 returns Euclidean length of the edge
 
MRMESH_API UndirectedEdgeScalars MR::edgeLengths (const MeshTopology &topology, const VertCoords &points)
 computes and returns the lengths of all edges in the mesh
 
float MR::edgeLengthSq (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 returns squared Euclidean length of the edge (faster to compute than length)
 
MRMESH_API Vector3f MR::leftDirDblArea (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 computes directed double area of left triangular face of given edge
 
Vector3f MR::dirDblArea (const MeshTopology &topology, const VertCoords &points, FaceId f)
 computes directed double area for a triangular face from its vertices
 
MRMESH_API Vector< Vector3f, VertId > MR::dirDblAreas (const MeshTopology &topology, const VertCoords &points, const VertBitSet *region=nullptr)
 computes and returns the directed double area for every (region) vertex in the mesh
 
float MR::dblArea (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns twice the area of given face
 
float MR::area (const MeshTopology &topology, const VertCoords &points, FaceId f)
 returns the area of given face
 
MRMESH_API double MR::area (const MeshTopology &topology, const VertCoords &points, const FaceBitSet &fs)
 computes the area of given face-region
 
double MR::area (const MeshTopology &topology, const VertCoords &points, const FaceBitSet *fs=nullptr)
 computes the area of given face-region (or whole mesh)
 
MRMESH_API Vector3d MR::dirArea (const MeshTopology &topology, const VertCoords &points, const FaceBitSet &fs)
 computes the sum of directed areas for faces from given region
 
Vector3d MR::dirArea (const MeshTopology &topology, const VertCoords &points, const FaceBitSet *fs=nullptr)
 computes the sum of directed areas for faces from given region (or whole mesh)
 
MRMESH_API double MR::projArea (const MeshTopology &topology, const VertCoords &points, const Vector3f &dir, const FaceBitSet &fs)
 computes the sum of absolute projected area of faces from given region as visible if look from given direction
 
double MR::projArea (const MeshTopology &topology, const VertCoords &points, const Vector3f &dir, const FaceBitSet *fs=nullptr)
 computes the sum of absolute projected area of faces from given region (or whole mesh) as visible if look from given direction
 
MRMESH_API double MR::volume (const MeshTopology &topology, const VertCoords &points, const FaceBitSet *region=nullptr)
 
MRMESH_API double MR::holePerimiter (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 computes the perimeter of the hole specified by one of its edges with no valid left face (left is hole)
 
MRMESH_API Vector3d MR::holeDirArea (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 
MRMESH_API Vector3f MR::leftTangent (const MeshTopology &topology, const VertCoords &points, 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
 
Vector3f MR::leftNormal (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 computes triangular face normal from its vertices
 
Vector3f MR::normal (const MeshTopology &topology, const VertCoords &points, FaceId f)
 computes triangular face normal from its vertices
 
MRMESH_API Vector3f MR::dirDblArea (const MeshTopology &topology, const VertCoords &points, VertId v)
 computes sum of directed double areas of all triangles around given vertex
 
float MR::dblArea (const MeshTopology &topology, const VertCoords &points, VertId v)
 computes the length of summed directed double areas of all triangles around given vertex
 
Vector3f MR::normal (const MeshTopology &topology, const VertCoords &points, VertId v)
 computes normal in a vertex using sum of directed areas of neighboring triangles
 
MRMESH_API Vector3f MR::normal (const MeshTopology &topology, const VertCoords &points, const MeshTriPoint &p)
 
MRMESH_API Vector3f MR::pseudonormal (const MeshTopology &topology, const VertCoords &points, VertId v, const FaceBitSet *region=nullptr)
 
MRMESH_API Vector3f MR::pseudonormal (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e, const FaceBitSet *region=nullptr)
 computes normalized half sum of face normals sharing given edge (only (region) faces will be considered);
 
MRMESH_API Vector3f MR::pseudonormal (const MeshTopology &topology, const VertCoords &points, const MeshTriPoint &p, const FaceBitSet *region=nullptr)
 
MRMESH_API float MR::sumAngles (const MeshTopology &topology, const VertCoords &points, VertId v, bool *outBoundaryVert=nullptr)
 computes the sum of triangle angles at given vertex; optionally returns whether the vertex is on boundary
 
MRMESH_API Expected< VertBitSet > MR::findSpikeVertices (const MeshTopology &topology, const VertCoords &points, float minSumAngle, const VertBitSet *region=nullptr, const ProgressCallback &cb={})
 returns vertices where the sum of triangle angles is below given threshold
 
MRMESH_API float MR::dihedralAngleSin (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 
MRMESH_API float MR::dihedralAngleCos (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 
MRMESH_API float MR::dihedralAngle (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 
MRMESH_API float MR::discreteMeanCurvature (const MeshTopology &topology, const VertCoords &points, VertId v)
 
MRMESH_API float MR::discreteMeanCurvature (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId e)
 
float MR::discreteGaussianCurvature (const MeshTopology &topology, const VertCoords &points, VertId v, bool *outBoundaryVert=nullptr)
 
MRMESH_API UndirectedEdgeBitSet MR::findCreaseEdges (const MeshTopology &topology, const VertCoords &points, float angleFromPlanar)
 finds all mesh edges where dihedral angle is distinct from planar PI angle on at least given value
 
MRMESH_API float MR::leftCotan (const MeshTopology &topology, const VertCoords &points, EdgeId e)
 
float MR::cotan (const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId ue)
 
MRMESH_API QuadraticForm3f MR::quadraticForm (const MeshTopology &topology, const VertCoords &points, VertId v, bool angleWeigted, const FaceBitSet *region=nullptr, const UndirectedEdgeBitSet *creases=nullptr)
 
MRMESH_API Box3f MR::computeBoundingBox (const MeshTopology &topology, const VertCoords &points, const FaceBitSet *region, const AffineXf3f *toWorld=nullptr)
 
MRMESH_API float MR::averageEdgeLength (const MeshTopology &topology, const VertCoords &points)
 computes average length of an edge in the mesh given by (topology, points)
 
MRMESH_API Vector3f MR::findCenterFromPoints (const MeshTopology &topology, const VertCoords &points)
 computes average position of all valid mesh vertices
 
MRMESH_API Vector3f MR::findCenterFromFaces (const MeshTopology &topology, const VertCoords &points)
 computes center of mass considering that density of all triangles is the same
 
MRMESH_API Vector3f MR::findCenterFromBBox (const MeshTopology &topology, const VertCoords &points)
 computes bounding box and returns its center