Removes duplicate vertices.
Namespace: DigitalRune.Geometry.MeshesAssembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.9.0.0 (1.9.3.9490)
Syntax
| C# |
|---|
public int WeldVertices(
float vertexPositionTolerance
) |
| Visual Basic |
|---|
Public Function WeldVertices ( _
vertexPositionTolerance As Single _
) As Integer |
| Visual C++ |
|---|
public:
int WeldVertices(
float vertexPositionTolerance
) |
Parameters
- vertexPositionTolerance
- Type: System..::..Single
The vertex position tolerance. If the distance between two vertices is less than this value,
the vertices are merged.
Return Value
The number of removed vertices.
Remarks
Examples
The following examples shows how to apply vertex welding when building a complex mesh.
| C# | Copy |
|---|
TriangleMesh mesh = new TriangleMesh();
mesh.AddTriangle(new Triangle(v0, v1, v2), false);
mesh.AddTriangle(new Triangle(v4, v1, v0), false);
...
mesh.WeldVertices(0.001f); |
Exceptions
See Also