Boolean CAD

A Boolean CAD object is defined by a series of Boolean operations performed on other objects. Boolean CAD objects can be used to form very general shapes by adding, subtracting, and intersecting other CAD objects. For example, a lens mount with a hole can be created by importing a STEP file of the lens mount, and then subtracting a Cylinder Volume from the mount. A wide range of complex objects may be created by performing successive Boolean operations on other objects.
For Boolean operations of native objects in OpticStudio, see the Boolean Native object. Unless the parent objects are imported CAD parts, ray tracing with the Boolean Native object is up to 10x more efficient than the Boolean CAD object.
The Boolean operations are performed by converting each component object into a NURBS based representation, and then a series of Boolean trimming and combining operations are performed to yield the resulting object. For this reason, Boolean CAD objects have the same considerations that Imported objects do; see " CAD Part: STEP/IGES/SAT " for more comments about imported objects. Some loss of precision is possible when converting from OpticStudio native objects with high precision representations to NURBS representations; this is not a limitation of OpticStudio but is inherent in the NURBS representation of arbitrary surfaces. Generally, precision can be increased as desired using the Spline and Tolerance parameters described below. When extreme optical precision is required, the user should verify that the Boolean CAD object traces to a suitable accuracy.
The Boolean CAD object is defined by 22 parameters and a string defining the desired Boolean operations:
Parameter # | Description | Face Name | Face # |
1 | Spline controls the number of points to use for fitting splines to aspheric surfaces during the conversion from OpticStudio format to NURBS format. The value for spline is an integer code, where 0 = 4 points, 1 = 8 points, 2 = 16 points, 3 = 32 points, 4 = 64 points, 5 = 128 points, and 6 = 256 points. Higher spline settings increase accuracy for some objects at the expense of slower object creation, rendering, and ray tracing. | NA | NA |
3 | Mode. The mode controls the tradeoff between set-up time and ray tracing speed. Use mode 1 for fast set up time and slower ray tracing, mode 2 for medium set up time and medium ray tracing, and mode 3 for slow set up time and fast ray tracing. Generally use mode 1 during set-up of the analysis, and mode 3 for analysis tracing a large number of rays. | NA | NA |
4-6 | # X Y, Z Voxels. Voxels is a name derived from "volume pixels". A voxel is a 3D rectangle that defines some portion of the total volume occupied by imported solids. Voxel technology allows for fast ray tracing by pre- computing which objects, or portions of objects; lie within a given voxel. A ray entering a voxellated space may only intersect some subset of the total number of voxels; and therefore only these voxels need to be checked for possible ray-object intersections. The greater the number of voxels, the longer the set-up time but the faster the ray tracing. It generally takes some experimenting to determine the optimum number of voxels. Use 5 for all three values if no other values seem obviously superior. | NA | NA |
7-12 | Unused. | NA | NA |
13-22 | The object numbers that define which object is A, B, C, etc. See the discussion below. | NA | NA |
Defining parent objects
Parameters 13-22 are used to define which "parent" objects will be combined. Parameter 13 is used to define which object is Object A, parameter 14 defines which object is Object B, etc. There is no need to define more objects than are required for the desired Boolean operation. If only two objects are to be combined, then only Object A and B need to be defined. Any unused objects may be left with an object number of zero. All defined objects must precede the Boolean CAD object in the NSC Editor. The list of defined objects should always start at Object A, then continue with Object B, etc., e.g. it is not valid to set the object number to zero for Object A and then have a non-zero object number defined later in the list. Parent objects may not be sources or detectors.
Boolean operations
Once all the parent objects are defined, the Boolean operation is defined by a "Control String" placed in the "Comments" column of the form:
object oper object [oper object ]...
The "object" argument is a single letter, such as A, B, or C; which corresponds to the desired object. The "oper" is a single character operator. The following operators (between objects A and B in the logical example) are supported:
+ Combines the two objects together (logical A OR B).
- Subtracts the second object from the first (logical A AND NOT B).
& Computes the intersection of the two objects (logical A AND B).
^ Yields the portion of the object that is part of one or the other, but not both objects (logical A XOR B).
$ Subtracts the first object from the second (logical NOT A AND B). Here are some example Control Strings:
A+B
E+A-B-C
F+B&E-A
All operations are carried out in left-to-right order. No order precedence, such as parentheses, is allowed. Each Boolean operation is performed on the result of previous operations to the left of the operator, with the object listed just to the right of the operator being the second argument. Note the $ operator can be used to subtract the first object from the second. This is useful for combining objects and then subtracting the combination from a third object. For example, to create the object (A - B) and then subtract this combined object from C, use the string "A - B $ C".
Object placement
The local coordinate system of the resulting object will be the same as the local coordinate system of the first object listed in the Control String. The global object position and orientation is set by the object position and tilt parameters in the same manner as all NSC objects.
If the parent objects are not needed, use the "Rays Ignore This Object" and "Do Not Draw Object" settings on the parent object (See "Type Tab" and "Draw Tab" ). The Boolean CAD object will still be created even if the parent objects are not drawn or ray traced.
The Face numbers and properties of the Boolean CAD object are defined by the face numbers and properties of the parent objects. All face properties from the parent objects are copied to the corresponding faces of the Boolean CAD object. To view each face on any object, use the NSC Object Viewer (See "NSC Object Viewer" ). There is a limit to the total number of unique faces on any single object; for details see "Object faces" .
One significant advantage of the Boolean CAD object is that the resulting volume is still parametrically defined by the parent objects. Changing any of the parent object parameters will change the Boolean CAD object as well. If this capability is not needed, the Boolean CAD object may be exported as a IGES or STEP file (see " CAD Files " for more information on CAD export) and then imported using the CAD Part: STEP/IGES/SAT object (see " CAD Part: STEP/IGES/SAT "), and then the parent objects may be deleted.
Next: