The difference() modifier will subtract the children of the object, from the first item in the modifier brackets.
Let’s start by subtracting a sphere from a cube. First add a cube
cube(5);
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_639.png)
Add a sphere
sphere(5);
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_640.png)
Now place a difference() modifier in front of the cube, and press f5
difference() cube(5); sphere(5);
Nothing Happens! With the Set Modifiers ( boolean in OpenSCAD lingo. The children being operated on must be inside Curly Brackets.
difference() { cube(5); sphere(5); }
Press F9 to change to Preview Mode and F5 to Render
![](https://www.openscad.info/wp-content/uploads/2020/05/Selection_641.png)
With the difference modifier every child after the first is subtracted from the first. In this case sphere is subtracted from cube