MeshLib C Docs
Loading...
Searching...
No Matches
MRMeshMetrics.h File Reference
#include <MRCMesh/MRId.h>
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_FaceBitSet MR_FaceBitSet
 
typedef struct MR_Mesh MR_Mesh
 
typedef struct MR_Plane3f MR_Plane3f
 
typedef struct MR_Vector3f MR_Vector3f
 
typedef struct MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId
 
typedef struct MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId
 
typedef struct MR_std_function_double_from_double_double MR_std_function_double_from_double_double
 
typedef struct MR_FillHoleMetric MR_FillHoleMetric
 Generated from class MR::FillHoleMetric.
 

Functions

MRC_API const MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertIdMR_FillHoleMetric_Get_triangleMetric (const MR_FillHoleMetric *_this)
 
MRC_API void MR_FillHoleMetric_Set_triangleMetric (MR_FillHoleMetric *_this, MR_PassBy value_pass_by, MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId *value)
 
MRC_API MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertIdMR_FillHoleMetric_GetMutable_triangleMetric (MR_FillHoleMetric *_this)
 
MRC_API const MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertIdMR_FillHoleMetric_Get_edgeMetric (const MR_FillHoleMetric *_this)
 
MRC_API void MR_FillHoleMetric_Set_edgeMetric (MR_FillHoleMetric *_this, MR_PassBy value_pass_by, MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId *value)
 
MRC_API MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertIdMR_FillHoleMetric_GetMutable_edgeMetric (MR_FillHoleMetric *_this)
 
MRC_API const MR_std_function_double_from_double_doubleMR_FillHoleMetric_Get_combineMetric (const MR_FillHoleMetric *_this)
 
MRC_API void MR_FillHoleMetric_Set_combineMetric (MR_FillHoleMetric *_this, MR_PassBy value_pass_by, MR_std_function_double_from_double_double *value)
 
MRC_API MR_std_function_double_from_double_doubleMR_FillHoleMetric_GetMutable_combineMetric (MR_FillHoleMetric *_this)
 
MRC_API MR_FillHoleMetricMR_FillHoleMetric_DefaultConstruct (void)
 
MRC_API MR_FillHoleMetricMR_FillHoleMetric_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_FillHoleMetricMR_FillHoleMetric_ConstructFrom (MR_PassBy triangleMetric_pass_by, MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId *triangleMetric, MR_PassBy edgeMetric_pass_by, MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId *edgeMetric, MR_PassBy combineMetric_pass_by, MR_std_function_double_from_double_double *combineMetric)
 
MRC_API const MR_FillHoleMetricMR_FillHoleMetric_OffsetPtr (const MR_FillHoleMetric *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_FillHoleMetricMR_FillHoleMetric_OffsetMutablePtr (MR_FillHoleMetric *ptr, ptrdiff_t i)
 Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.
 
MRC_API MR_FillHoleMetricMR_FillHoleMetric_ConstructFromAnother (MR_PassBy _other_pass_by, MR_FillHoleMetric *_other)
 
MRC_API void MR_FillHoleMetric_Destroy (const MR_FillHoleMetric *_this)
 Destroys a heap-allocated instance of MR_FillHoleMetric. Does nothing if the pointer is null.
 
MRC_API void MR_FillHoleMetric_DestroyArray (const MR_FillHoleMetric *_this)
 Destroys a heap-allocated array of MR_FillHoleMetric. Does nothing if the pointer is null.
 
MRC_API MR_FillHoleMetricMR_FillHoleMetric_AssignFromAnother (MR_FillHoleMetric *_this, MR_PassBy _other_pass_by, MR_FillHoleMetric *_other)
 
MRC_API double MR_calcCombinedFillMetric (const MR_Mesh *mesh, const MR_FaceBitSet *filledRegion, const MR_FillHoleMetric *metric)
 
MRC_API MR_FillHoleMetricMR_getCircumscribedMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getPlaneFillMetric (const MR_Mesh *mesh, MR_EdgeId e)
 
MRC_API MR_FillHoleMetricMR_getPlaneNormalizedFillMetric (const MR_Mesh *mesh, MR_EdgeId e)
 
MRC_API MR_FillHoleMetricMR_getComplexStitchMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getEdgeLengthFillMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getEdgeLengthStitchMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getVerticalStitchMetric (const MR_Mesh *mesh, const MR_Vector3f *upDir)
 
MRC_API MR_FillHoleMetricMR_getComplexFillMetric (const MR_Mesh *mesh, MR_EdgeId e)
 
MRC_API MR_FillHoleMetricMR_getParallelPlaneFillMetric (const MR_Mesh *mesh, MR_EdgeId e, const MR_Plane3f *plane)
 
MRC_API MR_FillHoleMetricMR_getMaxDihedralAngleMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getUniversalMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getMinTriAngleMetric (const MR_Mesh *mesh)
 
MRC_API MR_FillHoleMetricMR_getMinAreaMetric (const MR_Mesh *mesh)
 

Typedef Documentation

◆ MR_FaceBitSet

typedef struct MR_FaceBitSet MR_FaceBitSet

◆ MR_FillHoleMetric

Generated from class MR::FillHoleMetric.

◆ MR_Mesh

typedef struct MR_Mesh MR_Mesh

◆ MR_Plane3f

typedef struct MR_Plane3f MR_Plane3f

◆ MR_std_function_double_from_double_double

◆ MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId

◆ MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId

◆ MR_Vector3f

typedef struct MR_Vector3f MR_Vector3f

Function Documentation

◆ MR_calcCombinedFillMetric()

MRC_API double MR_calcCombinedFillMetric ( const MR_Mesh * mesh,
const MR_FaceBitSet * filledRegion,
const MR_FillHoleMetric * metric )

Computes combined metric after filling a hole Generated from function MR::calcCombinedFillMetric. Parameter mesh can not be null. It is a single object. Parameter filledRegion can not be null. It is a single object. Parameter metric can not be null. It is a single object.

◆ MR_FillHoleMetric_AssignFromAnother()

MRC_API MR_FillHoleMetric * MR_FillHoleMetric_AssignFromAnother ( MR_FillHoleMetric * _this,
MR_PassBy _other_pass_by,
MR_FillHoleMetric * _other )

Generated from a method of class MR::FillHoleMetric named operator=. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_ConstructFrom()

MRC_API MR_FillHoleMetric * MR_FillHoleMetric_ConstructFrom ( MR_PassBy triangleMetric_pass_by,
MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId * triangleMetric,
MR_PassBy edgeMetric_pass_by,
MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId * edgeMetric,
MR_PassBy combineMetric_pass_by,
MR_std_function_double_from_double_double * combineMetric )

Constructs MR::FillHoleMetric elementwise. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_FillHoleMetric_ConstructFromAnother()

MRC_API MR_FillHoleMetric * MR_FillHoleMetric_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_FillHoleMetric * _other )

Generated from a constructor of class MR::FillHoleMetric. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_FillHoleMetric_DefaultConstruct()

MRC_API MR_FillHoleMetric * MR_FillHoleMetric_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_FillHoleMetric_DefaultConstructArray()

MRC_API MR_FillHoleMetric * MR_FillHoleMetric_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_FillHoleMetric_DestroyArray(). Use MR_FillHoleMetric_OffsetMutablePtr() and MR_FillHoleMetric_OffsetPtr() to access the array elements.

◆ MR_FillHoleMetric_Destroy()

MRC_API void MR_FillHoleMetric_Destroy ( const MR_FillHoleMetric * _this)

Destroys a heap-allocated instance of MR_FillHoleMetric. Does nothing if the pointer is null.

◆ MR_FillHoleMetric_DestroyArray()

MRC_API void MR_FillHoleMetric_DestroyArray ( const MR_FillHoleMetric * _this)

Destroys a heap-allocated array of MR_FillHoleMetric. Does nothing if the pointer is null.

◆ MR_FillHoleMetric_Get_combineMetric()

MRC_API const MR_std_function_double_from_double_double * MR_FillHoleMetric_Get_combineMetric ( const MR_FillHoleMetric * _this)

is called to combine metrics from different candidates, if it is not set it just summarizes input Returns a pointer to a member variable of class MR::FillHoleMetric named combineMetric. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_Get_edgeMetric()

MRC_API const MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId * MR_FillHoleMetric_Get_edgeMetric ( const MR_FillHoleMetric * _this)

is called for each edge, if it is set Returns a pointer to a member variable of class MR::FillHoleMetric named edgeMetric. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_Get_triangleMetric()

MRC_API const MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId * MR_FillHoleMetric_Get_triangleMetric ( const MR_FillHoleMetric * _this)

is called for each triangle, if it is set Returns a pointer to a member variable of class MR::FillHoleMetric named triangleMetric. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_GetMutable_combineMetric()

MRC_API MR_std_function_double_from_double_double * MR_FillHoleMetric_GetMutable_combineMetric ( MR_FillHoleMetric * _this)

is called to combine metrics from different candidates, if it is not set it just summarizes input Returns a mutable pointer to a member variable of class MR::FillHoleMetric named combineMetric. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_GetMutable_edgeMetric()

is called for each edge, if it is set Returns a mutable pointer to a member variable of class MR::FillHoleMetric named edgeMetric. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_GetMutable_triangleMetric()

MRC_API MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId * MR_FillHoleMetric_GetMutable_triangleMetric ( MR_FillHoleMetric * _this)

is called for each triangle, if it is set Returns a mutable pointer to a member variable of class MR::FillHoleMetric named triangleMetric. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_FillHoleMetric_OffsetMutablePtr()

MRC_API MR_FillHoleMetric * MR_FillHoleMetric_OffsetMutablePtr ( MR_FillHoleMetric * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_FillHoleMetric_OffsetPtr()

MRC_API const MR_FillHoleMetric * MR_FillHoleMetric_OffsetPtr ( const MR_FillHoleMetric * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element.

◆ MR_FillHoleMetric_Set_combineMetric()

MRC_API void MR_FillHoleMetric_Set_combineMetric ( MR_FillHoleMetric * _this,
MR_PassBy value_pass_by,
MR_std_function_double_from_double_double * value )

is called to combine metrics from different candidates, if it is not set it just summarizes input Modifies a member variable of class MR::FillHoleMetric named combineMetric. Parameter _this can not be null. It is a single object.

◆ MR_FillHoleMetric_Set_edgeMetric()

MRC_API void MR_FillHoleMetric_Set_edgeMetric ( MR_FillHoleMetric * _this,
MR_PassBy value_pass_by,
MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId_MR_VertId * value )

is called for each edge, if it is set Modifies a member variable of class MR::FillHoleMetric named edgeMetric. Parameter _this can not be null. It is a single object.

◆ MR_FillHoleMetric_Set_triangleMetric()

MRC_API void MR_FillHoleMetric_Set_triangleMetric ( MR_FillHoleMetric * _this,
MR_PassBy value_pass_by,
MR_std_function_double_from_MR_VertId_MR_VertId_MR_VertId * value )

is called for each triangle, if it is set Modifies a member variable of class MR::FillHoleMetric named triangleMetric. Parameter _this can not be null. It is a single object.

◆ MR_getCircumscribedMetric()

MRC_API MR_FillHoleMetric * MR_getCircumscribedMetric ( const MR_Mesh * 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. Generated from function MR::getCircumscribedMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getComplexFillMetric()

MRC_API MR_FillHoleMetric * MR_getComplexFillMetric ( const MR_Mesh * mesh,
MR_EdgeId 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. Generated from function MR::getComplexFillMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getComplexStitchMetric()

MRC_API MR_FillHoleMetric * MR_getComplexStitchMetric ( const MR_Mesh * mesh)

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 triangle aspect ratio
edgeMetric is proportional to ( 1 - dihedralAngleCos ) Generated from function MR::getComplexStitchMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getEdgeLengthFillMetric()

MRC_API MR_FillHoleMetric * MR_getEdgeLengthFillMetric ( const MR_Mesh * mesh)

Simple metric minimizing the sum of all edge lengths Generated from function MR::getEdgeLengthFillMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getEdgeLengthStitchMetric()

MRC_API MR_FillHoleMetric * MR_getEdgeLengthStitchMetric ( const MR_Mesh * mesh)

Forbids connecting vertices from the same hole
Simple metric minimizing edge length Generated from function MR::getEdgeLengthStitchMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getMaxDihedralAngleMetric()

MRC_API MR_FillHoleMetric * MR_getMaxDihedralAngleMetric ( const MR_Mesh * mesh)

This metric minimizes the maximal dihedral angle between the faces in the triangulation and on its boundary Generated from function MR::getMaxDihedralAngleMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getMinAreaMetric()

MRC_API MR_FillHoleMetric * MR_getMinAreaMetric ( const MR_Mesh * mesh)

This metric is for triangulation construction with minimal summed area of triangles. Warning: this metric can produce degenerated triangles Generated from function MR::getMinAreaMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getMinTriAngleMetric()

MRC_API MR_FillHoleMetric * MR_getMinTriAngleMetric ( const MR_Mesh * mesh)

This metric maximizes the minimal angle among all faces in the triangulation Generated from function MR::getMinTriAngleMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getParallelPlaneFillMetric()

MRC_API MR_FillHoleMetric * MR_getParallelPlaneFillMetric ( const MR_Mesh * mesh,
MR_EdgeId e,
const MR_Plane3f * plane )

This metric minimizes summary projection of new edges to plane normal, (try do produce edges parallel to plane) Generated from function MR::getParallelPlaneFillMetric. Parameter mesh can not be null. It is a single object. Parameter plane defaults to a null pointer in C++. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getPlaneFillMetric()

MRC_API MR_FillHoleMetric * MR_getPlaneFillMetric ( const MR_Mesh * mesh,
MR_EdgeId e )

Same as getCircumscribedFillMetric, but with extra penalty for the triangles having normals looking in the opposite side of plane containing left of (e). Generated from function MR::getPlaneFillMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getPlaneNormalizedFillMetric()

MRC_API MR_FillHoleMetric * MR_getPlaneNormalizedFillMetric ( const MR_Mesh * mesh,
MR_EdgeId e )

Similar to getPlaneFillMetric 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. Generated from function MR::getPlaneNormalizedFillMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getUniversalMetric()

MRC_API MR_FillHoleMetric * MR_getUniversalMetric ( const MR_Mesh * mesh)

This metric consists of two parts 1) for each triangle: it is the circumcircle diameter, this avoids the appearance of degenerate triangles; 2) for each edge: square root of double total area of triangles to its left and right times the factor depending extensionally on absolute dihedral angle between left and right triangles, this makes visually triangulated surface as smooth as possible. For planar holes it is the same as getCircumscribedMetric. Generated from function MR::getUniversalMetric. Parameter mesh can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.

◆ MR_getVerticalStitchMetric()

MRC_API MR_FillHoleMetric * MR_getVerticalStitchMetric ( const MR_Mesh * mesh,
const MR_Vector3f * upDir )

Forbids connecting vertices from the same hole
All new faces should be parallel to given direction Generated from function MR::getVerticalStitchMetric. Parameter mesh can not be null. It is a single object. Parameter upDir can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FillHoleMetric_Destroy() to free it when you're done using it.