Complete Stair Generation Workflow in Grasshopper 3D | 7fold Modeling

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone this is Tim Halverson with sevenfold and in this episode we're gonna be looking at how you can make a stayer generator and on screen you can see that we've got this staircase that was made only using a curve this curve here which is completely customizable in Rhino you can you can move it you can flex it you can just use a few control points to change that and then the other thing that's exciting is what it's all based on is this one tread right here and so basically you can model a single tread you can model a curve and and then you can set the height of what this is gonna be the floor to floor height and you can also set the tread depth the riser height and and then from there we're gonna do a separate one that deals with some of these gaps that come in here where you need but essentially this is going to give you a really quick and dirty way to have design intent and get something looking like this they're a big thing that we're gonna be looking at is how to use the relative item component you may not know exactly what that is but if you are familiar with grasshopper at all we're gonna be covering how to use the relative item and and then have this by the end of it so without further ado let's go ahead and dive in so once you go ahead and start up the brand-new Rhino now the first thing I want to do is two things I want to start with drawing my curve and basically you could just kind of start to draw any curve you want this is gonna be what drives the the path of your stair and I'm just trying that in plan and I'm basically thinking this is gonna be the floor that I'm starting on and then I'm sweeping up to be a floor let's set some heights what I want to do next is go into grasshopper but first let's go ahead and build up our tread so I'm gonna use the rectangle corner corner X let's do let's just do the box and I'm gonna use a three-point box and turn on grid stop for a second so let's snaps to the grid here I'm gonna click once I'm gonna type in 12 let's see 12 inches there we go and I'm not I'm gonna do 48 inches wide and let's just do 1 inch deep and we'll flip on to architect color just so I can see a little better okay cool so now this is a pretty basic stair tread now the best part is that both of these are modeled at Rhino so I can change either of them and that's gonna allow me to change it later so the goal is to basically map this tread along the curve at different heights and have it oriented to the curve as well so go ahead and type grasshopper hit the spacebar to launch that you'll probably see me double click from time to time to open this up so the first thing I want to do is grab the beer up container component click that right click and say set one beer up click my new tread the next thing I want to do is grab my curve container and I'm a reference by right-clicking set one curve click that curve and if we hide those you can see that it's it's showing up in grasshopper the first step we want to do is break down our tread so that we can get the shortest edge and from the source edge we're going to use that as the distance to divide up our curve okay so first thing I want is to go to surface go to the deconstruct beer up and plug in my surface here the next thing I've got my faces edges and vertices I want to get the centroid so I'll just type in area by double-clicking i plug my faces into that geometry it's going to give me the midpoint of each of these surfaces and then I just want to get the topmost surface so I want to sort all these points and get the one that's towards the top so if I go to the vector and go to plane and then go to plane coordinates this asks for a coordinate system and points and so by default if I hover it says world XY I like to be able to read that later so I'm just gonna type in XY to get the world XY plane that's gonna give me a representation here of the world XY and we plug that into the coordinate system and then plug on my center points into the points there the next thing I want to do is type in SOR sort to sort list and I'm gonna use the Z value to be the key so that K is for key and what I want to sort is actually my faces okay so this basically measures how Z so up and down from relative to the coordinate system that's been put in which is the world X Y and it's gonna sort against that I think this is a pretty important top let me just diagram that quick for two seconds so basically this guy here you get a plane in that plane you've got Z you've got X and you've got why I don't know if that's visible Z up this way is y to the right is X and what we're doing is we're basically plugging in these points that come in right there and each of these points is coming in through my center point to here and that's each of these points here okay actually it's not the edges there so if I just hide hide that okay and then we're grabbing all these points here on the center and then it's measuring each of those points by the Z so the Z there so as it's gonna see okay relative to this coordinate system this one is going to be the highest because I know it's at the topmost face and each of these points are going to be lower than it so if I look at that in elevation the the midpoints of the other faces are below that and then the highest face is going to be here on the top face so that's what I'm sorting - I'm gonna grab that point and be sure that I always get the top face okay and that's that's basically what the list sort list component is it's going to say sort using the keys by the Z and then what am i sorting is in is an eight and that's going to be my faces here so that's what's going on okay so to get the topmost face I'm going to do list item which should be by default the zero most index which is default item here so plug that in and if I look at the keys by doing quotes enter keys you can see there's the keys one is zero distance away from that coordinate system that's the highest point that's actually the one I want which happens to sort to the very end so all I have to do is reverse this list by right-clicking reverse the list now if I select it's got that topmost face perfect so I'm just going to select all this and hide that and delete that okay so now I've got just the top face to work with at the moment and I want to break this down as well so we're gonna reuse that component go to surface deconstruct beer up plug in that surface it's going to give me a faces edges and vertices we're gonna go ahead we're going to get the one closest to the curve so I want the one that's closest to this curve so I'm gonna do evaluate curve so type in EVE Evie a you've got a weight curve right click on the C three parameter eyes that and then plug in the edges to curves and then we're just going to do a panel by doing quotes 0.5 to do 50% and plug that in the T by r ii parameter izing it it makes no matter what the length of the curve is it makes it a percentage from 0 to 1 so 0.5 for that now and I'm doing that here on these edges here now I'm going to do CP to get a curve closest point right there and then I'm gonna plug in the points whoops undo ctrl Z points to point to the P and then the curve I want to put in is actually my curve over here okay and I'm also going to reprioritize that at the moment so you can see it's put these points on here and it's basically pulled all these over I'm assuming that I've modeled it on the shortest side for argument's sake let's just go with that okay so now we want to sort by the distance so I'm gonna sort tree again plug this D for distance that's health that's how far it had to travel between here and there so that's going to be my sorting key and I'm going to put in my edges to what I want to sort I'm gonna do that same move by typing an item and this time I want the closest one so if I grab that you can see what's highlighted in green is is the edge there okay so you can kind of see it right there okay so now why did I get that well I want to know how long that is so by typing in length to get the curve length I now know how far I want to set my my treads okay so what we're gonna do now is start to work with the curve this curve here so the first thing I want to do is do divide distance so by typing in Div divide distance plugging in that curve and then the distance we could plug in any number however I wanted to derive that number base off of the length of my input be rep so that's why we broke down B rep so plugging that in now you can see this division is gonna be based off of that tread so now if I just type a show bring back my tread if I wanted to change that that's gonna increase the distance that it's it's dividing up my curve cool so now I want to start mapping my tread to these different points but the first thing I want to do is actually figure out how high I want to go so I'm gonna put in a slider that goes one point zero zero less than what do you want to do let's do 12 feet which is our floor to floor height and I'll put up 20 just in case I'm going to change my mind and right-click call this a floor to floor height and in parentheses I like to put feet just so I know what units I'm dealing with then we're gonna go ahead and we're gonna start lofting these points up to that height so if I just did a simple move command my typing move and then if I double-click and type Z to go in the Z direction and just simply moved all these points up it's gonna put them up here okay but I want to do just the number of treads that I need to go up 15 feet are actually 12 feet in this case I only want as many treads is required to get up to 12 feet along this curve so I don't need all these and the other thing is I need each of them to step at a certain increment which is gonna be my riser height okay so how do we get there let's go ahead and create a new slider we're gonna go let's do something logical actually I'm gonna change my units just for ease so I'm gonna go to options I'm going to go to my units I'm gonna change it from feet to inches and okay and I'm gonna accept yes to scale things cool and so now this actually is instead of feet this unit is going to be in inches but I'm gonna I'm gonna go ahead and just multiply that by 12 so let's just do a little star symbol for multiplication and I'm gonna type print the seas 12 enter multiply it up by 12 and now that's converted to feet okay so next thing I want to do is I'm gonna do another slider I'm gonna go one and if you're real smart you can look up the international building code by saying 4 because you can have a riser no less than 4 inches less than 7 actually let's do less than 6 less than 7.0 that gives me extra decimal and I'm going to call this riser height inches those are healthy constraints because that's a building code you can't go more than seven so don't build higher treads than you're allowed and then I'm gonna repeat that for the tread so I'm gonna go well let's go just do one less than twelve less than thirty six why not and I'm not sure if let me use that actually but tread depth in inches okay so to get the riser height we want to divide our floor to floor height by our riser height and the result is going to be twenty point five so I need at least twenty risers at seven inches now if I go down to six it's gonna go up to 24 it's a nice even number but let's just do seven because then I'll show you how to do with the fraction okay just for argument's sake so twenty and we're gonna go ahead and do round round factor if you don't have this component if I hold ctrl alt click this is puffer fish and it's a really useful component set how they recommend it go get pro for fish if you don't already and this is the round factor component so I'm gonna plug in so I'm gonna plug in this I'm going to say panel with quotes one rather the nearest one plugging that in it gives me twenty one but then if I go to the type and right click and set that you see if you hover it says zeros nearest one is floor two is ceiling I want the floor so I'm going to do set that to one it gives me twenty instead of twenty one and then it also gives me the difference which is that fraction that came out now if I just simply do a multiplication and do that by 12 as well I can just click drag and hold alt to create a copy plugging that in plugging in the difference it's gonna give me six point eight inches and if I want to be fancy I can deal with that we're just gonna leave it as a weird fraction I could round that again and this time I could round it to the nearest eighth like 0.125 but we'll get into constructibility in rounding later I just want to get this as quickly as done as possible so six point seven five all right so let's just keep it a weird fraction cool moving on this always takes longer to explain then you won't - all right so next we want to do a series and the series has a start of zero step of one and a count of ten I want my actual step to be my riser height that's gonna be this guy I want to start at the first height so not zero but I wanted to start at seven so my first riser height and then the count is gonna be this number of risers right here so we're gonna do that the result is gonna be pull panel and plug that in a whole bunch of different inches so there's 20 items starting at the 0th index or 20 items and each one is gonna move at a different increment so if I just simply take thought and plug it into the Z boom now we need to tweak this a little bit because we've got only so many points and we want to get rid of the ones we don't need plus we also want to get our fraction in there too so we want to insert item so type in insert items the item that we want to insert is the difference which is this D we want to insert that at the end so if I do item index or let's do last index right there and I want the last index of my series which is going to be 19 I want to right click and make that plus 1 so let's do X plus 1 to make that 20 and I'm going to insert that at the end and we're gonna insert that into this list of our series so it's going at the end here now one more thing we have to add this fraction to the end to the last number in the series so how do we get there well we can repeat that list item we can get rid of the expression and then we can do an item index list item grab the series plug that in the list do the last item like last index plug that into the index that's gonna give us our 140 which is the last item and then I can just do a plus for addition and add my difference and now we're gonna have 140 0.57 and that's gonna be add it in and that's gonna be letting we add boom so there we go so now when we take these guys put them in it's going to give us that that last little fraction of a step okay cool so now what we want to do is we only want the number of points to move as the number of steps we need so how do we get there well we want to do shortest lists so typing in choice list it's going to compare the two incoming lists and take the shortest of the two so I'm gonna take all these vectors we made put that into B but on my points but an a and you can see we keep our 20 vectors but we also chopped down our point list to be 21 items as well so putting in a 2 points putting in B 2 vectors now we only have the number of risers we need ok next we're gonna build a plane and basically we're going to do is eventually we're going to get to this command the orient command and that's gonna help us map this tread on to all of our riser points before we go any further I just want to make sure that we get get this all grafted appropriately so what I want to do now is type in graft get all of our newly moved points into their own branch right there and now you can see this is the branch it's a little complicated so I'm going to right click on that and simplify and now we've just got a nice clean set of branches ok now how do we get our geometry up onto these points we want to build a plane so let's let's just browse there go to the vectors go to construct plane excuse me plug our points into the origin and this is going to give us a default the X&Y or to the global direction but we would want them to be tangent to the curve that we were inputting all right so how do we get that well the way I've solved this is using the relative item component so if I use relative item by typing in our TL what this does is if I put in the points its assets to the tree here right so this has to have branches and let me try to explain this let's use the sketcher okay so okay so this is an incoming set of branches and each of these is our branch now right now they're all the zero index because there's only one item in each branch now when I use the offset here there's a syntax which is the curly braces which is that guy and you can do plus or minus I'm just going to do plus 1 and then curly braces to close that now if this was a more complicated branch structure like if it was you know something like this zero semicolon 0 and then brackets what you'd have to do is you'd actually have to go to the you'd have to go to the the item in the branch that you want to target so in that case I will go 0 comma 0 sorry : plus 1 and that would be what I type in ok so so if I do that do a quotes for a panel semicolon plus 1 semicolon enter it's going to be a panel with the semicolon plus 1 and we'll plug that into the offset these are wrapping W sub P is we're not wrapping by defaults and so once that means once I get to the end of this list it's not going to grab additional items after that okay and then let me hide this so in the a is the original branch and B is the offset branch so if I merge these and do a P line polyline not too exciting at the moment but what I want to do is actually do a renew our construct clean and I'm gonna do it we've already got that here so I'm going to do is project and I'm going to project the relative point above it down to the plane below it I don't know if that made sense but we're trying to make this work so what is that doing if I take my newly projected point and plug that into the B that's actually grouping it you can see here it's grouping it on its own branch so when I've got each of these branches plugging into my polyline that's giving me those two points so it's taking this point from up here projecting it down under that plate so this point this point I went and grabbed this plane here and projected it down to there and then and then built a polyline between the two okay and because they're each on their own branch I was able to do that across the entire system in one and one go okay this gives us a lot of flexibility and this is probably most powerful thing of this whole tutorial okay so what do we do now with all of that powwow we want to create a vector between these two points so this is visualizing it I want to do two points so it's typing in two point vector and instead of creating a polyline I just want to do a into a and the projected point into B if I want to visualize that I can type VD for vector display anchor that on a put the vector in and you can see that's the vector we want right there okay so now if we do different way this is better I'm gonna deconstruct plain which is the plains that we made and that's these first ones this is gonna have my XY and Z vectors from the plains we already have made I want the the vector here for y so we're gonna go angle type angle this is gonna ask for two vectors so I want my first vector to be my Y and then my second vector to be this newly formed vector and if I check that the angle is that it's in radians by default so if I just right click and do degrees type degrees convert my radians into degrees it has a series of different rotations we're gonna do and now if I just do rotate we're gonna take the planes and we are gonna rotate them now right click and turn convert that to degrees so right click degrees and angle is our newly converted degrees there and the point the plane we're doing that on is the original plane not the world XY boom so now you can kind of see and it went the wrong way so we just need to flip that let's just do negative x boom so I went from this Y to that Y right there and now everything is kosher okay this is not the right use of kosher I'm sorry so I'm just gonna hide some of this to reduce the confusion okay so now we have our oriented planes we can check it if we want they're all in the right direction which is beautiful and now we want to get our tread up on to those planes so the geometry and we're putting in is going to be our tread here to the G by default it's the world X Y I could also put that in to be explicit to be the world X Y it's assuming you model it right in the X Y you could also grab one of these points or even better you could click you could make a new plane container and just do right click and say set one plane and then this will give you a tooltip in Rhino and I can click once to set the X another to set the Y and now that is set that's going to be the plane a that's pulling from and then playing B is gonna be these ones we just made well okay so now we got a staircase and you can see right there it's also adding that additional partial step now if you wanted to watch this if I wanted to be fancy because my orientation plane is there I could grab this edge by ctrl shift clicking and I could pull that out a little bit start to work with it and you know we could we could you know work with it I could also add additional information like a line in Rhino and I could say go from the world XY to this point here so that this is the nosing and we could input that as a curve and then putting that in as the curve length to set the tread depth that's going to keep these tighter and it's gonna allow us to have a bit of a nosing alright so you could also scale 1d I'm just gonna work with that it's gonna reduce your tread depth but and increase that nosing overlap likewise you could test to see if this is working for you you could reduce the riser height to like 6 and that should all just update we could also test the curve that we're working with and bring that down so this is the fun part right where you get to get to kind of explore what you want to do with your design and I will leave it to your discretion on how beautiful or unbeautiful you want to make that all right so it's up to you now the final thing I was gonna do I realize they're getting along on time but let's show how to actually connect the railings in there that was in our key piece of the geometry made so if you remember we have we have this custom tread that was basically made by working with that original base geometry down here and like we showed here you could control shift click go to see planes and set that's object or just do you see see playing by three points and then I basically just model the curve on here and disable grits out little plane wing and I'm just gonna pull that out and then type extrude curved and extrude that curve all the way through I'm gonna select my tread type split select the cutting object which is my new extrusion hit enter and then I'm gonna control click to keep the part I want whoops just delete that and then I'm gonna take the extrusion type split and then select cutting objects which is my poly surface are just made and I want to control click to keep the part I want and I have a shortcut for ctrl Q to delete and now we've got our new tread I'm gonna select both those holding shift and then join join those so now I've got a new poly surface you can see didn't update up automatically because that made a new beer up so I just have to right click on my container set that again and we are good to go and so now you can see that geometry has updated to be that kind of reverse plane wing tread which might be a little dangerous so I would highly recommend making that a little smoother but that's what you do and all right so final thing we're gonna do is build the railing so now that we've got this point data how do we get the actual railings in there so let's go back to the end of our canvas here and let's just add a quick note and call that treads alright so if we just type in line take our original point and to tie that to the projected points it's gonna give us our our point here and then what we did what we're gonna do is we're gonna evaluate that so if you by the weight curve and right click and Reaper Amma tries and then we're gonna also going to just give ourselves a slider so zero point zero zero less than one plug that in the T and then you can see it's gonna give me a sliding point along that rail we just made that's gonna be where we put our railing and now I'm gonna move let's go move in the Z direction so type Z and by how much let's give ourselves another slider one let's actually go negative negative six less than 36 less than 42 so that's gonna give me a slider starting at 36 and plugging in my point to that you can see that's gonna move these points vertically if I just do a line now to my newly formed points you can see that's starting to get the railings I want so now if we also move the bottom point by selecting these click click alt to copy and then we're gonna bring that down to let's do the negative and then I'm gonna use that as my base point now you can see that railing is sweeping along there and finally we wanted to create one more line that to get to get that kind of a stepping effect you can see here we've got that they kind of bevel going on we're just going to create one more of these and we're gonna reduce that line down here and set the top point to create another line and now we're gonna also reuse that relative item so if I just come back here select this control click drag hit alt make a copy and then I'm gonna grab the newly shortened one and plug that into the tree now let's just double check to make sure our branches is correct so if we double click do quotes for a panel okay so we still have a pretty basic structure so this will work well so now if I do a merge and I take the be put that into the merge here and then we'll plug this one in there it's gonna basically create one of these and then the one in front of it and put those on the same branch so now if I loft typing in loft it's gonna create a seamless sweep down here and then it's got that flexible height up here so you can see that shifting and this since there is in the same point is gonna be always tied together cool so now the the final step on that one well add more detail as we go we can see there's kind of an inset to create that panel so if you wanted to turn those into frames what I like to do is go up to surface and beer up edges kind of unpack that newly formed surface and then I'm going to join those curves typing J and we want the negative edges it should just be four yep so just four per wrench and that's formed a single polyline curve if it's orange don't worry it's probably something at the bottom where as empty that's fine if you're concerned feel free to just run a clean tree and remove empties there you go and we'd actually we should run that over here so run the running that on the left before we get this in okay and then want to do a quick offset so offset keV plug that in plug that in right there and this is always kind of quirky so there's some some places where it's going the wrong direction the way to solve that is to set a plane and this P here so we will evaluate the surface to get the plane of our newly formed lofts and put that into the s and then we'll just double click and get an MD slider this is gonna evaluate that surface at 50% 50% and just right click to Reaper em tries to make sure it's in the middle now if we take the F I mean there's a million ways to say plane but the frames which is a plane put that into the plane you can see now they're all consistently going in the wrong direction but at least they're consistent so all we have to do to flip that is just right click on the D type expression negative X let it flip it and then we can actually type in a distance so I'll do 0 less than 0.5 less than 2 and so now if I use that slider that's going to increase how far we inset and now if way if I just do can actually just browse to it just do a boundary surface putting those edges it's gonna give me a new surface on that newly formed in panel okay cool we're almost there how do we get the railing now well we just want to grab those points that we've moved up earlier so that would be these guys these points here and they're all currently on their own branch but we want to get them to all sweep together so to do that we just flatten flat flatten the tree and then we want to do let's just do the curve here and this interpolate curve plug all those points into the v4 vertices okay so I found out was if I used polyline curve instead of interpolated curve that would help fix it because run time warning says zero length segments were collapsed to create a valid polyline so that means there's a couple points in there where it was redundant that gives me a valid pile on curve I'm gonna do that also for the moved points you know we've got our piling up there and now to get some geometry we want to let's just pipe it so pipe and put a curve and the radius we can do flat or rounded caps do flat and I'll set the radius to be 0 let's do point 5 so it's going to give me a one inch diameter and there you go so if I want to repeat that I could just copy that by dragging alts plugging the other poly surface Polly curve and you know you can play with it dragging different radiuses changing their size I'll let you work with that now finally trying to get this all out easy enough to just right click and bake I'm also a big fan of using Ella front so if you just if you don't have this Ella front component I recommend it just over here on bake and then I'm gonna build up the geometry and the attributes basically all you need is Ella front edge buttes you're gonna need a layer to put it on and if I just grab one of these ones like layer over 3 I can just type that in to the name if I don't specify a color it uses default plugging that into sorry define object attributes not this one I'm gonna put in layer right here I'm gonna plug in those layer those attributes here and then I'm just gonna merge all of this into a single a single bake operation so we've got those panels and then we want our treads as well cool and then I just type in a button bu and change that to plug that in change the wire display to hidden then you can move that to the front if you want this is where I like to put my stuff and if you bake that it all bakes in one go and there you have it a parametric staircase in grasshopper obviously you can start to change the riser height the tread depth and the next one works you're gonna get into what happens when you go around the corner here and you actually need to get something that I can deal with those wider depths of the tread on this side but still keep the minimum on this side so we'll get into that fabrication stuff later but hopefully you learned something in this one [Music] yeah [Music] [Applause] [Music]
Info
Channel: 7fold Design Technology
Views: 802
Rating: undefined out of 5
Keywords: Grasshopper, Grasshopper3d, Rhino3d, Rhino, Grasshopper Tutorial, grasshopper 3d, architecture, parametric design, computational design, architecture student, parametric architecture, parametric modeling, custom architecture design, custom stair creation, custom rhino modeling, custom stair design, data management
Id: qSY2aPK2X9Q
Channel Id: undefined
Length: 50min 9sec (3009 seconds)
Published: Mon Feb 10 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.