MeshLib Documentation
Loading...
Searching...
No Matches
MRMeshMetrics.h File Reference
#include "MRMeshFwd.h"
#include "MRId.h"

Go to the source code of this file.

Typedefs

typedef double(* MRFillEdgeMetric) (MRVertId, MRVertId, MRVertId, MRVertId)
 is called for each edge, if it is set
 
typedef double(* MRFillCombineMetric) (double, double)
 is called to combine metrics from different candidates, if it is not set it just summarizes input
 
typedef struct MRFillHoleMetric MRFillHoleMetric
 

Functions

MRMESHC_API MRFillHoleMetricmrFillHoleMetricNew (MRFillTriangleMetric triangleMetric, MRFillEdgeMetric edgeMetric, MRFillCombineMetric combineMetric)
 
MRMESHC_API void mrFillHoleMetricFree (MRFillHoleMetric *metric)
 
MRMESHC_API double mrCalcCombinedFillMetric (const MRMesh *mesh, const MRFaceBitSet *filledRegion, const MRFillHoleMetric *metric)
 Computes combined metric after filling a hole.
 
MRMESHC_API MRFillHoleMetricmrGetCircumscribedMetric (const MRMesh *mesh)
 
MRMESHC_API MRFillHoleMetricmrGetPlaneFillMetric (const MRMesh *mesh, MREdgeId e)
 
MRMESHC_API MRFillHoleMetricmrGetPlaneNormalizedFillMetric (const MRMesh *mesh, MREdgeId e)
 
MRMESHC_API MRFillHoleMetricmrGetComplexFillMetric (const MRMesh *mesh, MREdgeId e)
 
MRMESHC_API MRFillHoleMetricmrGetUniversalMetric (const MRMesh *mesh)
 
MRMESHC_API MRFillHoleMetricmrGetMinAreaMetric (const MRMesh *mesh)
 

Variables

MR_EXTERN_C_BEGIN typedef double(* MRFillTriangleMetric )(MRVertId, MRVertId, MRVertId)
 is called for each triangle, if it is set
 

Typedef Documentation

◆ MRFillCombineMetric

typedef double(* MRFillCombineMetric) (double, double)

is called to combine metrics from different candidates, if it is not set it just summarizes input

◆ MRFillEdgeMetric

typedef double(* MRFillEdgeMetric) (MRVertId, MRVertId, MRVertId, MRVertId)

is called for each edge, if it is set

◆ MRFillHoleMetric

typedef struct MRFillHoleMetric MRFillHoleMetric

Function Documentation

◆ mrCalcCombinedFillMetric()

MRMESHC_API double mrCalcCombinedFillMetric ( const MRMesh * mesh,
const MRFaceBitSet * filledRegion,
const MRFillHoleMetric * metric )

Computes combined metric after filling a hole.

◆ mrFillHoleMetricFree()

MRMESHC_API void mrFillHoleMetricFree ( MRFillHoleMetric * metric)

◆ mrFillHoleMetricNew()

MRMESHC_API MRFillHoleMetric * mrFillHoleMetricNew ( MRFillTriangleMetric triangleMetric,
MRFillEdgeMetric edgeMetric,
MRFillCombineMetric combineMetric )

◆ mrGetCircumscribedMetric()

MRMESHC_API MRFillHoleMetric * mrGetCircumscribedMetric ( const MRMesh * mesh)

This metric minimizes the sum of circumcircle radii for all triangles in the triangulation. It is rather fast to calculate, and it results in typically good triangulations.

◆ mrGetComplexFillMetric()

MRMESHC_API MRFillHoleMetric * mrGetComplexFillMetric ( const MRMesh * mesh,
MREdgeId e )

This metric minimizes the sum of triangleMetric for all triangles in the triangulation plus the sum edgeMetric for all edges inside and on the boundary of the triangulation.
Where
triangleMetric is proportional to weighted triangle area and triangle aspect ratio
edgeMetric grows with angle between triangles as ( ( 1 - cos( x ) ) / ( 1 + cos( x ) ) ) ^ 4.

◆ mrGetMinAreaMetric()

MRMESHC_API MRFillHoleMetric * mrGetMinAreaMetric ( const MRMesh * mesh)

This metric is for triangulation construction with minimal summed area of triangles. Warning: this metric can produce degenerated triangles

◆ mrGetPlaneFillMetric()

MRMESHC_API MRFillHoleMetric * mrGetPlaneFillMetric ( const MRMesh * mesh,
MREdgeId e )

Same as mrGetCircumscribedFillMetric, but with extra penalty for the triangles having normals looking in the opposite side of plane containing left of (e).

◆ mrGetPlaneNormalizedFillMetric()

MRMESHC_API MRFillHoleMetric * mrGetPlaneNormalizedFillMetric ( const MRMesh * mesh,
MREdgeId e )

Similar to mrGetPlaneFillMetric with extra penalty for the triangles having normals looking in the opposite side of plane containing left of (e), but the metric minimizes the sum of circumcircle radius times aspect ratio for all triangles in the triangulation.

◆ mrGetUniversalMetric()

MRMESHC_API MRFillHoleMetric * mrGetUniversalMetric ( const MRMesh * mesh)

This metric minimizes the maximal dihedral angle between the faces in the triangulation and on its boundary, and it avoids creating too degenerate triangles; for planar holes it is the same as getCircumscribedMetric

Variable Documentation

◆ MRFillTriangleMetric

MR_EXTERN_C_BEGIN typedef double(* MRFillTriangleMetric) (MRVertId, MRVertId, MRVertId) ( MRVertId ,
MRVertId ,
MRVertId  )

is called for each triangle, if it is set