Using the OpticStudio Dynamic CAD link with assemblies

This article explains how to dynamically open and explode SolidWorks®, Autodesk Inventor® and PTC Creo Parametric® assembly files inside OpticStudio.

Authored By Dr. Sanjay Gangadhara, Updated by Thomas Pickering

Downloads

Article Attachments

Introduction

OpticStudio Premium supports the ability to dynamically link assemblies from various CAD programs in Non-Sequential Mode. This feature allows users to load their assemblies into OpticStudio as a single object or as an exploded file. Any single object may only have one set of volumetric properties (material, bulk scattering distribution, etc) and up to 51 unique faces with their own surface properties (coatings, surface scattering distributions).

In the case of assemblies, it is often preferred to explode the file upon import so that each part may be assigned unique properties. In this article, we will review how to load an assembly file into OpticStudio via the CAD Assembly objects, and how to explode that assembly into its constituent parts.

Loading an assembly file

The first step required to use OpticStudio’s Dynamic CAD capability is to install the appropriate CAD software package:

  • Autodesk Inventor® 2018 must be installed to use the “CAD Assembly: Autodesk Inventor®” object, which dynamically links to Autodesk Inventor assembly files (*.IAM)
  • PTC Creo Parametric® 4.0 must be installed to use the “CAD Assembly: Creo Parametric®” object, which dynamically links to PTC Creo Parametric assembly files (*.ASM)
  • SolidWorks® 2017 must be installed to use the “CAD Assembly: SolidWorks®” object, which dynamically links to SolidWorks assembly files (*.SLDASM)

Important Note: The OpticStudio technical support team cannot assist with SolidWorks®, Autodesk Inventor®, or PTC Creo Parametric® installation.

The native CAD assembly files are loaded into OpticStudio via the Non-Sequential Component Editor (NSCE). Each CAD program has a unique object type (e.g. CAD Assembly: Autodesk Inventor®, CAD Assembly: Creo Parametric®, etc.). 

When using either the CAD Assembly: Creo Parametric® object or the CAD Assembly: SolidWorks® object, the corresponding application must be opened prior to loading a part into OpticStudio (and should remain open as long as OpticStudio is running) to ensure that communication is always available between OpticStudio and the creating program.

Conversely, when using the CAD Assembly: Autodesk Inventor® object, it is not necessary to start Autodesk Inventor® prior to loading an Inventor part into OpticStudio. OpticStudio will automatically open Inventor in silent mode, meaning that the Inventor application will not appear anywhere on the user's monitor but a process will be visible in the user's Task Manager listing. This process should be allowed to run as long as OpticStudio is running, in order to ensure that communication is always available between OpticStudio and Autodesk Inventor®.

Autodesk Inventor® example

In this example, we’ll open up an assembly file created in Autodesk Inventor®. This file and its constituent part files are included as attachments at the end of the article. The files were created by engineers at Inventor 3d and have been obtained from the free CAD distribution website GrabCad.

Note that for the assembly to load correctly into OpticStudio, OpticStudio must have access to both the assembly file as well as the part files for all of the constituents of the assembly. All of these files must be in the same folder (more details below). If some part files are missing, the resulting assembly will still be constructed with the remaining parts (if OpticStudio cannot find any of the part files for the assembly, an error message will be issued). It is therefore up to the user to ensure accuracy of the assembly.

The assembly file chosen for this example represents a filament-type source embedded inside of a structural housing. Here is the assembly, as shown in Autodesk Inventor®:

To load this assembly into OpticStudio, we first need to place the assembly (.IAM) file and the constituent part (.IPT) files in the appropriate folder. The default folder for Autodesk Inventor® files is "{Zemax}\Objects\Inventor Files," though this location may be changed by navigating to Setup...Project Preferences...Folders in OpticStudio. Note that there are separate folders for the SolidWorks® and Creo Parametric® files.

Once the assembly file is in the correct folder, open OpticStudio, and switch to Non-Sequential Mode by navigating to Setup...Non-Sequential. In the Non-Sequential Component Editor, expand the Object Properties, and select Type:CAD Assembly: Autodesk Inventor® from the drop-down menu.

Then, select the *.IAM assembly file, and click OK.

Note that any assembly file with an *.IAM extension that is present in the correct folder can be selected as the input file. After clicking OK, you will see the following notification, indicating that Autodesk Inventor® is being opened, and the assembly is being loaded into OpticStudio.

Exploding the assembly

Once the assembly file has been loaded, OpticStudio will automatically ask if you wish to explode the assembly into its constituent parts.

If you select “No” above, then the assembly will not be exploded, and it will simply be read in as a single file. If the option to explode the assembly is not selected upon first load, it may be selected later by expanding the CAD tools in the NSCE toolbar, and choosing “Explode Autodesk Inventor® Assembly."

In order for the appropriate CAD tool to be enabled, the CAD Assembly object row must be selected in the editor.  For example, if a “CAD Assembly: SolidWorks®” object were selected, then the “Explode SolidWorks® Assembly” tool would be enabled instead. In the example file, select Explode Autodesk Inventor® Assembly will open the following settings dialog.

Select Get Part Count to see the number of constituent parts in the assembly.

Then select Explode to break the assembly into its constituent parts. After doing this, all other buttons in the dialog will momentarily be disabled, and the status update will read, "Please Wait..."

Once the assembly has been exploded, the buttons in the above dialog will be enabled again. Click Exit and view the NSCE.

Each of the constituent parts is written to a file in the Zemax object format (.ZOF), and loaded into OpticStudio via the CAD Part: STEP/IGES/STL object. Thus, the geometry of the constituent parts is fixed in OpticStudio, consistent with our expectation that parts inside of the assembly do not require further modification.

If you would like to model an assembly in which each of the parts can be dynamically modified inside of OpticStudio, you’ll instead need to load each of the individual parts in their native file format. In that case, we would use the CAD Part: Autodesk Inventor® object.  See the article, Using the OpticStudio Dynamic CAD Link.

After explosion, the position and orientation for each of the constituent parts is referenced to the parent assembly via the “Ref Object” parameter in the NSCE.  For more information on reference objects, see the Help System file The Setup Tab...Editors Group (Setup Tab)...Non-sequential Component Editor...Non-sequential Overview...Object Placement.

Expand the Object Properties of the parent assembly. Although this object remains in the editor, it will be ignored by rays.

The Rays Ignore Object setting is automatically changed to “Always” during the explosion. In addition, go to the Draw section of the Object Properties, and you’ll see that the parent assembly object will not be drawn in the 3D Layout or Shaded Model viewers.

The parent assembly is used as a reference object, and its constituent parts are now the only meaningful objects in the system.  If the assembly is not needed in the editor, then it can be manually deleted, but there is also an option to delete the assembly in the Explode Assembly Settings dialog:

If we checked this setting the original .IAM file would not be included in the NSCE.

The position and orientation of each of the constituent parts is still referenced to that of the parent assembly, but the assembly itself has been replaced by a Null Object. There are two advantages of deleting the assembly object after explosion:

  1. The file will require less memory, which may be an issue if the initial assembly is large and memory intensive;
  2. The file will no longer require a dynamic link to Autodesk Inventor® (or the appropriate CAD program), increasing the speed at which updates may be made to the file (e.g. during optimization).

However, if the parent assembly is subsequently modified in the creating program (Autodesk Inventor® in this example), those modifications will not be acknowledged by OpticStudio if the parent assembly is deleted after explosion, because the link to the creating program has been lost. Thus, even if the parent assembly is ignored by rays inside of OpticStudio, keeping this file in the NSCE ensures that any changes made to the assembly in the creating program are subsequently read in the next time you open your OpticStudio file containing the exploded assembly.

Defining optical properties

Now, since the assembly has been exploded, different properties may be assigned to the filament source and the housing. For example, we may specify that the housing is made from polycarbonate. To do this, type POLYCARB into the Material parameter of Object 2 in the NSCE. Note that this will automatically add the MISC catalog into the list of current Material Catalogs.

Next, we can set the filament (Object 3 in the NSCE) to be a metallic reflector. To do this, we first need to group all of the surfaces of the filament geometry into a single face. Navigate to Object 3 Properties...CAD; click Select All, and then Change To->: Face 0.

Then, we can apply a reflective metal coating to Face 0. Go to the Object 3 Properties...Coat/Scatter; select Face: 0, Face 0, Face Is: Refecltive, and Coating: METAL.

The METAL coating is a thin layer of aluminum, which is commonly used to make beam splitters. Additionally, by setting "Face Is: Reflective," only the reflected rays are considered. If this were left as “Object Default”, then the face would be either refractive, reflective, or absorbing, depending upon the material type.

In reality, the physical properties of both the filament and the housing may be much more complicated than given here. For example, light may be scattered from each of these objects via complex surface scattering distributions. If the scatter distribution for each object can be measured (e.g. with the IS-SA Imaging Sphere), then this data can be directly incorporated into OpticStudio via the BSDF scatter model. For more information on this model, see the article, "How to use tabular BSDF data to define the surface scattering distribution.” 

Tracing rays

We can now place a Source Filament object in the system to simulate rays that are generated from our CAD-defined filament. The source object must be defined to be inside of the housing, using the “Inside Of” parameter:

To match the properties of the CAD-defined filament, the following steps should be taken:

 Parameter  Value
 Z Position  13.500 mm
 Layout Rays  100
 Analysis Rays  1,000,000
 Length  4.500
 Radius  1.150
 Turns  15.000

 

In the above screenshot, the Source Filament is highlighted in orange in the NSC 3D Layout, and you can see that the geometry follows the curvature of the filament in the CAD object.  To view this in the NSC 3D layout, select the “Ignore Trace Errors” setting in the toolbar of the NSCE.  This will suppress ray trace errors in the layout viewers. Valid systems will occasionally have error rays due to finite computer precision, or other minor problems, and this is common for imported CAD parts. See the article, "How to locate geometry errors: part 1" for more details. 

Last, define the spectral distribution of the filament via its equivalent color temperature by navigating to Object 4 Properties...Sources. In the Color/Spectrum settings, select Color Temperature and enter 6500 K. For more information about these source settings, see the article entitled "How to model colored and tristimulus sources." 

Now, let’s add a far-field detector to capture the light from rays emitted by the source. Insert a new object in the NSCE and set its Type: Detector Color. Apply the following settings:

 Parameter  Value
 Z Position  500 mm
 Material  ABSORB
 X Half Width  2000 mm
 Y Half Width  2000 mm
 # X Pixels  100
 # Y Pixels  100

 

To view the irradiance distribution on this detector, we have to run a ray trace. Go to Analyze...Ray Trace. Use the following settings, and click Clear & Trace to trace the 1 million analysis rays.

Once the ray trace is complete, click Exit and open a Detector Viewer. The results show the far-field behavior of a filament source inside of this CAD model. 

This model is sensitive to the material properties defined for both the filament and the housing. In this example, the physical model for the source (i.e. the CAD-defined filament) allows us to accurately characterize the interaction of light with the real source of emission. This means that light reflected back toward the filament will correctly interact with the CAD object. This is a phenomenon which is not accounted for with the source model alone.

KA-01444

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.