How can I measure the shadow excerted by balconies onto other balconies?

Hello everyone,

I have this geometry and my main goal is to maximize terrace surface area while minimizing total shadow onto this terraces, with galapagos, but first I need the measurements. Total surface area is easy, got it. I need help with the total occlusion measurment.

I am aware of add-ons such as Ladybug and Geco, I have only worked with Ladybug once.
There are also custom scripts like this one:
https://medium.com/generative-design/solar-analysis-in-grasshopper-5dae76c9b6cb.

Although all these are useful for defining constraints like sun position, time, etc, I haven’t found a way to measure what I want to measure. Searched the forums and most discussions are about a building’s shadow onto the floor, not onto itself.

If i can measure it once for any given sun position, the rest is simply an average of multiple hours and sun positions. Thanks in advance for any help.

Terraces 1.0.gh (32.1 KB)

Any ideas? I think the basic approach would be to project each surface onto the one below and compute the intersection, but that fails when a upper surface also shadows a surface that is below by two levels or more.

And then there is the problem of the shadow angle. If the light is directly above, the geometry is already there, but if the light angle changes so does the shadow, and there projection would not suffice, as you would need to create a surface that has the shape of the shadow first…

even If you are aware of ladybug, that’s something I would have a look at. It has right what you want, and I think also as example. Your sunhours position etc, and a shadow analysis. Using more balconys at once is no problem.

Ofc you can do shadow analysis without ladybug or diva, but this would be the easiest way in my opinion

Alright Tim, thanks for the response. I will take a look, but just to clarify, sun position and etc its not really what I want, the link I posted has a C# script for that. The important part is the shadow m2 exerted over the building by itself.

Can’t look at your file. But maybe have look at a thread I created a while ago. Not at my initial question, but there were some scripts that used mesh ray/shadow etc. Maybe this could help you a bit.

Yikes + Yikes! Completely forgot that I’ve promised to do something. Blame the advancing Alzheimer and some VERY poor results on matters that count the most (Lewis in F1 and Vale in MotoGP).

Don’t worry Peter :smiley: Wasn’t a thread about something I needed, just personal interest. Thanks anyway for your help :slight_smile:

Alright I have been checking some LadyBug examples here:
https://hydrashare.github.io/hydra/?keywords=LBExampleFiles
But unfortunately none seem to be oriented for what I need, should I maybe ask back on their forum? I wasn’t able to post there though…

But it got me thinking, maybe I don’t need to minimize the shade surface area, instead maximize the total sunlight hours on the geometry… (which an examples seems to calculate already) Hmmm will try to adapt it to my geo and report back.

I downloaded an example: “Shadow_Range_Analysis” Which calculates the hours of sunlight for a given context on a grid.

What I did is put my solid brep both on the context input and the _geometry input, meaning it should construct the grid on the brep itself and not a grid on the ground. I dont know if its working correctly, but it seems like it.

What is baffling me are the outputs. I realized that for Galapagos I need the hours of shade not the hours of light. To minimize this value while maximizing surface area. I can obtain this with sunIsVisible. But, the results seems to differ from totalSunlightHours. By the descriptions I am not sure what totalSunlightHours is doing… I think it has to do with one considering only the hours when the sun is out and the other one considering them all? Dunno.

LadyBug Terraces.gh (302.1 KB)

totalSunlightHours The average number of hours of direct sunlight received by the test _geometry.

sunlightHoursResult The number of hours of direct sunlight received by each of the test points of the input test _geometry. Note that is is the number of hours out of the total number of connected _sunVectors.

sunIsVisible A grafted data stream for each test point with a “1” for each hour of the sunVectors that the sun is visible and a “0” for each hour of the sunVectors when the sun is blocked.

This sounds like multi objective optimization. How wood you do that in Galapagos?

About the output:

  1. Minimizing hours of shade = maximizing hours of sun.

  2. If you use something like octopus for multi objective, you always need to minimize you goals. But if there is something you want to maximize, you easily make the number negative. This will give you the maximum while optimizing for minimum.

  3. I think the output is relatively good described. You can use any of these for your optimization.

You can minimize and maximize with formulas in Galapagos, as David explained here:

In my case the simple formula -A+B = Fitness, will do.
-A is minimizing and B is maximizing.
But I need to minimize the shade hours. In case I would maximize hours of sun, there is no inversion for surface area. I would still need to maximize surface area and hours of sun. That Galapagos cant do, or at least you need to start inputing weights into your formula to decide which variable predominates over the other. Not ideal.

I still not understanding what totalSunlightHours is doing… or why it gives a different amount of hours than
sunlightHoursResult. The difference in both results is huge.

I really don‘t get it. Maybe it‘s because English is not my native language, maybe because I’m trying to help you from my phone and not having access to your file.

  1. why do you need to minimize shading hours? Maximize sun light hours.
    If you need a minimization for the formula, just get a negative component after the output of ladybug. This will result in a minimization.
  2. didn‘t read the whole thread you mentioned, but for multiple fitness with Galapagos you need to know your min/max to set up the formula right. How do you do that? I mean for surface ok, but how for ladybug result?

I am trying to achieve the least shadow with the greater surface area.
I prefer not to try to maximize 2 values on Galapagos. (Sun hours and surface area)
Instead, it is better to minimize a value and maximize another. Sun hours can be inverted into shade hours. Surface area cannot be inverted into anything. Thus surface area always has to be maximized. And I need to use the inverse of sun hours, which is shade hours, to minimize.

Yup.

I dont need to know the max or min. I just need to calculate the surface area and the hours of shade each time a slider is changed. Which I think I was able to achieve already.

Yes, mentioned that above.

Where’s the problem?

Where’s the problem?

So it should work or not? Why are we still talking if you already solved it?

Right, we diverted from my original question. It was more oriented towards LadyBug outputs:

So I am no really sure which output to use, but maybe the optimization still works the same with any?
The only output I was able to invert into shade hours was sunIsVisible. If you look at the panels on the screenshot:

sunlightHoursResult = 1,035,392 h
sunIsVisible = 1,035,392 h
totalSunlightHours= 12,066,000 h

Pretty big difference of light hours…

Unfortunately, I can’t help you with that. Can’t explain it either. Maybe ask this at the ladybug forum: https://discourse.ladybug.tools/
But I think, you can use all the outputs for the optimization.

Just a fast test with octopus: 1 Day, 24 hours, 1 domain as genome Just tested top surface, the others are context.

Low shadow hours:

Middle:

High area:

Terraces 1.0_re.gh (534.1 KB)

Looks like everything is working.

1 Like

I mean sunlightHoursResult is in relation to the test points. One poit per mesh face. Maybe totalSunlightHours is in relation to the area?

Hi guys.
Probably a little out of thread… messing around with region intersect components led me to make this:
shadows
This give out the real shape of the illuminated/shaded areas.
Works only with flat horizontal shapes.
Terraces 1.0_re2.gh (42.3 KB)
(Descriptions inside definition:)

3 Likes

Really nice idea :slight_smile:

That looks great Riccardo! Thank you!
Could you please upload a canvas image? I seem to be missing the evaluate surface and a subtraction. I figured the eval goes at start but not sure how the subtraction connects.