MeshLib C# Docs
Loading...
Searching...
No Matches
Inheritance diagram for MR.Const_DecimateSettings:

Classes

struct  _Underlying

Public Member Functions

virtual void Dispose ()
unsafe Const_DecimateSettings ()
 Constructs an empty (default-constructed) instance.
unsafe Const_DecimateSettings (MR.DecimateStrategy strategy, float maxError, float maxEdgeLen, float maxBdShift, float maxTriangleAspectRatio, float criticalTriAspectRatio, float tinyEdgeLength, float stabilizer, bool angleWeightedDistToPlane, bool optimizeVertexPos, int maxDeletedVertices, int maxDeletedFaces, MR.FaceBitSet? region, MR.UndirectedEdgeBitSet? notFlippable, bool collapseNearNotFlippable, MR.UndirectedEdgeBitSet? edgesToCollapse, MR.Phmap.FlatHashMap_MRUndirectedEdgeId_MRUndirectedEdgeId? twinMap, bool touchNearBdEdges, bool touchBdVerts, MR.VertBitSet? bdVerts, float maxAngleChange, MR.Std._ByValue_Function_Bool_From_MREdgeId_ConstMRVector3fRef preCollapse, MR.Std._ByValue_Function_Void_From_MRUndirectedEdgeId_FloatRef_MRVector3fRef adjustCollapse, MR.Std._ByValue_Function_Void_From_MREdgeId_MREdgeId onEdgeDel, MR.Vector_MRQuadraticForm3f_MRVertId? vertForms, bool packMesh, MR.Std._ByValue_Function_Bool_From_Float progressCallback, int subdivideParts, bool decimateBetweenParts, MR.Std.Vector_MRFaceBitSet? partFaces, int minFacesInPart)
 Constructs MR.DecimateSettings elementwise.
unsafe Const_DecimateSettings (MR._ByValue_DecimateSettings _other)
 Generated from constructor MR.DecimateSettings.DecimateSettings.
 Const_DecimateSettings (Const_DecimateSettings _other)
 Generated from constructor MR.DecimateSettings.DecimateSettings.
 Const_DecimateSettings (DecimateSettings _other)
 Generated from constructor MR.DecimateSettings.DecimateSettings.

Protected Member Functions

virtual unsafe void Dispose (bool disposing)

Protected Attributes

unsafe MR.DecimateStrategy__ref_storage_strategy
unsafe float * __ref_storage_maxError
unsafe float * __ref_storage_maxEdgeLen
unsafe float * __ref_storage_maxBdShift
unsafe float * __ref_storage_maxTriangleAspectRatio
unsafe float * __ref_storage_criticalTriAspectRatio
unsafe float * __ref_storage_tinyEdgeLength
unsafe float * __ref_storage_stabilizer
unsafe bool * __ref_storage_angleWeightedDistToPlane
unsafe bool * __ref_storage_optimizeVertexPos
unsafe int * __ref_storage_maxDeletedVertices
unsafe int * __ref_storage_maxDeletedFaces
unsafe MR.FaceBitSet._Underlying ** __ptr_storage_region
unsafe MR.UndirectedEdgeBitSet._Underlying ** __ptr_storage_notFlippable
unsafe bool * __ref_storage_collapseNearNotFlippable
unsafe MR.UndirectedEdgeBitSet._Underlying ** __ptr_storage_edgesToCollapse
unsafe MR.Phmap.FlatHashMap_MRUndirectedEdgeId_MRUndirectedEdgeId._Underlying ** __ptr_storage_twinMap
unsafe bool * __ref_storage_touchNearBdEdges
unsafe bool * __ref_storage_touchBdVerts
unsafe MR.VertBitSet._Underlying ** __ptr_storage_bdVerts
unsafe float * __ref_storage_maxAngleChange
unsafe MR.Vector_MRQuadraticForm3f_MRVertId._Underlying ** __ptr_storage_vertForms
unsafe bool * __ref_storage_packMesh
unsafe int * __ref_storage_subdivideParts
unsafe bool * __ref_storage_decimateBetweenParts
unsafe MR.Std.Vector_MRFaceBitSet._Underlying ** __ptr_storage_partFaces
unsafe int * __ref_storage_minFacesInPart

Properties

unsafe MR.DecimateStrategy strategy [get]
unsafe float maxError [get]
 for DecimateStrategy.MinimizeError: stop the decimation as soon as the estimated distance deviation from the original mesh is more than this value for DecimateStrategy.ShortestEdgeFirst only: stop the decimation as soon as the shortest edge in the mesh is greater than this value
unsafe float maxEdgeLen [get]
 Maximal possible edge length created during decimation.
unsafe float maxBdShift [get]
 Maximal shift of a boundary during one edge collapse.
unsafe float maxTriangleAspectRatio [get]
 Maximal possible aspect ratio of a triangle introduced during decimation.
unsafe float criticalTriAspectRatio [get]
 the algorithm will ignore dihedral angle check if one of triangles had aspect ratio equal or more than this value; and the algorithm will permit temporary increase in aspect ratio after collapse, if before collapse one of the triangles had larger aspect ratio
unsafe float tinyEdgeLength [get]
 edges not longer than this value will be collapsed even if it results in appearance of a triangle with high aspect ratio
unsafe float stabilizer [get]
 Small stabilizer is important to achieve good results on completely planar mesh parts, if your mesh is not-planer everywhere, then you can set it to zero.
unsafe bool angleWeightedDistToPlane [get]
 if false, then quadratic error metric is equal to the sum of distances to the planes of original mesh triangles; if true, then the sum is weighted, and the weight is equal to the angle of adjacent triangle at the vertex divided on PI (to get one after summing all 3 vertices of the triangle)
unsafe bool optimizeVertexPos [get]
 if true then after each edge collapse the position of remaining vertex is optimized to minimize local shape change, if false then the edge is collapsed in one of its vertices, which keeps its position
unsafe int maxDeletedVertices [get]
 Limit on the number of deleted vertices.
unsafe int maxDeletedFaces [get]
 Limit on the number of deleted faces.
unsafe MR.? FaceBitSet region [get]
 Region on mesh to be decimated, it is updated during the operation.
unsafe MR.? UndirectedEdgeBitSet notFlippable [get]
 Edges specified by this bit-set will never be flipped, but they can be collapsed or replaced during collapse of nearby edges so it is updated during the operation.
unsafe bool collapseNearNotFlippable [get]
 Whether to allow collapse of edges incident to notFlippable edges, which can move vertices of notFlippable edges unless they are fixed.
unsafe MR.? UndirectedEdgeBitSet edgesToCollapse [get]
 If pointer is not null, then only edges from here can be collapsed (and some nearby edges can disappear); the algorithm updates this map during collapses, removing or replacing elements.
unsafe MR.Phmap.? FlatHashMap_MRUndirectedEdgeId_MRUndirectedEdgeId twinMap [get]
 if an edge present as a key in this map is flipped or collapsed, then same happens to the value-edge (with same collapse position); the algorithm updates this map during collapses, removing or replacing elements
unsafe bool touchNearBdEdges [get]
 Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.
unsafe bool touchBdVerts [get]
 touchBdVerts=true: allow moving and eliminating boundary vertices during edge collapses; touchBdVerts=false: allow only collapsing an edge having only one boundary vertex in that vertex, so position and count of boundary vertices do not change; this setting is ignored if touchNearBdEdges=false
unsafe MR.? VertBitSet bdVerts [get]
 if touchNearBdEdges=false or touchBdVerts=false then the algorithm needs to know about all boundary vertices; if the pointer is not null then boundary vertices detection is replaced with testing values in this bit-set; the algorithm updates this set if it packs the mesh
unsafe float maxAngleChange [get]
 Permit edge flips (in addition to collapsing) to improve Delone quality of the mesh if it does not change dihedral angle more than on this value (negative value prohibits any edge flips)
unsafe MR.Std.Const_Function_Bool_From_MREdgeId_ConstMRVector3fRef preCollapse [get, protected set]
 The user can provide this optional callback that is invoked immediately before edge collapse;.
unsafe MR.Std.Const_Function_Void_From_MRUndirectedEdgeId_FloatRef_MRVector3fRef adjustCollapse [get, protected set]
 The user can provide this optional callback for adjusting error introduced by this edge collapse and the collapse position.
unsafe MR.Std.Const_Function_Void_From_MREdgeId_MREdgeId onEdgeDel [get, protected set]
 this function is called each time edge (del) is deleted; if valid (rem) is given then dest(del) = dest(rem) and their origins are in different ends of collapsing edge, (rem) shall take the place of (del)
unsafe MR.? Vector_MRQuadraticForm3f_MRVertId vertForms [get]
 If not null, then vertex quadratic forms are stored there; if on input the vector is not empty then initialization is skipped in favor of values from there; on output: quadratic form for each remaining vertex is returned there.
unsafe bool packMesh [get]
 whether to pack mesh at the end
unsafe MR.Std.Const_Function_Bool_From_Float progressCallback [get, protected set]
 callback to report algorithm progress and cancel it by user request
unsafe int subdivideParts [get]
 If this value is more than 1, then virtually subdivides the mesh on given number of parts to process them in parallel (using many threads); IMPORTANT: please call mesh.packOptimally() before calling decimating with subdivideParts > 1, otherwise performance will be bad.
unsafe bool decimateBetweenParts [get]
 After parallel decimation of all mesh parts is done, whether to perform final decimation of whole mesh region to eliminate small edges near the border of individual parts.
unsafe MR.Std.? Vector_MRFaceBitSet partFaces [get]
 if not null, then it contains the faces of each subdivision part on input, which must not overlap, and after decimation of all parts, the region inside each part is put here; decimateBetweenParts=true or packMesh=true are not compatible with this option
unsafe int minFacesInPart [get]
 minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode

Constructor & Destructor Documentation

◆ Const_DecimateSettings() [1/5]

unsafe MR.Const_DecimateSettings.Const_DecimateSettings ( )
inline

Constructs an empty (default-constructed) instance.

◆ Const_DecimateSettings() [2/5]

unsafe MR.Const_DecimateSettings.Const_DecimateSettings ( MR.DecimateStrategy strategy,
float maxError,
float maxEdgeLen,
float maxBdShift,
float maxTriangleAspectRatio,
float criticalTriAspectRatio,
float tinyEdgeLength,
float stabilizer,
bool angleWeightedDistToPlane,
bool optimizeVertexPos,
int maxDeletedVertices,
int maxDeletedFaces,
MR.FaceBitSet? region,
MR.UndirectedEdgeBitSet? notFlippable,
bool collapseNearNotFlippable,
MR.UndirectedEdgeBitSet? edgesToCollapse,
MR.Phmap.FlatHashMap_MRUndirectedEdgeId_MRUndirectedEdgeId? twinMap,
bool touchNearBdEdges,
bool touchBdVerts,
MR.VertBitSet? bdVerts,
float maxAngleChange,
MR.Std._ByValue_Function_Bool_From_MREdgeId_ConstMRVector3fRef preCollapse,
MR.Std._ByValue_Function_Void_From_MRUndirectedEdgeId_FloatRef_MRVector3fRef adjustCollapse,
MR.Std._ByValue_Function_Void_From_MREdgeId_MREdgeId onEdgeDel,
MR.Vector_MRQuadraticForm3f_MRVertId? vertForms,
bool packMesh,
MR.Std._ByValue_Function_Bool_From_Float progressCallback,
int subdivideParts,
bool decimateBetweenParts,
MR.Std.Vector_MRFaceBitSet? partFaces,
int minFacesInPart )
inline

Constructs MR.DecimateSettings elementwise.

◆ Const_DecimateSettings() [3/5]

unsafe MR.Const_DecimateSettings.Const_DecimateSettings ( MR._ByValue_DecimateSettings _other)
inline

Generated from constructor MR.DecimateSettings.DecimateSettings.

◆ Const_DecimateSettings() [4/5]

MR.Const_DecimateSettings.Const_DecimateSettings ( Const_DecimateSettings _other)
inline

Generated from constructor MR.DecimateSettings.DecimateSettings.

◆ Const_DecimateSettings() [5/5]

MR.Const_DecimateSettings.Const_DecimateSettings ( DecimateSettings _other)
inline

Generated from constructor MR.DecimateSettings.DecimateSettings.

Member Function Documentation

◆ Dispose() [1/2]

virtual void MR.Const_DecimateSettings.Dispose ( )
inlinevirtual

◆ Dispose() [2/2]

virtual unsafe void MR.Const_DecimateSettings.Dispose ( bool disposing)
inlineprotectedvirtual

Member Data Documentation

◆ __ptr_storage_bdVerts

unsafe MR.VertBitSet._Underlying** MR.Const_DecimateSettings.__ptr_storage_bdVerts
protected

◆ __ptr_storage_edgesToCollapse

unsafe MR.UndirectedEdgeBitSet._Underlying** MR.Const_DecimateSettings.__ptr_storage_edgesToCollapse
protected

◆ __ptr_storage_notFlippable

unsafe MR.UndirectedEdgeBitSet._Underlying** MR.Const_DecimateSettings.__ptr_storage_notFlippable
protected

◆ __ptr_storage_partFaces

unsafe MR.Std.Vector_MRFaceBitSet._Underlying** MR.Const_DecimateSettings.__ptr_storage_partFaces
protected

◆ __ptr_storage_region

unsafe MR.FaceBitSet._Underlying** MR.Const_DecimateSettings.__ptr_storage_region
protected

◆ __ptr_storage_twinMap

unsafe MR.Phmap.FlatHashMap_MRUndirectedEdgeId_MRUndirectedEdgeId._Underlying** MR.Const_DecimateSettings.__ptr_storage_twinMap
protected

◆ __ptr_storage_vertForms

unsafe MR.Vector_MRQuadraticForm3f_MRVertId._Underlying** MR.Const_DecimateSettings.__ptr_storage_vertForms
protected

◆ __ref_storage_angleWeightedDistToPlane

unsafe bool* MR.Const_DecimateSettings.__ref_storage_angleWeightedDistToPlane
protected

◆ __ref_storage_collapseNearNotFlippable

unsafe bool* MR.Const_DecimateSettings.__ref_storage_collapseNearNotFlippable
protected

◆ __ref_storage_criticalTriAspectRatio

unsafe float* MR.Const_DecimateSettings.__ref_storage_criticalTriAspectRatio
protected

◆ __ref_storage_decimateBetweenParts

unsafe bool* MR.Const_DecimateSettings.__ref_storage_decimateBetweenParts
protected

◆ __ref_storage_maxAngleChange

unsafe float* MR.Const_DecimateSettings.__ref_storage_maxAngleChange
protected

◆ __ref_storage_maxBdShift

unsafe float* MR.Const_DecimateSettings.__ref_storage_maxBdShift
protected

◆ __ref_storage_maxDeletedFaces

unsafe int* MR.Const_DecimateSettings.__ref_storage_maxDeletedFaces
protected

◆ __ref_storage_maxDeletedVertices

unsafe int* MR.Const_DecimateSettings.__ref_storage_maxDeletedVertices
protected

◆ __ref_storage_maxEdgeLen

unsafe float* MR.Const_DecimateSettings.__ref_storage_maxEdgeLen
protected

◆ __ref_storage_maxError

unsafe float* MR.Const_DecimateSettings.__ref_storage_maxError
protected

◆ __ref_storage_maxTriangleAspectRatio

unsafe float* MR.Const_DecimateSettings.__ref_storage_maxTriangleAspectRatio
protected

◆ __ref_storage_minFacesInPart

unsafe int* MR.Const_DecimateSettings.__ref_storage_minFacesInPart
protected

◆ __ref_storage_optimizeVertexPos

unsafe bool* MR.Const_DecimateSettings.__ref_storage_optimizeVertexPos
protected

◆ __ref_storage_packMesh

unsafe bool* MR.Const_DecimateSettings.__ref_storage_packMesh
protected

◆ __ref_storage_stabilizer

unsafe float* MR.Const_DecimateSettings.__ref_storage_stabilizer
protected

◆ __ref_storage_strategy

unsafe MR.DecimateStrategy* MR.Const_DecimateSettings.__ref_storage_strategy
protected

◆ __ref_storage_subdivideParts

unsafe int* MR.Const_DecimateSettings.__ref_storage_subdivideParts
protected

◆ __ref_storage_tinyEdgeLength

unsafe float* MR.Const_DecimateSettings.__ref_storage_tinyEdgeLength
protected

◆ __ref_storage_touchBdVerts

unsafe bool* MR.Const_DecimateSettings.__ref_storage_touchBdVerts
protected

◆ __ref_storage_touchNearBdEdges

unsafe bool* MR.Const_DecimateSettings.__ref_storage_touchNearBdEdges
protected

Property Documentation

◆ adjustCollapse

unsafe MR.Std.Const_Function_Void_From_MRUndirectedEdgeId_FloatRef_MRVector3fRef MR.Const_DecimateSettings.adjustCollapse
getprotected set

The user can provide this optional callback for adjusting error introduced by this edge collapse and the collapse position.

On input the callback gets the squared error and position computed by standard means, and callback can modify any of them. The larger the error, the later this edge will be collapsed. This callback can be called from many threads in parallel and must be thread-safe. This callback can be called many times for each edge before real collapsing, and it is important to make the same adjustment.

◆ angleWeightedDistToPlane

unsafe bool MR.Const_DecimateSettings.angleWeightedDistToPlane
get

if false, then quadratic error metric is equal to the sum of distances to the planes of original mesh triangles; if true, then the sum is weighted, and the weight is equal to the angle of adjacent triangle at the vertex divided on PI (to get one after summing all 3 vertices of the triangle)

◆ bdVerts

unsafe MR.? VertBitSet MR.Const_DecimateSettings.bdVerts
get

if touchNearBdEdges=false or touchBdVerts=false then the algorithm needs to know about all boundary vertices; if the pointer is not null then boundary vertices detection is replaced with testing values in this bit-set; the algorithm updates this set if it packs the mesh

◆ collapseNearNotFlippable

unsafe bool MR.Const_DecimateSettings.collapseNearNotFlippable
get

Whether to allow collapse of edges incident to notFlippable edges, which can move vertices of notFlippable edges unless they are fixed.

◆ criticalTriAspectRatio

unsafe float MR.Const_DecimateSettings.criticalTriAspectRatio
get

the algorithm will ignore dihedral angle check if one of triangles had aspect ratio equal or more than this value; and the algorithm will permit temporary increase in aspect ratio after collapse, if before collapse one of the triangles had larger aspect ratio

◆ decimateBetweenParts

unsafe bool MR.Const_DecimateSettings.decimateBetweenParts
get

After parallel decimation of all mesh parts is done, whether to perform final decimation of whole mesh region to eliminate small edges near the border of individual parts.

◆ edgesToCollapse

unsafe MR.? UndirectedEdgeBitSet MR.Const_DecimateSettings.edgesToCollapse
get

If pointer is not null, then only edges from here can be collapsed (and some nearby edges can disappear); the algorithm updates this map during collapses, removing or replacing elements.

◆ maxAngleChange

unsafe float MR.Const_DecimateSettings.maxAngleChange
get

Permit edge flips (in addition to collapsing) to improve Delone quality of the mesh if it does not change dihedral angle more than on this value (negative value prohibits any edge flips)

◆ maxBdShift

unsafe float MR.Const_DecimateSettings.maxBdShift
get

Maximal shift of a boundary during one edge collapse.

◆ maxDeletedFaces

unsafe int MR.Const_DecimateSettings.maxDeletedFaces
get

Limit on the number of deleted faces.

◆ maxDeletedVertices

unsafe int MR.Const_DecimateSettings.maxDeletedVertices
get

Limit on the number of deleted vertices.

◆ maxEdgeLen

unsafe float MR.Const_DecimateSettings.maxEdgeLen
get

Maximal possible edge length created during decimation.

◆ maxError

unsafe float MR.Const_DecimateSettings.maxError
get

for DecimateStrategy.MinimizeError: stop the decimation as soon as the estimated distance deviation from the original mesh is more than this value for DecimateStrategy.ShortestEdgeFirst only: stop the decimation as soon as the shortest edge in the mesh is greater than this value

◆ maxTriangleAspectRatio

unsafe float MR.Const_DecimateSettings.maxTriangleAspectRatio
get

Maximal possible aspect ratio of a triangle introduced during decimation.

◆ minFacesInPart

unsafe int MR.Const_DecimateSettings.minFacesInPart
get

minimum number of faces in one subdivision part for ( subdivideParts > 1 ) mode

◆ notFlippable

unsafe MR.? UndirectedEdgeBitSet MR.Const_DecimateSettings.notFlippable
get

Edges specified by this bit-set will never be flipped, but they can be collapsed or replaced during collapse of nearby edges so it is updated during the operation.

◆ onEdgeDel

unsafe MR.Std.Const_Function_Void_From_MREdgeId_MREdgeId MR.Const_DecimateSettings.onEdgeDel
getprotected set

this function is called each time edge (del) is deleted; if valid (rem) is given then dest(del) = dest(rem) and their origins are in different ends of collapsing edge, (rem) shall take the place of (del)

◆ optimizeVertexPos

unsafe bool MR.Const_DecimateSettings.optimizeVertexPos
get

if true then after each edge collapse the position of remaining vertex is optimized to minimize local shape change, if false then the edge is collapsed in one of its vertices, which keeps its position

◆ packMesh

unsafe bool MR.Const_DecimateSettings.packMesh
get

whether to pack mesh at the end

◆ partFaces

unsafe MR.Std.? Vector_MRFaceBitSet MR.Const_DecimateSettings.partFaces
get

if not null, then it contains the faces of each subdivision part on input, which must not overlap, and after decimation of all parts, the region inside each part is put here; decimateBetweenParts=true or packMesh=true are not compatible with this option

◆ preCollapse

unsafe MR.Std.Const_Function_Bool_From_MREdgeId_ConstMRVector3fRef MR.Const_DecimateSettings.preCollapse
getprotected set

The user can provide this optional callback that is invoked immediately before edge collapse;.

It receives the edge being collapsed: its destination vertex will disappear, and its origin vertex will get new position (provided as the second argument) after collapse; If the callback returns false, then the collapse is prohibited

◆ progressCallback

unsafe MR.Std.Const_Function_Bool_From_Float MR.Const_DecimateSettings.progressCallback
getprotected set

callback to report algorithm progress and cancel it by user request

◆ region

unsafe MR.? FaceBitSet MR.Const_DecimateSettings.region
get

Region on mesh to be decimated, it is updated during the operation.

◆ stabilizer

unsafe float MR.Const_DecimateSettings.stabilizer
get

Small stabilizer is important to achieve good results on completely planar mesh parts, if your mesh is not-planer everywhere, then you can set it to zero.

◆ strategy

unsafe MR.DecimateStrategy MR.Const_DecimateSettings.strategy
get

◆ subdivideParts

unsafe int MR.Const_DecimateSettings.subdivideParts
get

If this value is more than 1, then virtually subdivides the mesh on given number of parts to process them in parallel (using many threads); IMPORTANT: please call mesh.packOptimally() before calling decimating with subdivideParts > 1, otherwise performance will be bad.

◆ tinyEdgeLength

unsafe float MR.Const_DecimateSettings.tinyEdgeLength
get

edges not longer than this value will be collapsed even if it results in appearance of a triangle with high aspect ratio

◆ touchBdVerts

unsafe bool MR.Const_DecimateSettings.touchBdVerts
get

touchBdVerts=true: allow moving and eliminating boundary vertices during edge collapses; touchBdVerts=false: allow only collapsing an edge having only one boundary vertex in that vertex, so position and count of boundary vertices do not change; this setting is ignored if touchNearBdEdges=false

◆ touchNearBdEdges

unsafe bool MR.Const_DecimateSettings.touchNearBdEdges
get

Whether to allow collapsing or flipping edges having at least one vertex on (region) boundary.

◆ twinMap

unsafe MR.Phmap.? FlatHashMap_MRUndirectedEdgeId_MRUndirectedEdgeId MR.Const_DecimateSettings.twinMap
get

if an edge present as a key in this map is flipped or collapsed, then same happens to the value-edge (with same collapse position); the algorithm updates this map during collapses, removing or replacing elements

◆ vertForms

unsafe MR.? Vector_MRQuadraticForm3f_MRVertId MR.Const_DecimateSettings.vertForms
get

If not null, then vertex quadratic forms are stored there; if on input the vector is not empty then initialization is skipped in favor of values from there; on output: quadratic form for each remaining vertex is returned there.


The documentation for this class was generated from the following file: