trimesh_collapse_edge

compas.datastructures.trimesh_collapse_edge(mesh, u, v, t=0.5, allow_boundary=False, fixed=None)[source]

Collapse an edge to its first or second vertex, or to an intermediate point.

Parameters
  • mesh (compas.datastructures.Mesh) – Instance of a mesh.

  • u (str) – The first vertex of the (half-) edge.

  • v (str) – The second vertex of the (half-) edge.

  • t (float, optional) – Determines where to collapse to. If t == 0.0 collapse to u. If t == 1.0 collapse to v. If 0.0 < t < 1.0, collapse to a point between u and v.

  • allow_boundary (bool, optional) – If True, allow collapses involving vertices on the boundary.

  • fixed (list, optional) – Identifiers of the vertices that should stay fixed.

Returns

None

Raises

ValueError – If u and v are not neighbors.

Notes

An edge can only be collapsed if the collapse is legal. A collapse is legal if it meets the following requirements:

  • any vertex w that is a neighbor of both u and v is a face of the mesh

  • u and v are not on the boundary

See 1 for a detailed explanation of these requirements.

References

1