What Is a Compound Shape in FreeCAD Part Workbench
In FreeCAD's Part workbench, a compound shape is a single topological entity that groups multiple distinct geometric shapes together without physically merging their geometry. This article provides a clear overview of what compound shapes are, how they function within the OpenCASCADE modeling kernel, how they differ from Boolean operations, and the practical scenarios where you should use them.
Understanding the Compound Shape
A compound shape acts as an aggregate container for other shapes. It can hold any combination of geometric elements, including vertices, edges, wires, faces, shells, and solids. Unlike assemblies or groups, which are organizational tools in FreeCAD's tree view, a compound is recognized mathematically as a single shape by the underlying geometric modeling kernel.
Even though FreeCAD treats the compound as a single object, the underlying components do not interact geometrically. Their original boundaries, faces, and intersections remain completely intact inside the compound structure.
Compound vs. Boolean Fuse
The primary distinction between a compound and a Boolean union (Fuse) lies in how intersecting geometry is handled:
- Boolean Union (Fuse): Calculates intersections between overlapping shapes, removes internal dividing geometry, and fuses adjacent boundaries into a single continuous solid. This operation is computationally heavy and can fail if geometries are non-manifold or have coplanar edges.
- Compound: Groups the objects instantly without calculating intersections or altering topology. If two solids overlap inside a compound, they simply pass through each other, retaining their respective internal walls and separate volumes.
Because a compound bypasses the intensive calculations of the Boolean engine, creating a compound is virtually instantaneous, regardless of the complexity or number of the sub-shapes.
Common Use Cases
Compound shapes serve several important functions in 3D modeling workflows:
- Exporting Multi-Part Assemblies: Many CAD and mesh formats, such as STEP, IGES, or STL, require a single root shape to export multiple disconnected components together. Making a compound allows you to export multiple parts in their correct spatial layout at once.
- Drafting and Meshing Arrays: Features like the Orthogonal Array or Polar Array often output compound shapes to represent duplicated parts efficiently without melting them into one single solid.
- Avoiding Boolean Failures: When you need to manage multiple touching or overlapping bodies that cause OpenCASCADE Boolean operations to fail, a compound allows you to manipulate and position them as a single item.
- Complex Sectioning and Projections: Compounds are frequently used when generating 2D drawing views or cross-sections of assemblies, enabling section lines to slice through multiple independent parts simultaneously.
Creating and Managing Compounds
To create a compound in the Part workbench, select two or more shapes in the tree view or 3D viewport, navigate to the menu, and choose Part → Compound → Make Compound.
If you need to revert the process, select the compound and choose Part → Compound → Explode Compound. This action dissolves the container and restores the individual components back to the tree view as separate shapes. FreeCAD also offers a Compound Filter tool to isolate or extract specific sub-elements from a compound without exploding the entire structure.