British mathematician George Boole (1815–1864) didn’t specialize in geometry. He invented his Boolean algebra for dealing with the logical values of “true” and “false.” However, it was later discovered that the same concepts make perfect sense for various other mathematical objects—such as sets or arbitrary geometric shapes.
All Boolean operations are listed in the Path menu; they can also be accessed by keyboard shortcuts derived from the symbols of the corresponding mathematical operations. Some of them require exactly two objects to be selected; others will work on any number of selected shapes. All of them will accept not only paths but also text objects and shapes (except 3D boxes), automatically converting them to paths. If a Boolean operation fails (for example, due to a wrong number or type of selected operands), it will explain the reason for its failure in the status bar.
The union of two or more paths creates a path that covers with its fill every point that any of the original paths covered. As such, it joins any number of paths into a single path, giving it the style of the bottommost selected object:
If the paths do not overlap at all, the result will be exactly the same as for Path ▸ Combine (12.1.1 Subpaths). However, if the paths do overlap, this command, unlike Combine, will never create any holes; it will create new nodes where the paths intersect and remove any parts of the path that would end up inside the fill of the resulting path.
For example, if a small circle is completely inside a bigger circle, a Union of these two circles will simply remove the smaller inner circle. If you want the smaller circle to become a hole in the larger one, use either Difference or Combine. The Union command makes sense even for a single selected path, as it allows you to quickly clean up the path of any inner parts that do not affect the fill.
The difference of two paths creates a path whose fill covers all points that were covered by the bottom (in z-order) path but not the top one—in other words, it subtracts the top from the bottom. The result has the style of the bottom object:
If the paths do not overlap, Path ▸ Difference simply deletes the top path; if the top path completely overlays the bottom path, the result will be empty (objects get deleted and nothing is selected). This command is the primary tool for creating holes and erasing the parts of paths that you don’t need.
The Calligraphic pen (14.3 The Calligraphic Pen Tool) unions the new path it creates with the selected one when you draw with and subtracts from it when you draw with
.
The intersection of two or more paths creates a path whose fill covers only those points that were covered by all original paths. It uses the style of the bottommost selected object for its resulting path:
If at least two of the selected paths do not overlap (i.e., their intersection is empty), Path ▸ Intersection deletes all paths without creating anything. This command works similarly to setting a clipping path (18.4 Clipping and Masking), except that a clipping path is nondestructive and works on any object, not just on paths. On the other hand, Intersection allows you to intersect any number of paths at once.
The exclusion of two overlapping paths creates a path whose fill covers the points that were covered by only one of the original paths. It uses the style of the bottom object for its resulting path:
When the two paths do not overlap, the result of Path ▸ Exclusion is exactly the same as that of Path ▸ Combine. When they do overlap, the result looks exactly like a Combine, but the actual path is different: It has new nodes in the points where the outlines of the original paths intersect, whereas Combine creates no new nodes.
A division of two paths cuts the bottom path into separate pieces by the edges of the top path, deleting the top path:
This is the closest Inkscape has to the Knife tool in Adobe Illustrator: Use the Pen or Pencil tools (Chapter 14) to draw a cut line over the path you want to cut, -click that path, and select Path ▸ Division to cut it.
This operation is similar to Division. The main difference is that Cut Path does not create any new nodes or segments along the cut line, thus leaving the resulting paths unclosed. It also removes any fill of the path being cut. It is natural to use Division for slicing filled paths and Cut Path for cutting stroked paths without fill: