Skip to main content

I noticed that there is no option to set the aperture when creating a lens in non-sequential mode. Please teach me how to set the aperture.

@Masato.Aketagawa

 

In a Standard Lens you can use the columns Clear 1/2 and Edge 1/2 to define the dimension of your lens.

In Non-Sequential, if rays miss the lens they don’t get refracted by the lens as in Sequential mode, i.e. the rays are not expected to travel from one object to another in sequential order in Non-Sequential mode.

There are many ways to add other kind of apertures to the lens as a separate object. It is quite typical to use the Annulus object, with a Material set to ABSORB.

I hope this helps.

Take care,

 

David


I’ve got a fairly similar challenge.  I’ve got a lens in NSC where the edge of the lens has been trimmed on one axis (i.e. the refracting faces are rectangular, not circular).  I’m trying to block all light that could go around the edge of the lens (like the housing for the lens mounting would do.  

I can just use the ordering of NSC objects to put a rectangular beam block in place before I place the lens, but I can’t figure out how to place that beam block at the widest point of the lens in a programmatic way, since the lens location is defined by the front of the lens.  As a result, I end up with my beam block being behind the widest point of the lens, and it doesn’t adjust as the lens changes during optimization.  Any suggestions? 

 

Beam Blocking rectangle is below widest part of lens

 


@dkominsky,

 

I can suggest the following solution, which still requires you to place a source ray (it could be automated, but it will become specific and since I don’t know what object you used, I couldn’t do it).

The Source Ray should be colinear with one of the 4 edges of the lens (the example below is done with the Material of the lens removed so that there’s no refraction, more on that later).

The idea of the algorithm is this:

  1. Ignore the aperture, such that it doesn’t interfere with the calculations
  2. Remove the lens material, such that no refraction occurs
  3. Use NSRA to find ray segments Z coordinates
  4. Calculate the aperture position based on NSRAs
  5. Set the Z Position of the aperture
  6. Put back the lens material
  7. Don’t ignore the aperture anymore

You can do that in a ZPL macro like so:

# Find the lens, aperture, and source objects in the NSCE based on the Comment column
aper = OBJC("APERTURE")
lens = OBJC("LENS")
sour = OBJC("SOURCE")

# Ignore the aperture object for the computation
SETNSCPROPERTY 1, aper, 16, 0, 1

# Get lens material
dummy = NPRO(1, lens, 4, 0)
glass$ = $buffer()

# Remove lens material for the computation
SETNSCPROPERTY 1, lens, 4, 0, ""

UPDATE

# NSRA operand code
nsra = OCOD("NSRA")

# Z coordinate of segments
seg_1_z = OPEV(nsra, 1, 1, 0, 0, 1, 3)
seg_2_z = OPEV(nsra, 1, 1, 0, 0, 2, 3)

# Lens edge thickness
edge_thic = seg_2_z - seg_1_z

# Set aperture Z Position
SETNSCPOSITION 1, aper, 3, seg_1_z + edge_thic / 2

# Put back the lens material
SETNSCPROPERTY 1, lens, 4, 0, glass$

# Consider the aperture object
SETNSCPROPERTY 1, aper, 16, 0, 0

UPDATE

I made a dummy system like so (that I will also attach to my reply):

These two screenshots below are the before and after running the macro.

Before running the macro, the aperture is located before the lens, obscuring the ray.
After the macro, the aperture plane is placed halfway along the edge of the lens.

Let me know if anything isn’t clear in the macro.

Take care,


David

 


David,

Thank you for the answer.  I can’t test it right now (our license expired yesterday, and they haven’t gotten the new license up and running yet), but I look forward to doing so soon.  It does seem like a (perhaps unnecessarily) complex process to finding the widest point of a lens, but if that’s what it is, then that is what it is.  I had been hoping there was a straightforward way to use the two curvature values and the thickness to extract it, rather than having to use a ray as a ruler, but something is better than nothing, right?

 


@dkominsky

 

You could use the curvature values and the thickness as well of course, but as I mentioned previously, I don’t know what object you used and what kind of curvature you applied. If its a free-form lens, it might be tricky to find the intersection mathematically. If the curvatures are purely spherical, then you could indeed solve this without raytracing quite easily. But since you asked generally, I tried to come up with an answer that would be independent of curvature.

On a similar topic, this is kind of how the Programming..User Analyzes..NSC Sag analysis works. Tracing a grid of rays onto a surface of interest and finding intersection points to measure the sag.

I hope this makes sense.

Take care,

 

David


Reply