Skip to main content

Combinations

It is now time to introduce a way to combine shapes together, the main operations of constructive geometry, also known as the boolean operations.

We will play with two shapes, a box and a cylinder.

Pasting shapes together

This is what we call the fuse operation:

const main = ({ sketchCircle, sketchRectangle }) => {
const cylinder = sketchCircle(20).extrude(50);
const box = sketchRectangle(60, 90).extrude(25);

return box.fuse(cylinder);
};

the box and cylinder fused

Cutting one shape with another

This is what we call the cut operation:

const main = ({ sketchCircle, sketchRectangle }) => {
const cylinder = sketchCircle(20).extrude(50);
const box = sketchRectangle(60, 90).extrude(25);

return box.cut(cylinder);
};

the cylinder cut in the box

Intersecting two shapes

For the intersection we will intersect the cylinder with itself you create a fun shape:

const main = ({ sketchCircle }) => {
const cylinder = sketchCircle(20).extrude(40);
const sideCylinder = cylinder.clone().rotate(90, [0, 0, 20], [1, 0, 0]);

return sideCylinder.intersect(cylinder);
};

the cylinder intersecting iself