Skip to content

Boolean operations on arrays, Compound structure

DeepSOIC edited this page Jun 16, 2022 · 4 revisions

!! work in progress !!

Compound

Compound is a type of OpenCascade Shape. Compound is just a group of any other shapes.

When you create an array in FreeCAD (be it a Draft workbench array or Lattice2 array, except PartDesign), what you usually get is a Compound. For example, if you make a Draft Polar Array of boxes, the type of shape of the array is a compound of solids.

Compounds can be nested. For example, if you make a Draft Polar Array of another Draft Array, you'll get a Compound of Compounds. Same happens in Lattice2: if you populate an array of shapes onto an array of placements, you get a super-array with nested compound structure.

Compounds in boolean operations

When doing Part Boolean operations between compounds, FreeCAD assumes that shapes within those compounds do not intersect or touch each other (or if they do touch, the touching geometry is shared, which actually never happens by itself when arraying objects). This is done to save on computations. If they do actually intersect, the operation will likely either fail completely, or produce invalid result.

The easiest way to to test if there are invalid intersections within a (compound or not) shape is to use Part CheckGeometry with BOPCheck enabled.

Some of Part Booleans accept a single compound as an input, then this assumption is of course dropped. However, if it's a compound of compounds, the inner compounds are still assumed to not intersect each other. This will cause problems when trying to fuse arrays made in several steps.

For example, consider this 2d array of spheres, made by first making a 1d array of a sphere and then another 1d array or the array. Attempting to fuse it together

Clone this wiki locally