MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::EdgeLengthMesh Struct Reference

#include <MREdgeLengthMesh.h>

Public Member Functions

MRMESH_API float leftCotan (EdgeId e) const
 
float cotan (UndirectedEdgeId ue) const
 
bool isDelone (UndirectedEdgeId ue, float threshold=0) const
 
MRMESH_API std::optional< float > edgeLengthAfterFlip (EdgeId e) const
 
MRMESH_API bool flipEdge (EdgeId e)
 

Static Public Member Functions

static MRMESH_API EdgeLengthMesh fromMesh (const Mesh &mesh)
 construct EdgeLengthMesh from an ordinary mesh
 

Public Attributes

MeshTopology topology
 
UndirectedEdgeScalars edgeLengths
 

Detailed Description

Unlike the classic mesh that stores coordinates of its vertices, this class stores the lengths of all edges. It can be used for construction of intrinsic Intrinsic Delaunay Triangulations.

Member Function Documentation

◆ cotan()

float MR::EdgeLengthMesh::cotan ( UndirectedEdgeId ue) const
inlinenodiscard

computes sum of cotangents of the angle in the left and right triangles opposite to given edge, consider cotangents zero for not existing triangles

◆ edgeLengthAfterFlip()

MRMESH_API std::optional< float > MR::EdgeLengthMesh::edgeLengthAfterFlip ( EdgeId e) const
nodiscard

given the edge with left and right triangular faces, which form together a quadrangle, returns the length of geodesic line on original mesh between the vertices of the quadrangle opposite to given edge; returns std::nullopt if the geodesic line does not go fully inside the quadrangle

◆ flipEdge()

MRMESH_API bool MR::EdgeLengthMesh::flipEdge ( EdgeId e)

given the edge with left and right triangular faces, which form together a quadrangle, rotates the edge counter-clockwise inside the quadrangle; the length of e becomes equal to the length of geodesic line between its new ends on original mesh; does not flip and returns false if the geodesic line does not go fully inside the quadrangle

◆ fromMesh()

static MRMESH_API EdgeLengthMesh MR::EdgeLengthMesh::fromMesh ( const Mesh & mesh)
staticnodiscard

construct EdgeLengthMesh from an ordinary mesh

◆ isDelone()

bool MR::EdgeLengthMesh::isDelone ( UndirectedEdgeId ue,
float threshold = 0 ) const
inlinenodiscard

returns true if given edge satisfies Delaunay conditions, returns false if the edge needs to be flipped to satisfy Delaunay conditions, passing negative threshold makes more edges satisfy Delaunay conditions

◆ leftCotan()

MRMESH_API float MR::EdgeLengthMesh::leftCotan ( EdgeId e) const
nodiscard

computes cotangent of the angle in the left( e ) triangle opposite to e, and returns 0 if left face does not exist

Member Data Documentation

◆ edgeLengths

UndirectedEdgeScalars MR::EdgeLengthMesh::edgeLengths

◆ topology

MeshTopology MR::EdgeLengthMesh::topology

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