I developed this custom Rhino command to perform shading studies for a number of Chinese projects. There are specific building codes in areas of China which restrict how new construction can shade existing residential buildings. All residential units must be allowed to receive at least 2 hours of sunlight every year on Jan 21st.
I first ported the code from the NOAA Solar Position Calculator into a .NET Library, which I then used to create the custom Rhino command. The command calculates the exposure on a collection of windows, which are provided as Rhino surfaces. Shading masses are also provided as BRep objects. Each window is then colored depending on whether it meets the exposure required by the building code.
I later ported this tool into a custom grasshopper component.