Grasshopper pitched roof file not working on site of boxes

grasshopper
unhandled

(Tala) #1

Hi , I am new to grasshopper and I have a rhino file of a site full of houses that are now in the shape of boxes. How do i apply a simple pitched roof to all of the boxes.

I have this grasshopper file but its not working on my geometry.

Thank you!

roof.gh (14.2 KB)

site|690x343


#2

missing


(Tala) #3

Thank you for replying !
I think there is something weird in the site file’s geometry
when i draw a box in rhino and apply the grasshopper geometry to it , it works.
however when i apply it to the geometry in my site file, it doesn’t.
In the screenshot , the box on the left is a box i drew in rhino and applied grasshopper geometry
the box on the right is a box i copied and pasted from the site file .

.

roof.3dm (252.9 KB)


#4

The problem is that you assumed the top of the box will always be at index position 5 (last) in the list of faces from Explode (AKA DeBrep or Deconstruct Brep). That’s not always the case. The solution is to sort the surfaces by the ‘Z’ value of their center points; Area C (Centroid) or, as I’ve done here in the white group, DiscAvr (which is faster but will fail if the surface isn’t a rectangle or regular polygon).


roof_2018Feb4a.gh (28.6 KB)

Geometry is internalized in this GH file, no need for the Rhino file.


#5

Oops, there appears to be a problem (older version?) copying the Geo works geometry parameter. Replaced in this copy with GH Version 0.9.0076 Geo parameter.

roof_2018Feb4b.gh (44.1 KB)


(Terrapetros) #6

Joseph,
i am new to grasshopper and i am having a problem by baking the final roof geometry. When i bake it, only a flat surface is generated over my geometry.


(Laurent Delrieu) #7

It all depend were you click for baking. You must click on components that output the roof geometry. Change the preview geometry to selected object only green button icon on top right and seek for the roofs


(Terrapetros) #8

Still not working but thanks for the atention… which would be the components ?


#9

The grasshopper definition creates Invalid breps (I don’t know why, haven’t looked into it properly). You cannot bake invalid breps.


(Laurent Delrieu) #10

Here a script with my script, it bakes without problem.


roof_2018Feb4b LD.gh (56.7 KB)
If you want color bake the preview, bake with the mouse over the icon of preview component. On G it bakes without color.
Also like Siemen showed, it is always good to see the output information and to post a script.


(Terrapetros) #11

Finally! Thank you so much!!!