Krabl Mesh Library
A C# library to process meshes in Unity3D
 All Classes Namespaces Functions Variables Pages
List of all members
KrablMesh.SimplifyParameters Class Reference

Description

The parameters used for a edge-collapse simplification operation.

Parameters

int KrablMesh.SimplifyParameters.edgesToCollapse = -1

The number of edges to collapse. -1: don't use this as completion condition.

int KrablMesh.SimplifyParameters.targetFaceCount = -1

The number of triangles the mesh should have after collapsing. -1: don't use this as completion condition. It's possible the result mesh will have 1 or 2 tris less that this parameters as each edge collapse affect multiple triangles.

float KrablMesh.SimplifyParameters.maximumError = -1

The maximum allowed error introduced by a collapse. This can be used to keep a constant mesh quality, a constant minimum curvature. It has a range of 0..1000. A value of x means, a change of x/1000 of the mesh size is acceptable. -1: don't use this as completion condition.

bool KrablMesh.SimplifyParameters.recalculateVertexPositions = true

Allow the algorithm to move vertices. This leads to more calculations, but also to a more accurate mesh shape.

bool KrablMesh.SimplifyParameters.preventNonManifoldEdges = false

Disallow the algorithm from producing non manifold edges. This does also affect intermediate steps and leads to independent volumes never being completely dissolved. For small target triangle counts, always set this to false.

float KrablMesh.SimplifyParameters.borderWeight = 1.0f

How much to protect border edges during simplification. 1 is a good value. Very high values (~10000) lead to border edges not being collapsed at all.

float KrablMesh.SimplifyParameters.materialSeamWeight = 1.0f

How much to protect edges with different materials/submeshes on it sides. 0: treat like normal edges, 1: protect reasonably, 10000: do not collapse any of these edges.

float KrablMesh.SimplifyParameters.uvSeamWeight = 1.0f

How much to protect edges at uv island borders/uv seams. 0: treat like normal edges, 1: protect reasonably, 10000: do not collapse any of these edges.

float KrablMesh.SimplifyParameters.uv2SeamWeight = 0.0f

How much to protect edges at uv island borders/uv seams. 0: treat like normal edges, 1: protect reasonably, 10000: do not collapse any of these edges.

float KrablMesh.SimplifyParameters.creaseWeight = 0.0f

How much to additionally protect edges that are marked as creases. Creases usually are already protected by the mesh shape as collapsing a geometrical crease produces a very high error value. 0: treat like normal edges, 1: protect reasonably, 10000: do not collapse any of these edges.

float KrablMesh.SimplifyParameters.boneWeightProtection = 0.1f

How much to additionally protect edges that have vertices with different boneweights, weighted by the calculated difference of these boneweights. Use this to end up with more vertices in flexible areas of skinned meshes. 0: treat like normal edges, 1: protect reasonably, 10000: do not collapse any of these edges.

float KrablMesh.SimplifyParameters.vertexColorProtection = 0.0f

How much to additionally protect edges that have vertices with different vertex colors, weighted by the calculated difference of these colors. 0: treat like normal edges, 1: protect reasonably, 10000: do not collapse any of these edges.

int KrablMesh.SimplifyParameters.maxEdgesPerVertex = 18

The maximum allowed number of edges/faces connected to one vertex. Decrease this to get a nicer mesh topology with less 'stars', but more triangles for the same shape. The default value of 18 is usually never reached. 0 means do not execute this check.

bool KrablMesh.SimplifyParameters.checkTopology = true

Check the result topology of collapses. This will prevent overlapping triangles and generally lead to a better result mesh topology.