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

Description

Static methods to deal with marking edges as creases.

Functions

static void KrablMesh.CreaseDetect.MarkCreasesFromMaterialSeams ( MeshEdges  mesh,
float  creaseStrength = 1.0f 
)
static

Searches the mesh for edges that are connected to faces of different materials (submeshes). These are marked as creases.

Parameters
meshThe mesh to search.
creaseStrengthThe crease value to set the edges to. Currently only 1.0f has any effect.
static void KrablMesh.CreaseDetect.MarkCreasesFromFaceNormals ( MeshEdges  mesh,
float  creaseStrength = 1.0f 
)
static

Searches through all edges of the mesh and compares the vertex normals on each face connected to an edge. If there is a difference in the vertex normals, the edge gets marked as crease. This method is automatically executed every time a Unity mesh is converted to a Krabl Mesh Library mesh.

Parameters
meshThe mesh to search.
creaseStrengthThe crease value to set the edges to. Currently only 1.0f has any effect.
static void KrablMesh.CreaseDetect.MarkCreasesFromEdgeAngles ( MeshEdges  mesh,
float  angleThreshold,
float  creaseStrength = 1.0f 
)
static

Searches through all edges of the mesh and calculates the angle between the faces connected to the edge. The the angle is above the threshold, the edge is marked as a crease.

Parameters
meshThe mesh to search.
angleThresholdAll edges with angles equal or larger than this are marked as creases.
creaseStrengthThe crease value to set the edges to. Currently only 1.0f has any effect.
static void KrablMesh.CreaseDetect.ClearAllCreases ( MeshEdges  mesh)
static

Sets the crease value of all edges in the mesh to 0.

Parameters
meshThe mesh to process.