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{
10
11
15struct [[nodiscard]] EdgeLengthMesh
16{
18 UndirectedEdgeScalars edgeLengths;
19
21 [[nodiscard]] MRMESH_API static EdgeLengthMesh fromMesh( const Mesh& mesh );
22
25 [[nodiscard]] MRMESH_API float leftCotan( EdgeId e ) const;
26
29 [[nodiscard]] float cotan( UndirectedEdgeId ue ) const { EdgeId e{ ue }; return leftCotan( e ) + leftCotan( e.sym() ); }
30
34 [[nodiscard]] bool isDelone( UndirectedEdgeId ue, float threshold = 0 ) const { return cotan( ue ) >= threshold; }
35
39 [[nodiscard]] MRMESH_API std::optional<float> edgeLengthAfterFlip( EdgeId e ) const;
40
45 MRMESH_API bool flipEdge( EdgeId e );
46};
47
48}
Definition MRMeshTopology.h:22
MRMESH_API std::optional< float > edgeLengthAfterFlip(EdgeId e) const
MRMESH_API bool flipEdge(EdgeId e)
float cotan(UndirectedEdgeId ue) const
Definition MREdgeLengthMesh.h:29
MRMESH_API float leftCotan(const MeshTopology &topology, const VertCoords &points, EdgeId e)
bool isDelone(UndirectedEdgeId ue, float threshold=0) const
Definition MREdgeLengthMesh.h:34
MeshTopology topology
Definition MREdgeLengthMesh.h:17
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:18
float cotan(const MeshTopology &topology, const VertCoords &points, UndirectedEdgeId ue)
Definition MRMeshMath.h:315
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MREdgeLengthMesh.h:16
Definition MRMesh.h:23