I’m trying to create an orange from boolean orange slices in Zemax. The question is how to wrangle them into position in the simplest way possible. I’ve attached a screenshot which shows the LDE and the incorrect placement of the 2nd wedge. Thanks!
Coordinate Transformations in Non-Sequential
I think you want to leverage the Array Ring object for this problem. However, for the Array Ring to work, you need the local Z axis of the orange wedge to be along the straight line of the wedge. When you cut the Cylinder as you did, the local Z axis is the one from the Cylinder (as shown below, if you double-click on an object it opens its properties and under Draw..Draw Local Axis you can display its local axis).
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/ab2440d6-6216-4964-89fa-628d4ffb2d3b.png)
However, we can trick the Boolean native with a dummy Cylinder Volume as such:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/fd0a6544-ea88-444c-bd43-62ec8e5e0764.png)
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/8fc43d09-ffeb-42b4-b641-b6840eb147a4.png)
Basically, I have intentionally put a dummy Cylinder Volume inside your main Cylinder Volume with the Local Z Axis of the dummy Cylinder Volume along the straight line of the wedge. The Boolean native is then Cylinder Volume + dummy Cylinder Volume - the two Rectangular Volumes. Because the dummy Cylinder Volume is Object A, the Boolean Native has its Local Z Axis aligned with the straight line of the wedge:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/e7a20027-cd9b-461f-b861-1dcbf9eb0541.png)
I hope you can see the local axis on the left-hand side of the figure with a small arrow (indicating the Z Axis) pointing along the straight line of the wedge. From then on, you can simply use the Array Ring object. The Radius is zero because you want to rotate exactly about the Local Z Axis, and the # Of Elements is 360 divided by the angle of the wedge. I’ve done an example (also attached to my post) below with 3 configurations showing wedge angles of 20, 40, and 60 degrees:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/6411492d-83ae-49c8-8622-3b7c3231297b.png)
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/fe184ecd-3b49-4c97-8e28-aedc2e393565.png)
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/c9f7ba92-995c-42c9-8914-666223e3e5cd.png)
I’m using a macro solve to return the number of elements
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/d0343eb5-12d9-4cdf-a3a4-7f768513b3df.png)
It will of course not work if you choose a wedge angle that doesn’t split the orange in discrete wedges.
Thank you for the great question, I had a lot of fun and I hope this solves your problem.
Take care,
David
I’m getting only geometry errors when I try to raytrace the orange with the single raytrace tool. It appears that Zemax isn’t sure what interface properties to assign between the wedges.
If you look at the coating properties for the single wedge, there are 11 faces, each with properties defined by a face on the parent cylinder or one of the rectangular volumes that were used to cut the wedge.
Is there some way to tell it to use the same index at the wedge interfaces as that assigned to the wedge itself?
Thanks!
Another puzzle is why the rays bend refractively in the air outside the orange. I’ve only assigned a refractive index to the Boolean wedge. It seems like there may be a mismatch between the geometry that Zemax created vs. what it’s rendering.
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/9e97a271-ce9e-4a19-a214-c68ffbb0857b.jpg)
TL;DR use Boolean CAD instead of Boolean Native
Unfortunately, the same happens for me:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/177eb129-5ef2-439b-ae29-b1a82120f6f3.png)
I had to increase the System Explorer..Non-Sequential..Maximum Nested/Touching Objects to 50. When I look at the single wedge and even without the dummy cylinder, this is what I get:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/6f239e68-edf6-4776-8011-fe56e11d9468.png)
Somehow a segment is created before the wedge (blue). I was quite puzzled so I wrote a script to automate the creation of the orange as many wedges that I turn and reposition accordingly.
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/2aa66899-10f8-477d-9d41-70c2cef3fce7.png)
import math
TheNCE = TheSystem.NCE
wedge_radius = TheNCE.GetObjectAt(1).ObjectData.__implementation__.FrontR
wedge_angle = 2*TheNCE.GetObjectAt(2).TiltAboutX
number_of_wedges = int( 360 / wedge_angle )
ref_object_id = 5
for ii in range(1, number_of_wedges):
TheNCE.CopyObjects(ref_object_id, 2, TheNCE.NumberOfObjects+1)
reference_object = TheNCE.GetObjectAt(TheNCE.NumberOfObjects-1)
new_wedge_object = TheNCE.GetObjectAt(TheNCE.NumberOfObjects)
new_wedge_object.RefObject = TheNCE.NumberOfObjects-1
rotation_angle = ii * wedge_angle
reference_object.TiltAboutX = rotation_angle
new_wedge_object.YPosition = math.sin(rotation_angle/180*math.pi)
new_wedge_object.ZPosition = - ( 1 - math.cos(rotation_angle/180*math.pi) )
And this is the result:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/c47cb2b0-2354-4573-be36-11b8d8411ec1.png)
I will attach the file to my answer, but this also doesn’t make sense and the rays bend outside the orange. There’s a really odd diagonal ray as well… I tried changing the System Explorer..Non-Sequential..Glue Distance In Lens Unit to 1E-3 (maximum I could set), but nothing changed.
I have a feeling the problem is with the Boolean Native. In fact, if I do the same with Boolean CAD it works for both methods Array Ring and the manual creation and relocation of wedges:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/6ef81881-e0cf-4726-aa82-fdf0639d9a0a.png)
You may want to ask Zemax Support about why it doesn’t work with the Boolean Native 🤔 as an academic, I can no longer log support tickets. Perhaps the Zemax CAD expert
I would stick to the Array Ring method but use a Boolean CAD.
Take care,
David
Definitely think Zemax support should look at this, it looks very much like a bug that’s spoiling an otherwise excellent application of killer features!
- Mark
It does seem to be working with the Boolean CAD object. Thanks so much for all your help!
I can’t, but I can share this orange joke:
What happens when you rub two oranges together?
I like the Boolean Native / Array Ring model generated by
The ray-tracing issue associated with this version is likely related to the placement of the source. As noted in the help documentation for the Boolean Native object, if the source is located inside one of the parent objects, then the source should have the “Inside Of” parameter set to the Boolean Native object number (which may require changing the row at which the source is defined in the NCE). Otherwise, rays will refract at the boundaries of the parent object(s).
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/cae06913-ab61-4bbd-9422-44b3a16639e6.png)
Alternatively, for a collimated source, its origin can simply be moved outside of any parent objects.
Using the single-slice example above, you can see two different results depending on where the source is positioned:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/21f1b2fc-42c4-47da-9211-7ac7f1f72f63.png)
Regards,
Jeff
Ok, as a follow-up to the previous post, there does indeed to be some strange behavior when the array ring object is used to combine the slices, even when the source lies well outside of the parent volumes:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/83cc353e-7dee-4b76-a52e-edbddac30745.png)
It would be helpful for someone at Zemax to take a look.
Thank you for the insight
I want to hear the orange joke
Take care all,
David
I can’t, but I can share this orange joke:
What happens when you rub two oranges together?
Frictic Acid?
As a hint, it’s considered a cult classic movie from 20+ year ago.
P.S. I had to think about this one a bit, so thanks for the brain teaser
Hi all,
Hope you are doing well and thanks for looping me in here,
I`ve tried to reproduce all the points which were raised here.
Single slice;
Weirdly enough, if I delete the Array Object and only look at a “single slice” which David has created with the Boolean Native, there is still a ghost segment before the ray is entering the body (Marked in the right NSC Plot in red below). But if I turn the slice 90 degrees and enter the body from the top, the rays seem to propagate correctly into the slice, but still have a odd behavior exiting it.
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/6ad28f86-882f-4406-ad07-cf73385f2ea6.png)
As already mentioned in this thread, the Boolean CAD seems to work:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/89860285-6ba4-467e-a87a-fead35c1e79c.png)
Full orange;
If we look at the front and side impact for the full orange, we can see that the behavior (bug) agrees with the findings from the single slice. As we established in the single slice example, the impact from the outer (“orange skin side”) does not create a ghost segment in the front, but after the propagation through the orange:
![](https://uploads-us-west-2.insided.com/zemax-en/attachment/52a98431-b23a-43a9-ba9b-87117e2a5be8.png)
Thanks everyone for all the contribution!
We will keep you updated.
Hahaha, I think I got the joke finally with
Take care all,
David
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.