TAGGED: OpticStudio
-
-
January 1, 2025 at 6:01 pm
binyuw
Subscriber -
January 2, 2025 at 11:03 am
Christophe Weisse
Ansys EmployeeHello,
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 (hopefully close enough) 1D example of what you could do with a ZPL macro. All sources aim at the same point, you use-case being simplier it is rather easy to edit the code to match your needs:
Â
# "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 need the array to be parametric and/or if your array is very large, it could then be more convenient to program the source the way you need with the Source DLL option. -
January 2, 2025 at 3:46 pm
binyuw
SubscriberThank you so much.
my rectangle sources have specific position and sizes. They all have a defined spacing and titled angle. May I just manually create multiple "source rectangles" in the editor (or any other ways)? I check the DLL and API and still confuse about the coding.
Eventually I want to create something like this:
x:1.5mm, y:0.05mm title angle 45 degree C
Â
Best
Binyu
-
January 3, 2025 at 9:18 am
Christophe Weisse
Ansys EmployeeDear Binyu,
You're right, creating every object by hand is always possible (you can copy/paste any object, which may make it somewhat convenient) but you'd need to edit some parameters manually. Also, API or DLL can be quite intense if your task is rather simple. This is why my first suggestion was to use macros (ZPL).
This is an easier to use, simplier programming option that excells at automating tasks.
I gave it a quick go to illustrate how ZPL could be used in your set-up:
I hope this helps,
Christophe
-
- You must be logged in to reply to this topic.
- STEP File Exports
- Optic studio-zemax operand values are different from the plot (Genc and Denc)
- Assistance Needed for Wavelength Adjustment in Optical Ring Modulator Simulation
- Matlab linkage Zemax memory overflow problem
- Relay Lens Optimization
- Gaussian beam propagation and field by angle
- RMS Spot size in Non-Sequential Method in Zemax Opticstudio
- How to calculate Wavefront RMS when “Remove Tilt” is chosen in Wavefront Map?
- Issues opening Zemax files
- Zemax: creating an array of tilted source
-
2342
-
925
-
599
-
591
-
527
© 2025 Copyright ANSYS, Inc. All rights reserved.