collapse_halfedge

Mesh.collapse_halfedge(halfedge, point=None, del_target=True, *, check=True)[source]

Perform edge collapse.

Collapse halfedge into its origin vertex. By default, the target vertex of halfedge is marked as deleted but it can also be kept as an isolated vertex.

Parameters:
  • halfedge (Halfedge) – Halfedge to be contracted.

  • point (array_like, optional) – Coordinates of collapse location.

  • del_target (bool, optional) – Mark target vertex as deleted.

  • check (bool, optional) – Pass False to skip collapsibility test.

Raises:

ValueError – If halfedge is a boundary halfedge.

Returns:

Reference to the origin of halfedge or None in case of failure (the latter behavior requires check=True).

Return type:

Vertex

Note

It is assumed that the applicability of an edge collapse has been checked for explicitly via collapsible when skipping the test.