MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshMetrics.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRVector3.h"
5#include <functional>
6
7namespace MR
8{
11
13using FillTriangleMetric = std::function<double( VertId a, VertId b, VertId c )>;
18using FillEdgeMetric = std::function<double( VertId a, VertId b, VertId l, VertId r )>;
20using FillCombineMetric = std::function<double( double, double )>;
21
24MRMESH_API extern const double BadTriangulationMetric;
25
48
50MRMESH_API double calcCombinedFillMetric( const Mesh & mesh, const FaceBitSet & filledRegion, const FillHoleMetric & metric );
51
55
59
64
71
74
78
82MRMESH_API FillHoleMetric getVerticalStitchMetric( const Mesh& mesh, const Vector3f& upDir );
83
87MRMESH_API FillHoleMetric getVerticalStitchMetricEdgeBased( const Mesh& mesh, const Vector3f& upDir );
88
95
97MRMESH_API FillHoleMetric getParallelPlaneFillMetric( const Mesh& mesh, EdgeId e, const Plane3f* plane = nullptr );
98
102
111
114
118
120
121}
#define MRMESH_API
Definition MRMeshFwd.h:80
FillHoleMetric getEdgeLengthFillMetric(const Mesh &mesh)
Simple metric minimizing the sum of all edge lengths.
FillHoleMetric getMaxDihedralAngleMetric(const Mesh &mesh)
FillHoleMetric getMinAreaMetric(const Mesh &mesh)
FillHoleMetric getParallelPlaneFillMetric(const Mesh &mesh, EdgeId e, const Plane3f *plane=nullptr)
This metric minimizes summary projection of new edges to plane normal, (try do produce edges parallel...
FillHoleMetric getPlaneFillMetric(const Mesh &mesh, EdgeId e)
double calcCombinedFillMetric(const Mesh &mesh, const FaceBitSet &filledRegion, const FillHoleMetric &metric)
Computes combined metric after filling a hole.
FillHoleMetric getVerticalStitchMetric(const Mesh &mesh, const Vector3f &upDir)
std::function< double(VertId a, VertId b, VertId l, VertId r)> FillEdgeMetric
Definition MRMeshMetrics.h:18
FillHoleMetric getComplexFillMetric(const Mesh &mesh, EdgeId e)
std::function< double(VertId a, VertId b, VertId c)> FillTriangleMetric
args: three vertices of candidate triangle
Definition MRMeshMetrics.h:13
FillHoleMetric getComplexStitchMetric(const Mesh &mesh)
FillHoleMetric getVerticalStitchMetricEdgeBased(const Mesh &mesh, const Vector3f &upDir)
FillHoleMetric getCircumscribedMetric(const Mesh &mesh)
FillHoleMetric getPlaneNormalizedFillMetric(const Mesh &mesh, EdgeId e)
const double BadTriangulationMetric
FillHoleMetric getMinTriAngleMetric(const Mesh &mesh)
This metric maximizes the minimal angle among all faces in the triangulation.
std::function< double(double, double)> FillCombineMetric
args: two metric weights to combine (usualy it is simple sum of them)
Definition MRMeshMetrics.h:20
FillHoleMetric getEdgeLengthStitchMetric(const Mesh &mesh)
FillHoleMetric getUniversalMetric(const Mesh &mesh)
Plane3f
Definition MRMeshFwd.h:393
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Holds metrics for fillHole and stitchHoles triangulation .
Definition MRMeshMetrics.h:40
FillEdgeMetric edgeMetric
is called for each edge, if it is set
Definition MRMeshMetrics.h:44
FillCombineMetric combineMetric
is called to combine metrics from different candidates, if it is not set it just summarizes input
Definition MRMeshMetrics.h:46
FillTriangleMetric triangleMetric
is called for each triangle, if it is set
Definition MRMeshMetrics.h:42
Definition MRMesh.h:23