xrt icon indicating copy to clipboard operation
xrt copied to clipboard

optic surface normal vector and intersection point with incident ray

Open leahwang1962 opened this issue 2 years ago • 4 comments

Hi, in XRTGlow, is it possible to display the intersection point coordinate value(local or global) of incident ray with optic surface, and the optic surface normal vector at this point? Let's assume only tracing one ray, passing through source center and optic center. Thanks.

leahwang1962 avatar Jun 12 '22 20:06 leahwang1962

Hi, it's not possible now, sorry. I would just save a screenshot and add overlay text in a photo editor. I can hardly imagine the usability of this feature - we normally work with hundreds of thousands of rays, no way to annotate all of them or even select which ones you want to annotate. What I can try to implement is a tooltip-kind text and instant surface normal when you move your mouse over an intersection point, but might end up in annoying pixel-hunting.

yxrmz avatar Jun 12 '22 23:06 yxrmz

Totally understandable. The reason I asked for this is I found some reflected rays behaving strangely, and I planed to manually calculate the reflected ray at these points given the intersection coordinates and surface normal vectors to figure out what is going wrong. The incident ray from point source hit vertical mirror first and reflected to hit the horizontal mirror. However as shown in the attached, the incident ray on the first mirror looks not reflected following the surface reflection rule(red color for incident ray, blue color for reflected) . Same thing happens when ray hit the second mirror surface. Can you help me for this confusion. Thanks a lot. RefletedRayByVerticaleMirror CMF11-29Cu15.zip

?

leahwang1962 avatar Jun 13 '22 17:06 leahwang1962

Hi, Since you don't set surface limits, although you asked about it in #104, rays may find an imaginary second reflection point at the back continuation of the reflected ray towards the second mirror that is behind the surface of the first mirror. In my view, your definition of such intersecting mirror surfaces is not legitimate. Anyway, to cope with such cases, I've added an extra check that the propagation path is always non-negative. Please try it from the present GH version.

kklmn avatar Jun 14 '22 09:06 kklmn

I see. Thanks a lot.

leahwang1962 avatar Jun 14 '22 15:06 leahwang1962