- Home
- CAD Exchange
- How to Use the Boolean Object and the Combine Objects Tool
- Home
- Non Sequential Ray Tracing
- Objects
- How to Use the Boolean Object and the Combine Objects Tool
How to Use the Boolean Object and the Combine Objects Tool
- By Mark Nicholson
- Published 3 April 2006
- CAD Exchange , Objects
-
Rating:




Boolean Operations
A OR B: Syntax A+B

A AND B: Syntax A&B

Its easy to get AND and OR mixed up. Remember that OR will give you the volume occupied by either object, while AND gives you the volume occupied by both objects.
A XOR B: Syntax a^b

This gives you the volume contained by either but not both objects. In this case, if the Boolean object was made of glass, then there is no glass in the region of overlap between the two parent objects.
A AND NOT B: Syntax a-b

This is effectively a subtraction operation, in which any overlap of objects A and B is removed from object A
NOT A AND B: Syntax a$b

The volume produced is equivalent to B AND NOT A, b-a, but there is a subtle difference: the Boolean object has the same coordinate system as whatever object is listed first. So a$b will yield an object positioned relative to the same point in space as object a, and b-a will produce the same volume positioned relative to the same point in space as object b.
Up to ten objects may be the parents of a single Boolean object, and Boolean objects may also be the parent objects of other Boolean objects. This allows objects of any complexity to be made. Parent objects must be defined prior to the Boolean object in the editor. All operations are carried out in left-to-right order.
Here, for example, is a more complex Boolean object. It is available in {zemaxroot}/samples/non-sequential/boolean/lens mount.zmx:

This object is made with the string a-b-c-d, and it allows a simple, but fully parametric lens mount object to be made easily.