Question

Array object is slower than Lenslet Array in NSC raytracing


Userlevel 3
Badge +1

Micro lens array (MLA) is a common optical components for illumination system. OpticStudio provides two object types to define MLA in NSC mode, which are “Array” object and “Lenslet Array” object. In the page of “Lenslet Array” in Help file, we can see the following description.

“The array aspects of this object are provided for back compatibility with older versions of OpticStudio. A more efficient method that ray-traces more quickly is to make a single lenslet and then create an array using the Array Object - see “Array” for details. “

However, at least when the number of lenslet is large, for instance 70 x 70 = 4900 cells, Array object is not always the best choise.

The table shows the elapsed time comparison in updating 3D Layout and NSC ray tracing with the NSC mode system having 70 x 70 MLA. MLA is defined by Lenslet Array or Array.

  Lenslet Array Array
Updating 3D rayout 22 sec 2 sec (faster)
NSC ray tracing (5E+5 rays) 1.8 min (faster) 9.1 min

 

Lenslet Array is 5 times faster than Array object when NSC raytracing. However, Lenslet Array takes long time just for modification of parameters.

Although it’s not good workaroung, only suggestion is switching object type based on the design process to avoid the trade off. When you’re in design stage, Array object is better since you may frequently change the object parameters. Then when you’re in analysis stage, Lenslet Array object is better since you run heavy NSC ray tracing.

Please let us know if you have any uncomfortable experience due to the trade off. Feedbacks may help us to understand how this trade off makes simulation difficult.


6 replies

Userlevel 3
Badge +1

A user found much faster way of micro lens array object for NSC ray tracing. That is CAD part. If you have mechanical CAD, like Creo or AutoCAD, micro lens array can be modeled, then the STEP file can be imported into OpticStudio NSC mode.

He created 2 type of STEP file of MLA. One is 1 STEP file of whole MLA. The other one is 4 STEP files for four quadrant of MLA.

  1 STEP file 4 STEP files
Updating 3D rayout 6 sec 3 sec
NSC ray tracing (5E+5 rays) 1.4 min 32 sec (fastest)

 

Disadvantage of STEP file is not availbale for parametric modification though, the calculation speed helps us for quick analysis of illumination system.

4900 MLA defined by 4 STEP files. The fastest for NSC ray tracing.

 

Userlevel 7
Badge +3

I’m curious what the developers say about this. It’s the opposite to the way it ‘should’ be.

Yes, I have the same problem. When the pitch of the lenslet array is small and the number of arrays is large, my computer barely works(i 7+16GB).

Userlevel 3
Badge +1

@Mark.Nicholson , @522721806 , thank you for feedback!

 

Yes, I was also thinking calculation speed should be “Array” > “Lenslet Array” > “CAD”, but the test case shows totally oppsite results. I’ve asked developers about slowness of “Array” than “Lesnlet Array”. The answer was as below.
“Array does have to do a lot of looping through the different positions. The Array object can only make optimizations that are true for the general case -- i.e. that hold true regardless of the parent object -- while the lenslet array can analytically calculate (I believe) which sub-lens it will intersect with, so it should generally be much faster than the Array to trace.

I would expect the Array object to be slower for any dimensions, but the only way to say for sure is to test it.

There are likely ways to speed up the ray trace for the Array, but it would take some dedicated research time to try out various options.  Some of those options may require significant up-front calculations so it might trade off lens update time for ray trace performance.  That may be worthwhile for running a single ray trace, but may not be worth it when trying to optimize the system.

 

I haven’t asked about Array/Lenslet Array vs CAD, but it may be simply CAD is faster than these native objects because it inlcudes just one position and geometry.

BTW, CAD export from OpticStudio didn’t wrok for 4900 MLA with my machine. The conversion process looks very heavy and I need to stop OpticStudio from task manager. Please ask mechanical engineer to create the MLA object with mechanical CAD.

Userlevel 7
Badge +3

That does sound odd. The array object should ray trace much faster than the Lenslet Array object, and it did when we first released it, otherwise it wouldn’t have been released. It’s possible though that subsequent work has sped up the native lenslet array. It’s also possible that subsequent work slowed down the array object. It would be good to know which.

Userlevel 3
Badge +1

I’ve forwarded your question to dev team though, the answer was that we don’t have clear insight on that. Comparison the historical performance of the Array and Lenslet Array will require long time.

I want to trace the case, but unfortunately it may be difficult to improve the trade-off in short term. I hope we can recieve more feedback from users. Thank you!

Reply