Booleans
Boolean operations, add
, subtract
and intersect
can be used with or without arguments. If no argument is provided the operations apply to the last two objects.
In the object below the subtract
statement is added at the end. Since their are no arguments the last two objects are used. In this case the cylinder is subtracted from the sphere.
If you want to subtract the combination of the cylinder and the sphere from the block you can include the cylinder and the sphere in a block statement.
Alternatively you can use functions to create an object and use this as an argument for the subtract
operation. The function a
has one argument called size
. Instead of plain JavaScript functions you can also use arrow functions. For example, the constant b
is represented by an arrow function which takes no arguments. The functions a(15)
and b()
are supplied as arguments to the subtract operation.