Solved

2D source array with different tilt

  • 17 May 2022
  • 1 reply
  • 197 views

Userlevel 1
Badge

Hi,

Working with NSC, I want to create a 2D source array where the surface normal of each source intersects at the same location (or be able to be changed manually).
There is the option to create an array in the properties of the NSC editor, however there is no option to rotate the source individually in the array.

I have attached pictures of what I am hoping to achieve. Is there a way to generate this 2D array?
Thank you for reading!


 

icon

Best answer by David.Nguyen 17 May 2022, 11:07

View original

1 reply

Userlevel 7
Badge +2

Hi Ian,

 

To the best of my knowledge, you won’t find an object that readily does that.

However, you could use a macro or the ZOS-API to place and orient the array of sources to your will.

Here’s a 1D example of what you could do with a ZPL macro:

 

# "Focal" distance of the detectors
distance = 25

# Distance between detectors as a factor of the index value
factor = 4

FOR det_index, -5, 5, 1
    # Insert new object in first line of editor
    INSERTOBJECT 1, 1
    
    # Change object type to Detector Rectangle
    SETNSCPROPERTY 1, 1, 0, 0, "NSC_DETE"
    
    # Calculate Detector Y Position
    y_pos = factor * det_index
    
    # Change Detector Y Position
    SETNSCPOSITION 1, 1, 2, y_pos
    
    # Calculated required Tilt About X in deg
    IF (det_index == 0)
        tilt_x = 0
    ELSE
        tilt_x = 90 - ATAN( distance / y_pos ) / 3.14159265359 * 180
    ENDIF
    
    # Adjust Detector Tilt About X
    SETNSCPOSITION 1, 1, 4, tilt_x
NEXT

 

If you run this macro, this is what the 3D Layout will look like:

 

 

If you are not familiar with macros, I suggest browsing the articles here. To run the macro above, you need to copy it to a text file and save it with the *.ZPL extension. Then you need to place this file in your {Documents}\Zemax\Macros folder. Then, go to OpticStudio and press Programming..Edit/Run, choose the saved file, and press Execute.

Let me know if this makes sense.

Take care,


David

Reply