I have a few question about the sun feature that was introduced in Rhino 6.

Is it primarily meant to be a physical sun for rendering purposes (lighting, shadows, etc.) or can it also be used for sun studies in Grasshopper, like DIVA or Ladybug?

Since there are no Grasshopper components yet that let you tap into the sun data, is this information (i.e. daylight, radiance, glare, shadows) available from the API (rhinocommon) in Python?

At least being able to control the Rhino sun from Grasshopper would be a neat future feature in my opinion.

One can at least instantiate a Rhino Sun system and compute sun vectors from this (thatâ€™s what I did here). You should also be able to fiddle with the sun system within the Rhino document from e.g. GHPython. Iâ€™d think itâ€™d be similar to editing lights, clipping planes etc.

Which algorithms are being used and their accuracy is a bit more unclear. For full transparency and the ability to reference methods/papers, Iâ€™d also go with Ladybird/Honeybee.

Sure, but Iâ€™m curious about the Rhino sun feature!

Nice work! For your graphics do you shoot a number of rays at the mesh and evaluate the mesh vertex colours from intersection events? Could you explain your process a little more please?

Discretise your analysis geometry to a dense mesh.

Discretise your occluding geometry to a coarse mesh.

Compute sun vectors for your analysis period.

Flip and shoot these out from each face center of the analysis mesh.

Intersect these rays with the occluding mesh.

Further process the intersection results.

Visualise this data as colours on the analysis mesh.

Step six is where you define and add meaning to the intersection results. For instance, computing how many hours each sun vector represent, and then computing how many sun hours each analysis face center received, and then getting the areas of these to compute how many total sun hours per square meter the analysis geometry received within the analysis period (which inversely would correspond to shadow hours).

Iâ€™d recommend looking into the literature review of e.g. Ladybug. As there is a ton of published work on this subject.

Analysis Geometry = Geometry you want to analyse for how much sun it receives.

Occluding Geometry = Geometry that might shade the Analysis Geometry.

Note that the Analysis Geometry might also be part of the Occluding Geometry, in case you want to check for self-occluding massings for instance. In such cases we typically offset the analysis points a bit away from the analysis mesh centers, to allow for computing the ray intersections.

@AndersDeleuran, would you know by any chance how I could feed information (azimuth, altitude, vector, etc.) to a new sun object, in order to change it?

import Rhino
sun = Rhino.Render.Sun() # creates an standard sun
sun.Azimuth = 25.6 # does not work to change the azimuth

I have another question that you might be able to answer. When I get the sun vectors for an entire day, am I right in the assumption that sunset and sunrise can be determined by the altitude angle of the sun? Am I right that a negative altitude, smaller than 0 degrees, would mean that the sun has gone down or hasnâ€™t risen yet?