Skip to content

roof

Create a roof shape from a 2D polygon by lifting edges to form a peaked structure. This is an experimental feature that requires PythonSCAD to be built with both ENABLE_EXPERIMENTAL and ENABLE_CGAL.

Syntax:

roof(obj, method="voronoi", convexity=2)
obj.roof(method="voronoi", convexity=2)

Parameters:

Parameter Type Default Description
obj 2D solid — The 2D polygon to create a roof from
method string "voronoi" Roof generation method: "voronoi" or "straight"
convexity int 2 Convexity for rendering

Examples:

from pythonscad import *

polygon([[0,0], [20,0], [20,20], [0,20]]).roof().show()