Method to build a backward raytracing in GH?

Dear GH community,

I have a little tricky question.

I would like to find a method to follow the so-called Backward-Raytracing and see if is possible that a specular reflection exists between the line of sight AB and the sun position C, knowing the vector direction from point B to use for the reflection. I also have the information of the point C and the vector between B and C.

Any advice on how to solve this problem?

Thanks in advice

UPDATE: If I understand your problem correctly here is a script that I think tackles it?

The viewer at the green dot is good to go, the red dot viewer is seeing the sun on the glass, OUCH! :sunglasses:

You can adjust the tolerance in the “Tolerance In Degrees (Viewing Cone)” Panel.

Method Utilizing Geometry: (14.7 KB)

Method Utilizing Vector Math Only: (15.3 KB)


Dear Michael,
I sincerely thank you for your time and expertise. The script is really clean and clear.
After a quick check, everything seems ok and with what was my goal.

I just have to understand what degree of tolerance is more appropriate to use.

Thanks for all and best regards.


1 Like

Glad to hear that J-Rob, all the best and let me know if you get stuck implementing it.