MeshLib C++ Docs
Loading...
Searching...
No Matches
MREdgeLengthMesh.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshTopology.h"
4#include <optional>
5
6namespace MR
7{
8
12struct [[nodiscard]] EdgeLengthMesh
13{
15 UndirectedEdgeScalars edgeLengths;
16
18 [[nodiscard]] MRMESH_API static EdgeLengthMesh fromMesh( const Mesh& mesh );
19
22 [[nodiscard]] MRMESH_API float leftCotan( EdgeId e ) const;
23
26 [[nodiscard]] float cotan( UndirectedEdgeId ue ) const { EdgeId e{ ue }; return leftCotan( e ) + leftCotan( e.sym() ); }
27
31 [[nodiscard]] bool isDelone( UndirectedEdgeId ue, float threshold = 0 ) const { return cotan( ue ) >= threshold; }
32
36 [[nodiscard]] MRMESH_API std::optional<float> edgeLengthAfterFlip( EdgeId e ) const;
37
42 MRMESH_API bool flipEdge( EdgeId e );
43};
44
45} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
Definition MRMesh/MRMeshTopology.h:18
Definition MREdgeLengthMesh.h:13
MRMESH_API std::optional< float > edgeLengthAfterFlip(EdgeId e) const
MRMESH_API bool flipEdge(EdgeId e)
float cotan(UndirectedEdgeId ue) const
Definition MREdgeLengthMesh.h:26
bool isDelone(UndirectedEdgeId ue, float threshold=0) const
Definition MREdgeLengthMesh.h:31
MeshTopology topology
Definition MREdgeLengthMesh.h:14
MRMESH_API float leftCotan(EdgeId e) const
static MRMESH_API EdgeLengthMesh fromMesh(const Mesh &mesh)
construct EdgeLengthMesh from an ordinary mesh
UndirectedEdgeScalars edgeLengths
Definition MREdgeLengthMesh.h:15
Definition MRMesh/MRMesh.h:22