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
12// args: three vertices of candidate triangle
13using FillTriangleMetric = std::function<double( VertId a, VertId b, VertId c )>;
14// args:
15// a->b: candidate edge
16// l: next(a->b) note that they are not connected in topology untill triangulation process ends
17// r: prev(a->b) note that they are not connected in topology untill triangulation process ends
18using FillEdgeMetric = std::function<double( VertId a, VertId b, VertId l, VertId r )>;
19// args: two metric weights to combine (usualy it is simple sum of them)
20using FillCombineMetric = std::function<double( double, double )>;
21
25
39struct FillHoleMetric
40{
42 FillTriangleMetric triangleMetric;
44 FillEdgeMetric edgeMetric;
46 FillCombineMetric combineMetric;
47};
48
50MRMESH_API double calcCombinedFillMetric( const Mesh & mesh, const FaceBitSet & filledRegion, const FillHoleMetric & metric );
51
54MRMESH_API FillHoleMetric getCircumscribedMetric( const Mesh& mesh );
55
58MRMESH_API FillHoleMetric getPlaneFillMetric( const Mesh& mesh, EdgeId e );
59
63MRMESH_API FillHoleMetric getPlaneNormalizedFillMetric( const Mesh& mesh, EdgeId e );
64
70MRMESH_API FillHoleMetric getComplexStitchMetric( const Mesh& mesh );
71
73MRMESH_API FillHoleMetric getEdgeLengthFillMetric( const Mesh& mesh );
74
77MRMESH_API FillHoleMetric getEdgeLengthStitchMetric( const Mesh& mesh );
78
82MRMESH_API FillHoleMetric getVerticalStitchMetric( const Mesh& mesh, const Vector3f& upDir );
83
87MRMESH_API FillHoleMetric getVerticalStitchMetricEdgeBased( const Mesh& mesh, const Vector3f& upDir );
88
94MRMESH_API FillHoleMetric getComplexFillMetric( const Mesh& mesh, EdgeId e );
95
97MRMESH_API FillHoleMetric getParallelPlaneFillMetric( const Mesh& mesh, EdgeId e, const Plane3f* plane = nullptr );
98
101MRMESH_API FillHoleMetric getMaxDihedralAngleMetric( const Mesh& mesh );
102
110MRMESH_API FillHoleMetric getUniversalMetric( const Mesh& mesh );
111
113MRMESH_API FillHoleMetric getMinTriAngleMetric( const Mesh& mesh );
114
117MRMESH_API FillHoleMetric getMinAreaMetric( const Mesh& mesh );
118
120
121}
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRMesh/MRMesh.h:23
MRMESH_API FillHoleMetric getUniversalMetric(const Mesh &mesh)
MRMESH_API FillHoleMetric getCircumscribedMetric(const Mesh &mesh)
MRMESH_API FillHoleMetric getEdgeLengthStitchMetric(const Mesh &mesh)
MRMESH_API FillHoleMetric getComplexStitchMetric(const Mesh &mesh)
MRMESH_API FillHoleMetric getEdgeLengthFillMetric(const Mesh &mesh)
Simple metric minimizing the sum of all edge lengths.
MRMESH_API FillHoleMetric getMinTriAngleMetric(const Mesh &mesh)
This metric maximizes the minimal angle among all faces in the triangulation.
MRMESH_API double calcCombinedFillMetric(const Mesh &mesh, const FaceBitSet &filledRegion, const FillHoleMetric &metric)
Computes combined metric after filling a hole.
MRMESH_API FillHoleMetric getPlaneNormalizedFillMetric(const Mesh &mesh, EdgeId e)
std::function< double(VertId a, VertId b, VertId l, VertId r)> FillEdgeMetric
Definition MRMeshMetrics.h:18
std::function< double(VertId a, VertId b, VertId c)> FillTriangleMetric
Definition MRMeshMetrics.h:13
MRMESH_API 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...
MRMESH_API FillHoleMetric getComplexFillMetric(const Mesh &mesh, EdgeId e)
MRMESH_API FillHoleMetric getPlaneFillMetric(const Mesh &mesh, EdgeId e)
MRMESH_API FillHoleMetric getMaxDihedralAngleMetric(const Mesh &mesh)
MRMESH_API const double BadTriangulationMetric
Definition MRMeshMetrics.h:24
MRMESH_API FillHoleMetric getMinAreaMetric(const Mesh &mesh)
std::function< double(double, double)> FillCombineMetric
Definition MRMeshMetrics.h:20
MRMESH_API FillHoleMetric getVerticalStitchMetric(const Mesh &mesh, const Vector3f &upDir)
MRMESH_API FillHoleMetric getVerticalStitchMetricEdgeBased(const Mesh &mesh, const Vector3f &upDir)
Definition MRCameraOrientationPlugin.h:8
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