booleanDifference

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:

  • booleanDifference
  • Parameters:
    • 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.

Example:

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:

command> sphere
Select center [x y z]: 0 0 0
Radius [double]: 2
command> sphere
Select center [x y z]: 1 1 1
Radius [double]: 0.75
command>

The state of the geometry at this moment is shown in the next figure:

Figure 1. State of the geometry before the booleanDifference operation


To create the desired object, we need to subtract the regions of the small sphere from the regions of the big sphere. This can be done in the following way:

command> booleanDifference
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)
Please Wait...
command>

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
Please Wait...command>

The final result is shown in the next figure:

Figure 2. State of the geometry after the booleanDifference operation