TriangleMeshWeldVertices Method (Single) |
Namespace: DigitalRune.Geometry.Meshes
Exception | Condition |
---|---|
ArgumentOutOfRangeException | vertexPositionTolerance is negative or 0. |
Vertex welding is also called vertex shifting or vertex merging. Vertices near each other are merged to a single vertex to remove duplicate, redundant vertices.
// Building a complex triangle mesh using vertex welding. TriangleMesh mesh = new TriangleMesh(); // Add triangles: mesh.AddTriangle(new Triangle(v0, v1, v2), false); mesh.AddTriangle(new Triangle(v4, v1, v0), false); ... // After all vertices are added, remove duplicates. mesh.WeldVertices(0.001f);