Boolean / CSG Operations
Constructive Solid Geometry (CSG) is the technique of combining simple shapes to create complex geometry using boolean operations. It is the core modeling technique in CADFaber — you build complex objects by joining shapes together, cutting holes, and extracting intersections. This page explains the three boolean operations (union, subtract, intersect), how hole objects work, and practical tips for getting clean results.
What Is Constructive Solid Geometry?
Constructive Solid Geometry (CSG) is a modeling technique where complex 3D shapes are created by combining simpler shapes using set operations. The three fundamental operations are union (joining two shapes together), subtraction (cutting one shape out of another), and intersection (keeping only the volume where two shapes overlap).
CSG is different from mesh modeling (pushing and pulling individual vertices and faces, as in Blender's edit mode) and parametric modeling (defining shapes through equations and constraints, as in Fusion 360 or SolidWorks). CSG is conceptually simpler and more intuitive for beginners — you think in terms of physical operations like "glue these two blocks together" or "drill a hole through this plate." This makes it an excellent approach for functional parts, enclosures, brackets, and mechanical components.
In CADFaber, CSG operations are performed using WebAssembly-compiled boolean engines that run entirely in your browser. When you apply a boolean operation, the input shapes are processed into a single merged mesh. The operation is recorded in the undo history, so you can always step back if the result is not what you expected.
Union (Join)
Union combines two or more shapes into a single solid. The result contains the volume of all input shapes combined. Overlapping regions become a single unified volume — there are no internal faces where the shapes intersect. Think of union as gluing shapes together and then removing any internal walls.
How to Use Union
- Select two or more shapes. Hold Ctrl (Cmd on macOS) and click each shape, or use the scene tree to multi-select.
- Click the Union button in the CSG toolbar, or press the keyboard shortcut U.
- The selected shapes are replaced by a single merged shape in the scene tree.
Example: Creating an L-Bracket
Place two cubes perpendicular to each other so they overlap at one corner, forming an L shape. Select both cubes and apply union. The result is a single L-shaped solid with clean edges at the junction. Without union, the two cubes would be separate objects that happen to overlap, which can cause problems during 3D printing because the slicer may not handle overlapping geometry correctly.
Example: Building a Snowman
Stack three spheres of decreasing size on top of each other. Select all three and apply union. The result is a single snowman-shaped solid. The internal faces where the spheres overlap are removed, leaving only the outer shell. This is important for 3D printing because internal faces can confuse slicers and cause artifacts.
Union is the most commonly used CSG operation. Whenever you have multiple shapes that should form a single printable object, union them together. It is good practice to union all parts of your model before exporting to STL, as this guarantees a clean, watertight mesh.
Subtract (Cut)
Subtract removes the volume of one shape from another. The first selected shape (the "base") keeps its volume minus the volume of the second shape (the "tool"). The tool shape is consumed in the operation — it disappears, leaving a void in the base shape. Think of subtract as using one shape as a cookie cutter or drill bit.
How to Use Subtract
- Select the base shape first (the shape you want to cut into).
- Hold Ctrl (Cmd) and click the tool shape(s) — the shape(s) that define the volume to remove.
- Click the Subtract button in the CSG toolbar, or press the keyboard shortcut S.
- The base shape now has a void where the tool shape was. The tool shape is removed from the scene.
The order of selection matters for subtract. The first shape you select is always the base (the shape that survives with material removed). All subsequently selected shapes are tools (the shapes that define what gets cut away). If you select them in the wrong order, press Escape, then re-select in the correct order.
Example: Creating a Screw Hole
Place a cube on the workplane as your base plate. Add a cylinder with a radius matching the screw size you need (for example, radius 1.6 mm for an M3 screw with clearance). Position the cylinder so it passes through the cube where you want the hole. Select the cube first, then Ctrl+click the cylinder, and apply subtract. The cylinder is removed, and the cube now has a clean circular hole through it.
Example: Creating a Key Slot
Start with a rounded box as the body of a device enclosure. Create a smaller cube that represents the opening for a USB port. Position the small cube at the correct location on the side of the rounded box, ensuring it extends slightly beyond both surfaces (so the cut goes all the way through the wall). Select the rounded box first, then Ctrl+click the small cube, and apply subtract. The result is a rectangular port opening in the side of the enclosure.
Subtract is the second most common operation. Almost every functional 3D-printed part uses subtract for holes, slots, recesses, channels, and cutouts. When designing for 3D printing, make your subtraction tool shapes slightly larger than the final dimensions you need — this accounts for the natural inaccuracy of FDM printing, which tends to make holes slightly smaller than modeled.
Intersect (Overlap)
Intersect keeps only the volume where two or more shapes overlap. Everything that does not overlap is removed. Think of intersect as asking "what region do these shapes have in common?"
How to Use Intersect
- Select two or more overlapping shapes.
- Click the Intersect button in the CSG toolbar, or press the keyboard shortcut I.
- The result is a new shape that contains only the shared volume.
Example: Creating a Lens Shape
Place two spheres so they partially overlap, with their centers offset from each other. Select both and apply intersect. The result is a lens-shaped (lenticular) solid — the football-like shape formed by the overlapping region of two spheres. This shape would be difficult to create any other way.
Example: Rounded Edge Cube
Place a cube and a sphere of the same radius at the same center position. The sphere clips the corners and edges of the cube. Apply intersect, and the result is a cube with rounded edges and corners, similar to a Rounded Box but with spherical rounding instead of cylindrical fillets.
Intersect is less commonly used than union and subtract, but it is invaluable for creating shapes defined by the overlap of simpler primitives. It is particularly useful for organic shapes, lens forms, and complex transitions that cannot be easily modeled with other operations.
Hole Objects
CADFaber supports a special object property called "Hole" that you can toggle on any shape. When a shape is marked as a Hole, it is visually displayed as a translucent shape in the viewport, indicating that it represents empty space rather than solid material. When you union a group of shapes that includes hole objects, the hole objects are automatically subtracted from the result.
Hole objects are a convenience feature that simplifies the workflow for common operations. Instead of performing a separate subtract step for each hole in your design, you can mark shapes as holes, position everything, and then union the entire assembly. The boolean engine handles the subtraction automatically.
To mark a shape as a hole, select it and toggle the "Hole" checkbox in the properties panel. The shape's appearance changes to a translucent rendering to visually distinguish it from solid shapes. You can toggle a shape back to solid at any time by unchecking the Hole property.
Hole objects work particularly well for designs with many mounting holes, ventilation slots, or cable pass-throughs. Place all your solid shapes and all your hole shapes in the scene, arrange everything, then select all and union. The result is the complete model with all holes cut in a single operation.
Tips for Clean Boolean Results
Ensure Sufficient Overlap
When unioning two shapes, make sure they overlap by at least a small amount (1 mm or more). Shapes that merely touch at a surface (zero overlap) can produce unreliable results because the boolean engine has difficulty determining interior versus exterior along the shared boundary. If two shapes need to share a face, extend one slightly into the other.
Extend Tool Shapes Beyond the Base
When subtracting, make the tool shape extend slightly beyond the surface of the base shape on both sides of the cut. If a cylinder is supposed to create a through-hole, make it a few millimeters longer than the wall thickness of the base. This ensures a clean cut that fully penetrates the surface without leaving a paper-thin shell at the bottom.
Avoid Coplanar Faces
Coplanar faces — where two shapes share exactly the same flat surface — can cause boolean errors. If you are subtracting a cube from another cube and their faces are exactly aligned, the boolean engine may produce unexpected results. Offset the tool shape by a tiny amount (0.01 mm) to avoid coplanar geometry. This is a common issue in all CSG-based modeling tools, not just CADFaber.
Union Before Export
Always union all parts of your model into a single solid before exporting to STL or other mesh formats. Multiple overlapping shapes that are not unioned can confuse slicer software, resulting in artifacts, missing faces, or failed prints. A single unioned mesh is guaranteed to be watertight and slicer-friendly.
Use Undo Liberally
Boolean operations are destructive — they permanently merge shapes into a new mesh. If the result is not what you expected, press Ctrl+Z (Cmd+Z) immediately to undo the operation. This restores all the original shapes so you can adjust their positions or parameters and try again. See the Visual Builder Guide for more on the undo system.
Save Before Complex Operations
Before performing a complex boolean operation with many shapes, save your project (Ctrl+S or export as Project JSON). This gives you a checkpoint to return to if something goes wrong. While undo covers most situations, having a saved backup provides extra peace of mind for complex designs.
CSG Keyboard Shortcuts
For fast operation, use the following shortcuts. The full list is available on the Keyboard Shortcuts Reference page.
- U — Union selected shapes
- S — Subtract (first selected shape is base)
- I — Intersect selected shapes
- H — Toggle hole property on selected shape
When to Use Each Operation
Choosing the right boolean operation is straightforward once you understand the mental model:
- Use Union when you want to combine shapes into a single solid — building up your model by adding material.
- Use Subtract when you want to remove material — creating holes, slots, channels, recesses, and cutouts.
- Use Intersect when you want to keep only the shared volume — creating shapes defined by the overlap of two primitives.
Most real-world designs use a combination of union and subtract. You build up the positive geometry with unions and then cut away negative features with subtracts. Intersect is used less frequently but is invaluable when you need it. With these three operations, you can create virtually any shape from simple primitives.
Practice boolean operations
Open the editor, place two shapes, and try union, subtract, and intersect.
Open Editor