Skip to main content

In OpticStudio 20.3 we implemented new CAD libraries that significantly improved the performance of systems containing imported CAD object. Unfortunately some important information regarding these changes was not included in the 20.3 Help Files documentation. We will be including updated documetation in the next service pack, but in the meantime we'll add the relevent content to this thread to illustrate where behaviour has changed.

When importing STEP/IGES/SAT CAD parts into OpticStudio 20.3 they will, by default be converted to .SAB file format rather then the .ZOF format used in previous releases. Full detail below



 



CAD Part: STEP/IGES/SAT



Objects may be imported in either IGES, SAT, or STEP format. These file formats are commonly supported by CAD programs. Imported objects may also be in SAB (native format of ACIS CAD libraries, see “Imported objects and SAB files”). Once imported, an object may have optical properties such as coatings, glass, and scattering functions applied, and then be ray traced like any other optical component.



To import an object, set the object type to “CAD Part: STEP/IGES/SAT” and select the file name from the drop-down box, or place the file name in the comment column. The file must reside in the \CAD Files folder (see “Folders” ) and end in the extension IGS, IGES, SAT, STP, STEP, or SAB. The extension must be included with the file name on the comment column.



 



Imported objects and SAB files



When importing CAD objects from IGES, STEP, or other format files, the data must be translated into the OpticStudio internal object representation. This conversion need only be done once, and thereafter the converted file can be used. This greatly speeds up the loading of imported objects. The converted file name is the original file name with the extension SAB (ACIS binary format) appended. For example, if the original imported file was MyObject.IGS, the SAB file created will be MyObject.IGS.SAB. The name of the file used by the imported object will be changed to the converted file name. OpticStudio will automatically convert imported files to SAB format files if the original file requires more than 2.0 seconds to read and convert, and if the scale factor is 1.0. If the scale factor needs to be something other than 1.0, first set the scale factor to 1.0, then after the file has been converted to SAB format, the scale factor may be adjusted to the desired value. This restriction prevents unexpected scaling of the SAB object when more than one ZMX file is using the same SAB object.



It is recommended that the original CAD file be retained, even though the SAB file will be used by OpticStudio. This allows regeneration of the SAB file should that be required. This feature may be disabled, see “Convert Imported Files To SAB” under “Type tab” .



Note that when the “Use ACIS Libraries” option is un-checked in Project Preferences>General then OpticStudio will use the old CAD libraries and imported objects will be converted to ZOF (Zemax Object Format) rather than SAB.


For CAD Part: STEP/IGES/SAT there are some important changes to the 'Model Parameters' of the Object Properties...CAD settings.



The 'Chord Tolerance' and 'Maximum Edge Length' control not only the rendering of the object, but (unlike in previous releases) also affect the ray trace speed and accuracy in a similar way to the Drawing Resolution for native OpticStudio objects.



In addition there are now 4 ray 'Trace mode' options available, although  Standard is the default and recommended setting.



 



Model Parameters





Chord Tolerance: This setting affects the rendering of the object. It performs a very similar function to the Drawing Resolution (The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Object Properties (non-sequential component editor) > Draw (object properties, non-sequential component editor)) for OpticStudio native objects. To render the object, OpticStudio generates a list of triangles which approximate the object shape. The tolerance is the maximum allowed distance in lens units between a single triangle and the actual surface of the object. More triangles are added if the tolerance is set smaller which yields more accurate rendering, at the expense of speed and a larger memory requirement.


This setting is also used to provide a “first guess” as to the location of the ray-object intercept point. So the smaller the triangle the closer the initial guess is to the correct solution and the more likely OpticStudio will converge to the correct intersection.


The default value of zero will use a chord tolerance related to the size of the object sufficient to generate a coarse approximation of the object shape that will render quickly.



Maximum edge length: Maximum length of any side for each triangle.



Trace mode:





  • Standard – this is the default mode; rays are traced to the faceted model, then an iterative method is used to converge to the true intersection to the underlying NURBS geometry; the ray is reflected/refracted based on the surface normal at the intersection point.


  • Flat – rays are traced to the triangles only and reflected/refracted based on the normal of the triangles plane.


  • Shaded – rays are traced to the triangles only and reflected/refracted based on an interpolated normal from the vertices of the triangle.


  • Kernel – uses the ray tracer built in to the ACIS library. Note that this method is extremely slow, but highly accurate and can serve as a reference. This is the only mode that does not rely on the faceting of the object.



For CAD Part: STEP/IGES/SAT some settings under 'Model Parameters' are no longer available/applicable with the new CAD libraries.



 



Surface Tolerance: This parameter is no longer applicable with the ACIS libraries



 



Surface Mode: The Surface Mode setting is not available in OpticStudio 20.3. If you were using this setting in a model created in an earlier release of OpticStudio then the face mapping will not be preserved when the file is opened in 20.3. You will need to use the 'Surface to Face Mapping' settings to remap your faces in the desired way. Un-checking the 'Use ACIS Libraries' option in Project Preferences>General will restore the availability of the 'Surface Mode' setting but will remove access the the performance improvements of the new libraries.


Hey Chris,



Thanks for that.If I remember correctly, the precision of the iterative ray trace is 10^-8 or 10^-10 lens units (can't remember which). How much more accurate is the Kernel mode?



- Mark


Hi Mark,



In terms of the kind of precision you referring to the Kernel is the same as the Standard ray trace. The difference is use of facets for the initial 'first guess' intercept in the Standard method which is much faster but can, in some cases, result in ray trace errors if the faceting is set too coarse. This initial first guess is not used in the Kernel method which is what makes it slower.



Chris


Hi Chris,



is there a way to restrict chord tolerance and max edge length only to some regions of the CAD? Sometimes it is desirable to adjust these parameters only in some (problematic) regions. If not, is this planned for a future release? 



Best regards



Christian


Hi Christian,



Thank you for your question.



Currently there is no way to restrict the chord tolerance and max edge length on specific regions of a CAD object, and I do not believe it is planned to add this capability in the near future. Would you be able to provide some more detail on the situations in which this capability would be useful. Also are you suggesting these values could be set on a face by face basis? I can then pass this information to our product team for evaluation.



Thanks,



Chris


I'm hoping that the presentation charts and any demo *.zar files can be posted.  Thanks, Mike


Chris, thanks for this thread. I flagged the post above, for which the image is not loading here. When trying to open it in a separate tab, I am asked to login to focus.zemax.com (I can't), not even sure what it is.



ACIS-related question. I am now testing ACIS, and I see that, when I don't touch the default settings, the ray tracing turns out different (between old the WoW and the ACIS-based ray tracing), for a relatively complex STEP geometry. After a couple of bounces, rays directions start diverging a bit, ending up hitting different parts of the mechanical component and eventually propagating very differently. I will play with the settings, but I wonder if this is an expected behaviour, if you can comment on which tracer should be more trustworthy, and what is the recommended course of action. Obviously, playing with different settings until I observe convergence could be an answer, but a very expensive one. I'd appreciate the plug-and-play solution :)



 


Hi Kotya, 



Thanks for pointing out the issue with the image. It turns out that the original image was hosted on an internal site, and that's why it wasn't appearing. We've updated the image, so let us know if you still have trouble accessing it. 



With respect to your question about the ACIS libraries, there could be a few different reasons why you're seeing differences in the ray trace results. A few of these are outlined in the post you flagged, but the likely culprit is the Chord Tolerance settings. In terms of how to address this quickly and easily, I'd recommend that, for your existing design (and assuming it's performing as expected), revert to the old libraries by unchecking 'Use ACIS Libraries' in the Project Preferences, under General. 





That said, for any new designs where you're loading in CAD geometry for the first time, I'd recommend using the new ACIS libraries. There are a lot of benefits to using these libraries, including compatibility with CAD file formats, ray tracing speed, and general reliability. Let us know if you have any questions here, and we'll be happy to chat more. 



Cheers,



Nick


Reply