Creating holes in side model

Hi everyone, i am working with a side map which has buildings more then 30.000. These buildings are representing as polysurfaces and i am trying to create holes as an windows to these buldings. Is there any way to write a script in a grasshopper to create those holes? I am very new at grasshopper.

hello, welcome to Grasshopper
As Grasshopper is a sort of programming language and that it also provide programming languages (C#, VB and Python) so there is quite no limitation. So the answer to your question is yes.
But for putting windows, doors on the walls, antenna on the roof you will need models, algorithms. Grasshopper is useless without that. it is also important to include the level of detail you want.

So lets begin
What are the type of polysurface you have ? (post some examples)
Have you an idea of how many windows you want ? 1 of 1 m every 2 meter. One floor each 2.5 m to 3 m … How will you do that if you had to do it by hand or with Rhinoceros ?

No magic :mage:

Hi, firstly thank you for your respond. I have extrusions as buildings volume and i dont need to much detail. Normally i would do that by hand(i attached 1 that i did by hand in rhinoceros) But there is too much extrusions as building volumes which makes almost impossible to do it by hand.
So as a windows, there should be only engravings.

Here a script, not sure it will work with your data as you didn’t provide.


This script select vertical faces, then if they are big enough subdivide then. It also flip some surfaces if U or V not correctly OK. It needs intrallattice but you could swap U and V if needed.
Place of windows is done using Graph Mapper.

For me it could be simpler to make it in C# with meshes.
windows on brep.gh (26.8 KB)

Hey, i didnt expect that much complicated script, thank you very much for that:) I could not upload the file because its around 450 mb, i tried the script with one brep and it generete another brep with the holes but the brep become strange as in the atteched pictures.

It is not useful to have all the geometries, but some could be useful as there are some differences between brep, extrusion … You can’t acess the normal the same way etc… Whatever it seem to work with your file.

The strange looking it is because you have 2 geometries one in Rhino and one in Grasshopper.
You’ll have to “bake” grasshopper geometry in a new layer and hide input geometry. Just some basic of how Grasshopper work.

oh yes sorry i didnt do the bake. One more question, when i bake the geometry there are too many indivudual surfaces rather then a polysurface, i could joint them to a single polysurface but can we do that automatically too?

Yes you can it is named Brep Join but all surface must be on the same branch ! The more simple is to flatten data. Right click on the input. You will see the options.

It is also possible to make the same thing with others strategies. If you building are solid it could be possible to do boolean difference, or to split the faces …

Okay, thank you very much!