Booleans

Checked in Polyform 0.9.0-beta.10 ·

On this page
  1. Combine two shapes
  2. The four operations
  3. Edit the shapes inside
  4. Holes stay holes
  5. Flatten
  6. Carve Holes

A boolean combines shapes into one: their union, the first minus the rest, where they overlap, or where they don’t. The shapes stay editable inside it, holes stay holes, and Flatten bakes the result into one vector.

Combine two shapes

Select two or more shapes. Shift-click to add each one, or drag a box round them. Four boolean buttons appear at the end of the bottom bar, followed by Carve Holes:

A blue square and a coral ring overlapping, both selected. At the right end of the bottom bar, after the drawing tools, are the boolean buttons: Union, Subtract, Intersect and Exclude, then Carve Holes. Open the full-size picture

Click one: Union, Subtract, Intersect or Exclude. The same commands are in the Object menu (Boolean Union, Boolean Subtract, Boolean Intersect, Boolean Exclude) and when you right-click the selection.

The result is a new layer, named after its operation, with your shapes inside it. It takes its fill and stroke from the bottom shape.

The square and the ring combined with Union: one blue shape. Where the ring's hole is outside the square, it is still a hole. The Layers panel shows the boolean "Union" with Ellipse 1 and Rectangle 1 inside it, and the Inspector's Shape section shows Operation: Union. Open the full-size picture

The four operations

Every boolean is one of four operations, and you can change it at any time: select the boolean and pick another in the Inspector’s Shape section, under Operation.

OperationThe result
UnionEverything any of the shapes covers
SubtractThe bottom shape, minus everything above it
IntersectOnly where all the shapes overlap
ExcludeWhere an odd number of shapes overlap: where two overlap, a hole

To subtract a shape, put it above the one you are cutting: Object → Bring Forward (Ctrl+]) and Send Backward (Ctrl+[) change the order, and so does dragging in the Layers panel.

A boolean you haven’t renamed takes the new operation’s name: a Union changed to Subtract is called “Subtract”. A name you gave it stays.

The same boolean switched to Subtract: the square minus the ring. A crescent is cut out of the square, and the ring's hole is back inside it as a blue half-disc. The Inspector shows Operation: Subtract, and the layer is now named Subtract. Open the full-size picture

Edit the shapes inside

A boolean keeps its shapes. Select one in the Layers panel, by its row under the boolean, then move it, resize it or change its points as usual, and the result updates as you go.

  • To take a boolean apart, select it and choose Object → Ungroup (Ctrl+Shift+G). The shapes come back as they were.
  • A boolean can hold another boolean.

Holes stay holes

A shape with a hole keeps its hole in a boolean. A ring, a letter’s counter, or a shape you carved stays open in a union, and in a subtract its hole comes back as filled shape. That holds for shapes that fill even-odd, for holes that wind the other way, for shapes with areas, and for a boolean inside a boolean.

Files that combined such shapes in Polyform 0.9.0-beta.8 or older drew the holes filled. From 0.9.0-beta.9 they show what the shapes show.

Flatten

Object → Flatten (Ctrl+E) bakes the boolean into one vector, with points you can edit. Its points open straight away.

  • The result can’t be changed back to a boolean, except with Ctrl+Z.
  • Curves stay curves, with their handles: a circle minus a circle gives a vector of 6 points. Holes stay holes.

Carve Holes

Carve Holes (Ctrl+Shift+H) cuts the shapes on top through the one underneath, as one editable vector. Select the shape to carve and the shapes to carve it with, then choose Object → Carve Holes, or the button after the booleans.

Unlike a boolean, the result is a plain vector from the start: you can drag the hole’s points. Unlike Flatten, it makes holes of the shapes you put inside, without a boolean first. The ring in the pictures above is a large circle carved by a small one.