MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/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
24MRMESH_API extern const double BadTriangulationMetric;
25
39struct FillHoleMetric
40{
47};
48
50MRMESH_API double calcCombinedFillMetric( const Mesh & mesh, const FaceBitSet & filledRegion, const FillHoleMetric & metric );
51
55
59
64
71
74
78
81MRMESH_API FillHoleMetric getVerticalStitchMetric( const Mesh& mesh, const Vector3f& upDir );
82
89
91MRMESH_API FillHoleMetric getParallelPlaneFillMetric( const Mesh& mesh, EdgeId e, const Plane3f* plane = nullptr );
92
96
101
104
108
110
111}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
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 MRMesh/MRMeshMetrics.h:18
std::function< double(VertId a, VertId b, VertId c)> FillTriangleMetric
Definition MRMesh/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
MRMESH_API FillHoleMetric getMinAreaMetric(const Mesh &mesh)
std::function< double(double, double)> FillCombineMetric
Definition MRMesh/MRMeshMetrics.h:20
MRMESH_API FillHoleMetric getVerticalStitchMetric(const Mesh &mesh, const Vector3f &upDir)
Definition MRCameraOrientationPlugin.h:8
Holds metrics for fillHole and buildCylinderBetweenTwoHoles triangulation .
FillEdgeMetric edgeMetric
is called for each edge, if it is set
Definition MRMesh/MRMeshMetrics.h:44
FillCombineMetric combineMetric
is called to combine metrics from different candidates, if it is not set it just summarizes input
Definition MRMesh/MRMeshMetrics.h:46
FillTriangleMetric triangleMetric
is called for each triangle, if it is set
Definition MRMesh/MRMeshMetrics.h:42
Definition MRMesh/MRMesh.h:23