Boolean Operations
Boolean operations combine multiple solids using constructive solid geometry (CSG).
union
Combine multiple objects into one. The result contains all volume from all inputs.
Syntax:
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
obj1, obj2, ... |
solids | — | Objects to combine |
r |
float | — | Fillet radius for newly created edges (PythonSCAD extension) |
fn |
int | — | Number of segments for fillet rounding (PythonSCAD extension) |
PythonSCAD extensions:
Specifying r and fn adds rounded fillets to the edges created by the union:
Examples:
OpenSCAD reference: union
difference
Subtract one or more objects from the first object.
Syntax:
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
obj1 |
solid | — | Base object |
obj2, ... |
solids | — | Objects to subtract |
r |
float | — | Fillet radius for newly created edges (PythonSCAD extension) |
fn |
int | — | Number of segments for fillet rounding (PythonSCAD extension) |
Examples:
OpenSCAD reference: difference
intersection
Keep only the volume that is common to all input objects.
Syntax:
Parameters:
| Parameter | Type | Description |
|---|---|---|
obj1, obj2, ... |
solids | Objects to intersect |
Examples:
OpenSCAD reference: intersection
hull
Create the convex hull of multiple objects. The result is the smallest convex solid that contains all input objects.
Syntax:
Parameters:
| Parameter | Type | Description |
|---|---|---|
obj1, obj2, ... |
solids | Objects to hull |
Examples:
OpenSCAD reference: hull
fill
Fill concavities in a 2D shape, creating a convex outline.
Syntax:
Parameters:
| Parameter | Type | Description |
|---|---|---|
obj1, obj2, ... |
2D solids | Shapes to fill |
Examples:
minkowski
Compute the Minkowski sum of two objects. Conceptually, this "traces" one object around the surface of the other, useful for rounding edges.
Syntax:
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
obj1 |
solid | — | Base object |
obj2 |
solid | — | Object to trace around obj1 |
convexity |
int | 2 |
Convexity for rendering |
Examples:
OpenSCAD reference: minkowski
concat
Concatenate the meshes of multiple objects without performing boolean operations. This is useful when sub-parts are not yet watertight and CSG would fail.
Syntax:
Parameters:
| Parameter | Type | Description |
|---|---|---|
obj1, obj2, ... |
solids or lists | Objects to concatenate |
Examples: