GENERATE/PREV.gifGENERATE/NEXT.gif

Mesh Boolean Operations

The mesh operations underlying the Boolean Compound Object in MAX are accessible in MAXScript. They appear as operators (+, -, *) that you can apply to any two scene objects that are convertible to meshes. The operators are:

<node1> + <node2>      -- the union of node1 and node2

<node1> - <node2>      -- the subtraction of node2 from node1

<node1> * <node2>      -- the intersection of node1 and node2

Example:

$foo - $baz

$sphere01 + $sphere02 + $sphere03 + $sphere04

The Boolean operators change the first operand to be the result of the operation and leave the second operand untouched. So, in the first example, the $foo node is changed to an Editable Mesh object containing the result of the difference operation. In the second example, $sphere01 is successively unioned with each of the other spheres - $sphere01 contains the compound result and the other spheres are left standing. This behavior is experimental and I'm open to suggestions.

Note that unlike the Boolean compound object in MAX, this operation destructively modifies the first operand - you can't retrieve the original first operand after the Boolean operation is performed. You can effectively keep the first operand by using a copy function, for example,

result = (copy $foo) - $baz

will put a modified copy of $foo into the variable result, leaving the original $foo unchanged.