MeshDos.dual

MeshDos.dual(cls=None, include_boundary=False)[source]

Construct the dual of a mesh.

Parameters
  • mesh (Mesh) – A mesh object.

  • cls (Type[Mesh], optional) – The type of the dual mesh. Defaults to the type of the provided mesh object.

  • include_boundary (bool, optional) – Whether to include boundary faces for the dual mesh If True, create faces on boundaries including all original mesh boundary vertices.

Returns

Mesh – The dual mesh object.

Examples

>>> import compas
>>> from compas.datastructures import Mesh
>>> mesh = Mesh.from_obj(compas.get('faces.obj'))
>>> mesh.delete_face(11)
>>> mesh.delete_face(6)
>>> mesh.delete_face(7)
>>> mesh.quads_to_triangles()
>>> mesh = mesh.subdivide('corner')
>>> dual = mesh.dual(include_boundary=True)