Block.remove_duplicate_vertices

Block.remove_duplicate_vertices(precision=None)

Remove all duplicate vertices and clean up any affected faces.

Parameters:
precisionint, optional

Precision for converting numbers to strings. Default is TOL.precision.

Returns:
None

The mesh is modified in-place.

Examples

>>> import compas
>>> from compas.datastructures import Mesh
>>> mesh = Mesh.from_obj(compas.get("faces.obj"))
>>> mesh.number_of_vertices()
36
>>> for x, y, z in mesh.vertices_attributes("xyz", keys=list(mesh.vertices())[:5]):
...     mesh.add_vertex(x=x, y=y, z=z)
36
37
38
39
40
>>> mesh.number_of_vertices()
41
>>> mesh.remove_duplicate_vertices()
>>> mesh.number_of_vertices()
36