Welcome to CGAL PyCAD’s documentation!¶
CGAL PyCAD is a Python library for exact 3D geometric modeling using CGAL’s Nef_polyhedron_3.
It provides: - Exact Arithmetic: Zero precision loss for boolean operations. - Robust Backend: Guaranteed closed, valid manifolds. - Pythonic API: OpenSCAD-like DSL.
Installation¶
pip install cgal_pycad
Quick Start¶
from cgal_pycad import cube, sphere, translate
# Exact cube
c = cube([10, 10, 10], center=True)
# High-res sphere (tolerance 0.01)
s = sphere(6, tolerance=0.01)
# Boolean difference
result = c - translate([2, 0, 0])(s)
result.to_stl("result.stl")