I am building a set of Grasshopper definitions to be able to generate simple Building elevations from their footprints.
Currently I got a base setup.
I am trying to make a glass wall with recess areas. Basically I divide curves and then create a perpendicular lines.
But for some reason it does not work on curves and circles ? What I am doing wrong?
I haven’t tried to fully debug/optimize your code but after messing around a little, I found that setting the ‘W’ (Wrap) input to Cull Index to false (inverting the default), alignment was as expected:
P.S. This (below) might not be exactly what you want, but it’s easier to understand? And modify if necessary. The purple group is a different way to align the planes. Shift List with ‘W’ (Wrap) set to false ignores the first plane, as I think you were doing before? You can connect it to Partition instead of PRot.
I used Partition and Prune Tree to handle that problem.
Irrelevant code has been removed and curves are internalized, no need for Rhino file:
It’s tricky… Inputs (besides the perimeter curves) are:
‘MinGap’ (minimum space between balconies)
‘Max’ (maximum number of windows expected on any side)
Two Evaluate functions are used to calculate the “gap” for each edge. It sorta fails (not really) on the circle, since the gap at the seam is twice as wide as the gap between balconies, but otherwise looks pretty good.
Thank you it is amazing. It will keep me going for a while and I will post the final thing.
It just recentlyI spent a week modelling almost identical buildings in SketchUp manually.
And I thought I can just create a family of building types so I can use only a footprint to build a massing with simple elevation.
For glass I thought to use three offset planes each of them will have different texture:
Mullions and transoms .png (with alpha)
Glass .png (with alpha)
Office, Residential or Retail interior image.
Is there a way to assign and map textures to surfaces in Grasshopper. So when baked they have a material applied?
I’m sure there are many ways, perhaps more in R6 than R5. The only method I’ve used is to assign a different material to each layer and bake my geometry accordingly. I cobbled together two Python components from bits found here and there, probably far from optimal but they worked well for me.
bake has inputs for ‘geo’ (geometry), ‘layer’ (name of layer with “::” between sublayers) and ‘active’ which triggers it.
DelAll uses the same layer names to delete all geometry on those layers.
This is an extract from a much larger model with many layers. It was quite fascinating to delete and bake all the modified geometry in a complex model and have materials assigned, ready for rendering. The Rhino file is optional since the named layers will be created if they don’t already exist. But of course, the point is to preserve the material assignments by layer.
Data trees are curious things. They require constant attention when building a model. I do this by examining the output of every component along the way, usually with text panels and when necessary (frequently!), using the ‘vuTreeList’ tool I referred you to earlier.
I looked at your code/geometry in your original post in this thread but haven’t looked at any other versions because it’s too much work. The answers below use the simplified model I posted yesterday.
First, this yellow group numbers the perimeter curves. They are the basis for all the data trees that appear along the way, so keep these numbers in mind:
Shatter uses the same segments from Explode and the ‘t’ (lower case) values from Evaluate Length to split the perimeter curve edges at the “balcony” locations, then Cull Pattern gets every other piece, effectively ignoring the parts where the balconies are located.
The first Join Curves component combines the short Line SDL bits and the line that connects them. Nothing tricky about that but notice that ‘Simplify’ is used on its output. In fact, ‘Simplify’ is used three times in this cyan group, none of them arbitrary, all are required to get the downstream data trees re-aligned. This is very important to understand. Use text panels and toggle ‘Simplify’ to understand why.
The purple group at the bottom generates 14 random integers (one for each perimeter curve) representing the number of floors for each building. But as you might guess, this presents a different problem due to the fact that curves 0, 11 and 12 aren’t separate buildings at all but intended to be “holes” in their surrounding curves (13, 4 and 9 respectively). I didn’t try to solve that problem.
Then using the edges of those surfaces instead, no other changes! So very close to perfect except for “building #10”, whose inner “hole” edges are too short for any balconies so the model fails to handle it properly. I wonder why…?