Rhino 6 sun feature inside Grasshopper or GHPython?

Hi folks,

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

  1. 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?

  2. 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. :slight_smile:

Ladybird / Honeybee plugins let you do this.

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?

Thanks, @AndersDeleuran!

Generally speaking you:

  1. Discretise your analysis geometry to a dense mesh.
  2. Discretise your occluding geometry to a coarse mesh.
  3. Compute sun vectors for your analysis period.
  4. Flip and shoot these out from each face center of the analysis mesh.
  5. Intersect these rays with the occluding mesh.
  6. Further process the intersection results.
  7. 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.


What do you exactly mean by “occluding geometry/mesh”?

Thanks you again!

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.

1 Like

OK, I get it thanks!

@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

Any ideas?

As I recall, you first call the Sun.SetPosition() method, then you can get the Sun.Vector property.

1 Like

Oh, I must have overseen that in the reference. Thanks for helping! :slight_smile:

1 Like

Hi @AndersDeleuran,

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?

Have a nice weekend! :slight_smile: