docs / Combine shapes

Combine shapes

Merge or intersect solids, or group them without paying for a boolean.

intersect() keeps only the overlap. Lower the sphere radius and the carved corner shrinks.

const block = box(40, 40, 40);
const ball = sphere(26).translate(20, 20, 20);

return block.intersect(ball).color('beam');
JavaScript is off — the listing above is the whole example.

Calls

CallWhat it does
union(...shapes) => ShapeBoolean union of two or more shapes.
Shape.union(...others) => ShapeBoolean union with one or more shapes.
Shape.intersect(...others) => ShapeBoolean intersection.
Curve3D.analytics.intersect(other: Curve3D | Surface, opts?: { tolerance?: number }) => CurveCurveIntersection[] | CurveSurfaceIntersection[]Geometric intersection of this curve with another Curve3D (returns { tA, tB, ptA, ptB, distance } records) or with a Surface from nurbsSurface() (returns { tCurve, uv, pt } records).
Scene.toCompound() => ShapeOCCT TopoDS_Compound — groups bodies without booleaning.
Scene.toUnion() => ShapeExplicit boolean fuse of all parts into one Shape.