booleanIntersection
This command creates an object with the regions of the two selected objects that are included in both of them (A AND B operation). Note that the original objects used for the operation will be deleted.
Inline mode usage:
- booleanIntersection -h
- Displays the help file that summarizes the parameters for this command.
- booleanIntersection –s –objectA <list of names A> -objectB <list of names B>
- Draws the parts of the surfaces listed in A and B that are contained in both objects.
Interactive mode usage:
- booleanIntersection
- 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 have a box and an overlapping sphere, like the shown in the next figure:
This geometry was created by running the following commands:
command> boxFirst corner of base [x y z]: 0 0 0
Base size [width depth]: 1 1
Height [double]: 1
command> sphere
Select center [x y z]: 1 0.5 0.5
Radius [double]: 0.3
command>
Getting an object of the shared regions between the two objects is possible by running the booleanIntersection command in the following way (note that the boolean intersection operation is commutative, so the order of the selection does not matter):
command> booleanIntersection
Select the surfaces of the 'objectA' on screen (Press enter when done) (Select one of the objects)
Select the surfaces of the 'objectB' on screen (Press enter when done) (Select the other object)
Please Wait...
command>
As usual, it is possible to run the command in non-interactive mode by using the object names. Assuming the names of the objects are "sphere" and "box":
command> booleanIntersection -s -objectA sphere -objectB box
Please Wait...
command>
The final state of the geometry is shown in the following figure:
Note that the booleanIntersection operation computes the regions that are shared between the objects (therefore, this operation is commutative). On the other hand, the booleanInside operation calculates only the parts of the surface of an object that are inside the other object (this operation is not commutative). As a result, the output of the booleanIntersection operation is a closed surface because it encloses a region (assuming the input objects are also closed surfaces, as in this example), while the booleanInside operation would not output a closed surface because its output is only the part of the surface of an object that is enclosed inside another object.