mesh_thicken

compas.datastructures.mesh_thicken(mesh, thickness=1.0, both=True)[source]

Thicken a mesh.

Parameters
  • mesh (Mesh) – A mesh to thicken.

  • thickness (float, optional) – The mesh thickness. This should be a positive value.

  • both (bool, optional) – If true, the mesh is thickened on both sides of the original. Otherwise, the mesh is thickened on the side of the positive normal.

Returns

Mesh – The thickened mesh.

Raises

ValueError – If thickness is not a positive number.

Examples

>>> from compas.datastructures import Mesh, mesh_thicken
>>> from compas.geometry import distance_point_point as dist
>>> mesh = Mesh.from_vertices_and_faces([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]], [[0, 1, 2, 3]])
>>> thick = mesh_thicken(mesh)
>>> thick.is_closed()
True