Features, booleans, and transforms
Feature methods create new shapes in the same session as their inputs. They do not modify source handles.
Profile features
| Method | Core parameters | Contract |
|---|---|---|
extrude(profile, x, y, z) | non-zero vector | Sweep a face or wire linearly |
revolve(profile, degrees=360, axis=(0,0,1), origin=(0,0,0)) | angle, non-zero axis | Revolve around an axis |
loft(profiles, solid=True, ruled=False) | ordered profile sequence | Connect sections in order |
sweep(profile, path, solid=True, frenet=False) | profile and path | Carry a profile along a curve |
twisted_sweep(profile, distance, twist_degrees, ...) | axial distance and twist | Combine translation and controlled rotation |
solid=True requests a closed solid when the profiles and path permit it. ruled=True uses straight interpolation between loft sections. frenet=True changes sweep-frame behavior and may rotate the profile on curved paths.
Booleans
union(left, right), cut(body, tool), and intersect(left, right) require same-session inputs. The returned topology can differ substantially from either input; do not reuse old face or edge indices after a boolean.
with cad.Model() as model:
body = model.box(60, 40, 8)
hole = model.translate(model.cylinder(4, 12), 30, 20, -2)
drilled = model.cut(body, hole)
assert drilled.validate().ok
Touching, coincident, nearly tangent, or very small features are numerically sensitive. Keep feature scale meaningfully larger than the chosen modeling tolerance and inspect the resulting topology.
Edge and face features
fillet(shape, radius, edge_indices=None, *, edges=None) and chamfer(shape, distance, edge_indices=None, *, edges=None) accept deterministic zero-based edge indices. edges is the preferred keyword; edge_indices remains available for call compatibility. Omitting the selection applies the operation according to the native method's all-edge behavior.
shell(shape, thickness, face_indices=None, *, tolerance=1e-3, faces=None) removes or offsets selected faces to create wall thickness. Positive and negative thickness directions depend on shape orientation. Validate volume, bounding box, and open boundaries after shelling.
Stitching
sew(faces, tolerance=1e-6) joins compatible face boundaries into a shell. shell_to_solid(shell) requires a closed, consistently oriented shell. Sewing success alone does not prove that a solid can be made; inspect free_boundaries() first when diagnosing conversion failure.
Transforms
| Method | Interpretation |
|---|---|
translate(shape, x, y, z) | Copy by a world-space displacement |
rotate(shape, degrees, axis, origin) | Copy by a right-hand rotation in degrees |
mirror(shape, normal, origin) | Copy reflected in the specified plane |
scale(shape, factor, center) | Uniform copy about a point |
Axes and normals must be non-zero. A scale factor must be valid for the native operation; negative or zero factors should not be assumed to preserve solid orientation or validity.
For local coordinates, transform the point or vector through a Workplane first. Exact public functions and compatibility variants appear in the modeling catalog.