Shape.to_polyhedron

Shape.to_polyhedron(triangulated=True, u=16, v=None)[source]

Convert the shape to a polyhedron.

Parameters:
triangulatedbool, optional

If True, triangulate the faces.

uint, optional

Number of faces in the “u” direction.

vint, optional

Number of faces in the “v” direction. If no value is provided, and the shape has two parameter directions, the value of u will be used.

Returns:
compas.geometry.Polyhedron

The polyhedron representation of the shape.

Notes

Parameters u and v define the resolution of the discretisation of curved geometry. If the geometry is not curved in a particular direction, the corresponding parameter will be ignored. For example, a cylinder has a resolution in the “u” direction, but not in the “v” direction. A sphere has a resolution in both the “u” and the “v” direction. A box has no resolution in either direction.