Windows/roof lights Optimisation


I am trying to develop a simple script that allows me to change the dimensions of windows and the distance between them on a roof plan. See image below for better explanation.

I’ve tried to put something together, not too sure about it though, it only allows me to control the window size but not the distance (I could control the number/count of segments). Find the GH file attached

Could someone please take a look on the script I’ve put together and advice on how to control the distance between the windows rather than number of segments?

and if there is a simpler way of putting this together, please let me know.

Standard (8.6 KB)

OUCH!!! Opening your model freezes up my computer. Grafting the ‘C’ input to ArrRec results in 3600 rectangles(!) which chokes SDiff. Warning to anyone who wants to open that file: disable GH solver first and then disable SDiff before doing anything else. Standby for a fix…

Here is one possibility:

Standard (16.1 KB)

Hi Joseph, sorry about that as I’m not very familiar with GH geometry.

Thanks a lot, the file you sent is definitely lighter :slight_smile:

  1. is there a way to control the distance between the windows as a parameter? instead of u and v count?
  2. and is there a way to keep the surfaces of all windows, as highlighted in the image below? I need them to continue the study.


ArrRec generates the grid of rectangle curves so you can get surfaces from them using Boundary without the surrounding perimeter curve:


Yes, of course there are other ways of controlling distance between windows, but I’ll leave that to you. Good luck and have fun.


great, thanks a lot for your help!

Just to expand a little on what the easter bunny has already delivered, you can only define the window size, as well as the window spacing, if you are willing to adapt your overall roof size to the resulting window layout.
If not, you have to make a choice, depending on what is more favourable for your project: either fixed window sizes, or fixed distances between the windows.

Do you understand all the details of the code I posted? And just what do you have in mind?

One obvious “improvement”(?) would be to make the distance at the edges be the same as the distance between windows in the middle, instead of only half that distance, as shown. :sunglasses:


Standard (16.8 KB)

@Joseph_Oster Yes, I’ve picked that up, the unequal distance from the edges was one of the things I wasn’t sure how to fix, thanks!! I’m developing this to be used in a daylight study to optimise roof lights

One thing not sure I fully understand in the script is this, what do these two components do?

Thank you, yeah I think it makes sense :slight_smile:
It’s more likely that the roof size will not adapt to the window layout, so will keep it to the second option. :+1:

@angeldigitaldesign oh wow thanks for this! it looks a bit advanced for my level, will spend some time trying to understand it

Proceed no further until you understand every detail of that simple GH model.