Description: This command computes the resulting surfaces of subtracting the second object to the first one (A minus B operation), that is, the regions of the first object that are not contained in the second object.
Inline mode usage:
- booleanDifference -h: Displays the help file that summarizes the parameters for this command.
- booleanDifference –s –objectA <list of names A> -objectB <list of names B>: Draws the parts of the objects of A minus the objects of B.
Interactive mode usage:
- Invocation: booleanDifference
- Surfaces of the 'objectA': selection of surfaces and objects of the first object.
- Surfaces of the 'objectB': selection of surfaces and objects of the second object.
Suppose we want to create a sphere with a sphere-shaped hole in its surface. To do this, we need to create a whole sphere (using the sphere command) and the sphere that will represent the hole we want to make in the previously created sphere. The following commands will be used for the creation of the two spheres:
Select center [x y z]: 0 0 0
Radius [double]: 2
Select center [x y z]: 1 1 1
Radius [double]: 0.75
The state of the geometry at this moment is shown in the next figure:
State of the geometry before the booleanDifference operation
To create the desired object, we need to substract the regions of the small sphere from the regions of the big sphere. This can be done in the following way:
Select the surfaces of the 'objectA' on screen (Press enter when done): (Select the big sphere)
Select the surfaces of the 'objectB' on screen (Press enter when done): (Select the small sphere)
If the spheres had names, the command could also be run in the following way (assuming the spheres have, as names, "bigSphere" and "smallSphere"):
command> booleanDifference -s -objectA bigSphere -objectB smallSphere
The final result is shown in the next figure:
State of the geometry after the booleanDifference operation