Boolean Operations
A boolean takes two solids that overlap and makes one solid out of them. There are three of them, and they differ only in which part of the overlap you keep:
- Fuse keeps everything both solids cover.
- Subtract keeps the first solid minus the second.
- Common keeps only the part they share.
They all live behind one Boolean button on the toolbar, and they all work the same way: pick the solids, click Apply, and one new solid replaces the ones you picked.
Solids that touch already fuse
Most of the time you never write a boolean. Every 3D operation that adds material — extrude, revolve, sweep, loft, rib, wrap, mirror — merges its result into any solid it touches, on its own. Extrude a second cube over the first and you get one body:

The code behind it
import { sketch, line, extrude } from 'fluidcad/core';
import { coincident, distance, fix, horizontal, vertical } from 'fluidcad/constraints';
// Cube A. The four lines and the constraints that hold them square are what
// the Rectangle tool writes; `fix` pins one corner, the two `distance`s size
// the square.
sketch("xy", () => {
const bottom = line([-30, -30], [30, -30]);
const right = line([30, -30], [30, 30]);
const top = line([30, 30], [-30, 30]);
const left = line([-30, 30], [-30, -30]);
coincident(bottom.end(), right.start());
coincident(right.end(), top.start());
coincident(top.end(), left.start());
coincident(left.end(), bottom.start());
horizontal(bottom);
vertical(right);
horizontal(top);
vertical(left);
fix(bottom.start(), [-30, -30]);
distance(bottom.start(), bottom.end(), 60);
distance(right.start(), right.end(), 60);
});
extrude(60);
// Cube B. The same square, shifted 30 mm along X and Y, so the two cubes
// share a 30 x 30 x 60 corner.
sketch("xy", () => {
const bottom = line([0, 0], [60, 0]);
const right = line([60, 0], [60, 60]);
const top = line([60, 60], [0, 60]);
const left = line([0, 60], [0, 0]);
coincident(bottom.end(), right.start());
coincident(right.end(), top.start());
coincident(top.end(), left.start());
coincident(left.end(), bottom.start());
horizontal(bottom);
vertical(right);
horizontal(top);
vertical(left);
fix(bottom.start(), [0, 0]);
distance(bottom.start(), bottom.end(), 60);
distance(right.start(), right.end(), 60);
});
extrude(60);
// Nothing here mentions cube A. The new solid touches it, so the two merge
// on their own — the Shapes panel lists one solid, not two.
The result is exactly what the Fuse operation below produces from the same two cubes — auto-fusion is that same merge, done for you as the material is made.
That is the Add tab, the default on every create dialog. New keeps the result separate and Remove cuts it away instead, and a Scope setting narrows which solids take part — all three are described in Add, New and Remove.
So the booleans on this page are not how you glue new material onto a model. They are for solids that are already separate bodies and now need combining.
Two cubes to work with
The Fuse and Subtract examples all start here: one cube, then a second cube shifted 30 mm along X and Y so the two share a corner. The second one is extruded on the New tab, which keeps it a body of its own:

The code behind it
import { sketch, line, extrude } from 'fluidcad/core';
import { coincident, distance, fix, horizontal, vertical } from 'fluidcad/constraints';
// Cube A. The four lines and the constraints that hold them square are what
// the Rectangle tool writes; `fix` pins one corner, the two `distance`s size
// the square.
sketch("xy", () => {
const bottom = line([-30, -30], [30, -30]);
const right = line([30, -30], [30, 30]);
const top = line([30, 30], [-30, 30]);
const left = line([-30, 30], [-30, -30]);
coincident(bottom.end(), right.start());
coincident(right.end(), top.start());
coincident(top.end(), left.start());
coincident(left.end(), bottom.start());
horizontal(bottom);
vertical(right);
horizontal(top);
vertical(left);
fix(bottom.start(), [-30, -30]);
distance(bottom.start(), bottom.end(), 60);
distance(right.start(), right.end(), 60);
});
extrude(60);
// Cube B. The same square, shifted 30 mm along X and Y, so the two cubes
// share a 30 x 30 x 60 corner.
sketch("xy", () => {
const bottom = line([0, 0], [60, 0]);
const right = line([60, 0], [60, 60]);
const top = line([60, 60], [0, 60]);
const left = line([0, 60], [0, 0]);
coincident(bottom.end(), right.start());
coincident(right.end(), top.start());
coincident(top.end(), left.start());
coincident(left.end(), bottom.start());
horizontal(bottom);
vertical(right);
horizontal(top);
vertical(left);
fix(bottom.start(), [0, 0]);
distance(bottom.start(), bottom.end(), 60);
distance(right.start(), right.end(), 60);
});
extrude(60).new();
// New keeps the second cube its own body. Two rows in the Shapes panel, and
// the boolean tools now have two solids to work with.
The picture looks like a single stepped block, but the Shapes panel lists two solids and the edges where the cubes cross each other are still drawn. Bodies come out separate like this from .new(), from an imported STEP file, and from a part() container.
What each operation keeps
These two cubes through the Fuse and Subtract tabs, and — because the shared volume shows up better that way — two cubes standing side by side through Common:

fuse(a, b)Everything the two cubes cover between them. The edges inside the shared corner are gone — it is one body now.

subtract(a, b)Cube A minus cube B: the first cube with a notch where the second passed through it.

common(a, b)Only the part two solids share. Here that is the slab where two cubes set side by side overlap.
Fuse and Common give the same shape whichever order you pick the solids in. Subtract does not: the first solid is the one that survives.
The Boolean dialog
- Click Boolean on the toolbar. The dialog docks on the right, on the Fuse tab.
- Choose the tab you want. Switching tabs keeps the solids you have already picked.
- Pick the solids. Clicking any face or edge of a solid picks the whole solid; a row in the timeline works too. Each pick becomes a chip.
- Click Apply. The statement is written to the file, the timeline gains a row, and the solids you picked are replaced by the result.
Fuse and Common have one Solids slot that holds as many chips as you like, numbered in the order you picked them. Subtract has two slots instead, Base and Tool, one solid each. One slot is always armed — it wears a blue border, and the next pick lands there. Click a slot to arm it, or a chip's ✕ to drop that pick.
Every boolean uses up its inputs. The solids you picked leave the Shapes panel and the result takes their place, so a solid can only feed one boolean.
Which one do I want?
| What you are doing | Use this |
|---|---|
| Adding a boss, a pad or a rib to a solid | Nothing — the Add tab fuses it for you |
| Cutting a hole or a pocket you can sketch | The Remove tab (cut()) |
| Joining bodies that were kept separate | Fuse |
| Carving one body out of another | Subtract |
| Keeping only where two bodies overlap | Common |
| Several components in one file | part() |