Vector Shadows Need Help With A Script

Hello everyone,

I’m hoping to get some guidance and advice from the community on a Rhino Python script for generating vector shadows. I have been hammering at this problem for a while, iterating through many versions to try and get it right. The latest version of the script is attached. My main goal has been to correctly separate shadows cast on other objects from self-shadowing, and to implement occlusion testing to prevent shadows from incorrectly projecting through the caster or onto the wrong surfaces.

While the current script is the best I’ve managed so far, I know it can be improved and I feel I might be reaching the limits of my current approach. It still sometimes creates fragmented lines or struggles with very complex geometry. My dream is to have a script that produces truly reliable shadows as measurable areas—clean, closed, planar curves that can be used for analysis, hatching, or further design work.

I would be incredibly grateful if some of you with more experience in this area could take a look at my code and offer some guidance. Are there more robust algorithms for silhouette detection (the terminator)? Are there better, more efficient ways to handle the projection and validation steps in RhinoCommon? Any advice or fresh perspective would be immensely appreciated. Thank you!

VectorShadow-v3.py (26.9 KB)