Grasshopper Roof Truss Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi in this example in this video I'm going to show how to regenerate the example film from week three earlier this week and I had had the feeling that many of you for many of you was probably a bit too fast so we'll show it again and we'll go through this step by step and we'll set this up using the color template that we went through today and in the class so I'm actually going to start with a new file from scratch so here you can see this is my file I just set up the template putting in my name and the name of the file etc and I also set up my instructions and I would recommend that when you at home go to recreate this tutorial once more to practice it that you just copy and paste these instructions and then start from scratch so basically the goal of this tutorial is is to create a surface in Rhino from sorry in grasshopper from three curves that we will loved through in Rhino then we will use the subdivision command here and we'll subdivide it into a into a two-dimensional domain so that means this every Services has item a 2d domain so we have the U direction and the V direction and we can specify how many subdivisions we want in the U direction and how many subdivisions we want to have in the in the V direction so if this were to be set to 20 by 20 that would result of course in 400 surfaces but it also slows down the computer so I'm gonna set this to a smaller number so once we have created all of our you know in this case 200 sub surfaces these ones are called sub surfaces we will then find the centroid of every surface which will provide us with a list of 200 points and then at every of these centroids so you can see again every of these green points here which is the set point of the four-point surface we're going to find out the surface normal which is we're going to find out the direction of the surface at that point so in order to do this we're going to use this component here which is called evaluate surface and it will return as a vector a normal vector at that particular point and then we're going to create we're going to multiply that vector by a certain amplitude which is a variable here which will then allow us to copy the centroid to the end of that vector so basically removing the point from here to here using the Move command and lastly we're simply going to extract the four corner points of every surface and we're going to connect them to that one centroid here so here we're taking in our all of our sub surfaces we're exploding it so that we're finding four points each and then this would and that will connect those four points to that end point here that we just created and this gives us this kind of pyramids and and lastly we'll show a couple of examples of creating very simp simple analysis so in this case we're using the area value of every surface and we're going that to color code the surfaces so the larger surfaces in this example are blue and the smaller ones are wrapped okay so all that this is these are the instructions and we'll start off from scratch so again our first step is to create a base surface by lofting curves curves from Rhyno so we'll start using the Rhino input color so right click here make color default and I'll create a curve parameter right click on it set multiple curves and I select three curves from Rhino or however many you have and click enter so now I have in here three curves and now I'm going to group this and it's going to group it in the same color that we just selected and I call this pi H underscore for Rhino input for example loft curves so the next step is to create a lofted surface love that any any surface commands are always on the surface tab in Rhino in grasshopper so I'm going over to the surface tab and in here and the freeform we can find a enough surface so it's not just a primitive surface is actually a free-form circles so this component has two inputs I put my mouse over and it says it's asking for section curves and then it's also asking for loft options so I can ignore this loft options I'm just gonna put in my section curves and there you go it creates a lofted surface actually if I put my mouse over the output here it looks as if it's creating a be wrap a boundary representation which which looks like this component here right burek but in fact if I put my mouse over you can see it's in fact creating an Antrim surface but just to be sure so so the next component that we're going to use the subdivision the subdivide surface component only works with surfaces so in this case I can actually use the surface placeholder to convert the beer app into a real surface and again it just says I'm from surface so it's really not a beer rapid and hundred surface that comes out of the loft command here so now that I have my novel surface I'm actually going to start labeling this a bit I shall I'll label in a minute so now that I have my lofted surface the next step that I want to do is I want to subdivide it so I'm going to the surface command and in utility we have something called ISO trim which will give us subsets or subdivisions of a surface so it has two inputs and you can already see in the preview this is basically what we want we have kind of our larger surface and we just want to create these smaller surface elements so of course it's asking us for a surface as an input and it's also asking us for a domain squared for 2d domain so here's our surface and now we have to set up a two dimensional domain the reason why we need to set up a truly domain is that every surface as I mentioned previously has two directions it has a u direction and the V direction so we want to tell it how many subdivisions we want to have in the U direction and how many subdivisions we want to have in the V Direction that's what we can do with a 2d domain so the domains all and and I will actually at this point I've actually highlight if if this sounds completely strange to you there's actually a pretty good tutorial that I that I just found online which I will send out the the the link to and it's on deep process that org slash grasshopper tutorial on surfaces and it deals with domains and parameters and ISO curves so I highly recommend you watch this tutorial if you're brand new to grasshopper and and don't understand the idea of surface domains yet so this is a 30 minute tutorial but anyway now that kind of assuming that you have watched that so we will set up a 2d domain domains can be found under the math tab all the way in the front here and basically what we're doing is we're going to take the surface which by default has a domain and we're simply going to divide it into you know several use and several V's so I can grass over smart enough to convert a surface into a domain as an example and I'm just going to show a really quick example here where I will create a curve in Rhino actually I'm just gonna I'm just gonna take these curves here and I will show you that a curve also has a something called a domain but of course it's only one directional so let's just hide this for now if you're not interested you can just skip forward by a minute or so but so here we have our three curves and what I can do is I can analyze the curve and I can evaluate the curve so basically it's asking me for parameter on the curve domain to evaluate so I can put in my curves and I can put in a variable let me just set up started to go from zero to and now to 210 for example so here the slider and and as you can see now I can I could add at the main point zero where all the way at the front of the curve makes you gonna extend the side of it if you go up to 650 and now we're at the main point twenty thirty and then eventually towards 50 so this so the size of this these curves is about you know 55 55 and 75 or so so that's the that's the domain now the surface domain goes from zero to sixty four in one direction and from zero to 62 in the other direction again I can show that by simply converting browser was very good at converting things I can simply convert a curve into a domain for example and this will show me from where to where the curve ranges and I can also convert of course a surface into a 2d domain so so here it shows that for the surface the you domain goes from 0 to 64 and the V domain goes from 0 to 62 all right so now like I said this is going to be the input for our domain that we want to subdivide further and and what this does U and V by default are set to 10 that means it's going to create 10 by 10 subdivisions which means it's going to create a hundred values and you can see actually I will I will show you one more trick since these curves come from Rhyno this the domains are kind of unknown they're basically just based on the curve lengths if I were to measure the length of the curve measure the lengths of the curve I'm pretty sure 58 56 64 actually it's not quite the same so I never really quite know where this domain comes from but what you can do in Rhino as you can Reaper ammeter is a curve that means that the domain always goes from 0 to 1 so if I right click on this and Reaper ammeter eyes it my domain goes from 0 to 1 of course this is far too large now so now if I were to create a new style to go from 0 to 1 you know zeros at the start point and 1 is at the end point so now now this is a bit better we will do the same for the surface actually we're going to reproduce the surface which means the domain of this the 2d domain of the surface now goes from 0 to 1 here's the proof so with that if we were to create a 10 by 10 division the first subset of the curve goes of the surface this is the surface we're talking about goes from zero to zero point one and from zero to zero point one so let's say if this is our staff corner it goes ten percent in this direction and ten percent in this direction and this would be our first field etcetera etcetera so now we've created kind of hundred values two main values and we're going to use those to subdivide the surface and if I preview this component you will kind of see the subdivision edges it's important in grasshopper to always improve you pretty much everything except for the component you're working on because it just gets pretty confusing otherwise so you see now I'm actually going to set up a set of two sliders which about to want to be variable input status for the U and V domain so let's just say I want to have one that goes from five to twenty she both of them I'm just gonna copy and paste this I'm gonna call this num panels you and nine panels V okay so these are my inputs as well put that in here all right so so now that I have my sub surfaces I mean all this really creates is just as you can see if I set this back to ten by ten it simply creates a hundred untrimmed surfaces so it presents really small services now for each of these services if I go back to my instructions I'm going to find the centroid of each of these sub surfaces so under the surface analysis tab there's a area component and the area will find not just the surface area but it will also find the centroid so there we go and next I'm interested to find out the normal direction at that centroid so I'm going to there's actually another kind of trick that we have to use here for we can evaluate a surface and so we evaluate the surface it's going to ask us for the UV coordinate so let me just find you an example again before we before we start using this so this is my surface here and I'm going to create a point that has two dimensions the the Z dimension is going to be 0 and the X in the Y dimension are going to be between 0 & 1 so here we have a point which of course sits now it's in a very close to our region but I can't turn this into a UV coordinate simply by connecting this T so let me just show you what this looks like so the point has the coordinates 0.25 0.25 and 0 and I can put that onto my surface which I reaper ammeter eyes previously and what that will create is let me just preview the surface again on that surface at 0 0 we're all the way in the bottom left corner this is now in the direction of the Y direction of the V direction of the surface and this is the X direction of the surface so at 0.5 0.5 for example would be exactly the center of the surface etc so you get the idea so this is kind of this is how we can describe a UV coordinate of the surface so now there's two ways of finding this the first way would be we could simply just set up a point that just called zero point 5 comma zero point 5 comma zero or I could set my status to 0.5 and I could put that here and I could input my services in here how interesting this doesn't work so instead instead of doing it this way I would have thought that it does it for every surface I may have to begin Reaper a meters every surface yes so in order to do to do it for every single surface I actually have to Reaper ammeter eyes them again because otherwise they keep the domain of the original surface but instead of doing this what I will do is I will take the centroid and I will find the closest point of the centroid on that surface so surface closest point surface CP and what the surface closest point so again this is much these are my services these are my points which should exactly be exactly the same location but what it gives us is it gives us a UV point on that surface and that UV point now can be used as an input for the for the evaluate surface component so so now the evaluate surface component gives us the surface normal and you can see it also gives us kind of a plane here this frame here okay so I will actually start documenting this quickly okay so now that we have found the normal let's look at our instructions find surface normal at the centroid create a vector of a variable length in the direction of the surface normal that's easy enough so we want to create a vector in this normal in this direction with the variable lengths so let's again set up a slider I don't know yet how long it should be actually I will create a slider based on the there is a certain ratio of the diagonal length of the surface should we do that or a certain ratio of the area of the surface let's just do that since we already have the area up here let's just create a style that goes from point one to point two five two point five so here's our slider between point one and point five I'm going to move it up to the front remove these guys and this side that will be called the truss depth and I will calculate a percentage of the area so I'm simply going to divide the area so here we'll do some simple math divide the area value but by that slider so this just gives us kind of a smaller value sorry it should of course be multiplied and now this is the amount at which we want to move that that point outwards so we're going to create a vector from a stop point in a certain direction so we're going to create a vector from a stop on this certain direction and we're going to change its amplitude so the vector would be our surface normal and the amplitude would be this value here and and now we're going to take this vector to move that original centroid point or we could also just move this point here at the same point in the direction of this vector so we go over to transform and under Euclidean we have a move command and we can move again move is asking for two inputs based geometry which would be our point so I'm just going to take our original centroid to be moved and T is a translation vector it should really be called V so I'm taking this vector here that's that's huge so I'll make this range a lot smaller let's just make this maybe something like that okay that looks a lot better so so now that we have created this point here all that's left for us to do create the vector we've moved the centroid in the directional vector now we want to extract four corner points of each sub surface and then we want to connect them to the copied centroid so let's go back to our sub surfaces and let's extract always the four corner points so that would be an operation under surface so we want to actually analyze the surface for its corners right sorry we actually want to I think the best best way to do this is to explode the surface because when we explode all of our surfaces we're getting all the edges which you can see the number of edges is always four for each surface and we're getting all of our vertices which is also there for vertices in every surface and the last thing we want to do is we want to connect these four vertices so let me label this and take a different color to do that sub-surface foreign our vertices and this would be our you know bottom part of the truss and we want to connect them now there's one one kind of thing to be cautious about and you can see how the the line type has changed and again if this is completely new to you if you haven't watched this in any scene this in any of the tutorials that we previous at previously had asked you to watch then I highly recommend you do this tutorial on surfaces and you may even want to go and take the very first lesson which talks about that so if this is completely Spencer you please watch the first lesson and then the grasshopper tutorial services and they also have a continued service tutorial which actually creates some some pretty cool effects something up that you might actually want to be using for your homework all right so so so now the this time he has grafted that means we have as you can see actually I can I can visualize that is in this component here I can visualize my tree and you can see that we have a hundred lists and each of these lists has four objects four points and so here's the list let's count and here's how many points we have in every list while here we have just one list with a hundred points so what we need to do is we need to match the data so we need to create as many lists from here as we have here so that we can do by simply grafting the component I can right click on it and press craft and now we have a hundred lists in here and we have also have a hundred listen here so now what we can do is we can simply connect points from list a and points from this B and they will create those four lines for us so this concludes the first let me just preview the edges there as well so interesting in seeing the edges I'm just gonna put them into a different line face over here sorry curves they're not lines I may want them to be lines actually if I wanted them to be lines instead of curves all I would do is I would create polylines let's just do that because I want them to be straight and not curved I'm going to create closed polylines from these vertices we're going to draw a point line through these vertices we're just going to create a hundred polylines that Eve each have four points to make sure that they actually first so I can I'm just going to create a panel that says true and the next thing is that so now that we have these polygons I'm just going to explode them and this way I have my straight line segments 400 of them in my example so so this is it this is the the first part of the tutorial that we went through last week in class so this point I'm going to save my grass profile and I'm going to clean it up and then I will show you also how to create some roof analysis okay so I'm going to clean up this definition before we go into step number two so all my my three variables that I have are labeled and they're on the left-hand side of the definition I always wanted to set up my inputs on the left and my outputs on the right so I'm happy with this I'm just going to give them using the input color and workout so now I'm going to label what the steps were that I actually did and actually going to write a few small tags here so the first one would be subdivide surface create and subdivide surface so if I move this you see if I kind of pick it up and start moving it and if it's kind of funny instead of doing that I can hold down my shift key and then it will move anyone rotate so I can move it wherever I want so let me let me start dropping things loft and read parameterize surface divide service domain and create subdivision services or sub services find the centroid then what we're doing years we're finding the surface normal at the centroid then we're creating the bottom points remember jizz grafting it to in the end create our sets of four lines and here we're creating linear surface edges okay so all of these things are operations I guess I can let me just label some more things I've been paste this move it over here let's just say Freight trusses okay now I'm going to create some larger groups in a semi-transparent color let's prove this as well and this would be maybe another step service normals and going directly can add that to the group and so this would be number three okay so my outputs my my really important outputs for the analysis should be of course actually my outputs for this whole definition should be my surface edges and trusses so I'm just gonna combine all of this into one placeholder one-line placeholder holding down the shift key all of these are now my trusses actually I want this to be in red for output so I'll take this color Trane's edges trust lines sentiments if you guys want you can type them I find that it makes the surface the model bit heavier so I'll just leave it also what is important to me is just for the analysis that we're going to do next is the area value and the centroid location okay so edit area and centroid are also important to me so I'm going to create two additional outputs here one is a number and one is a point surface area surface centroid and lastly what I want to do is I want to do my analysis and then I want to visualize it by color-coding the sub surfaces so I'm going to come all the way back here and take my surfaces as well yeah this I don't really like what this is going so I'm actually going to just change the wire at this picture hidden I want to do this too often because then I don't understand anymore where anything is connected like here wouldn't make sense to change it to hidden but sometimes it just does so my sub services I have my surface centroids and from here and my area values coming from here and I will hide all of these wires and now we move this up and also what we can do is we can select all of this and we can we can arrange it right off to the right for example and then spaced it equally okay so now everything else can be hidden it is and now I'm going to actually take these as an input for my service analysis part so for now let's take the white background as a new group you group all of this and give this also a new headline so this would be the roof trust geometry and next we're going to create roof roof analysis so I'm going to copy all of these because I will not want them to be my inputs so I'm going to copy them create the outputs from here to here make sure all the wires are hidden and change the colors and the group sizes it's the chief was sick for yellow 16 you value 16 and down here I don't think we need to send our lines actually but I'll just moving down for now so like I said the first analysis will be area of the roof so I'll simply take this area value now you said to cut on my stop services so let's find the the gradients and I want to have a I want to set up by right-click on it I can set up a three color gradient so let's go from red to blue and so basically my values for the trade these colors are driven by the area value here so these are my values now my I want the smallest value from here to drive what should be red and the highest value from here to drive what should be blue so if I look at these values you know they go there's some 30s some 20s like I don't actually know what the domain is but again these are values and I can look at the domain of this which means I can create a domain and now it tells me that it goes from 18 to 45 and then I can just take the domain components and the smallest component is the domain status 0 is 18 in the domain end is 45 and what this now does is it generates based on those values it generates RGB values for me color values and I can take these color values and preview the surface services based on these so there's a color preview under vector and it has two inputs one is for geometry my geometry would be my surfaces and just move this to the top somebody thought it just true is it in pink and my shading would be this color yeah and if you wanted to add some transparency we could do that as well so instead we would just set up a material in a material kind of a transparency value so there you go so this is the first analysis now we've basically recreated everything that you did with Justin in class and since we're here visualizing things I'm going to move this over here and change the color of it but instead of just having one visualization I want to create a second one for the elevation that measures the animation of this of the surface Centrepointe so in order to do that I will I will just take the center point and I will decompose the point there's three components and I will take all the Z values and I will simply use the Z values as an input for here and also as an input for here and now you can see wet snow it's wrapped and then the hype hyoe surfaces are colored in blue if I don't always want to switch to inputs what I'm what I can do here is I can just take a point value sorry a number placeholder and I can put I can put this in here I can make this I put this in here and in here and now I can simply switch what my input number should be so let's just say so I'm gonna name this guy this can be an input and this will be my color values so kind of a or color yeah kind of driving values so that could either come from the zip coordination or that could come from the surface area so the larger panels are in blue and the smaller ones on red and lastly actually what a here you can do something fun we can start playing with our sets and we can set up a stream filter so you can say based on you know I can either say go take the inputs from gate zero or take the inputs from gate one and I'll put them in here so now I could just set up like a slider for example that goes from zero to one and I can change which analysis to run so an even better example of doing this instead of calling the analysis zero one what we can also do is we can set up a value list and you can see we can have a preview and we can have a numeric value or some kind of value coming out so if I double click on this sorry if I right click and edit this list see on the left is preview so let's just say what's in so surface area would be 0 and elevation would be 1 if I wanted to set that more so for example distance to Center distance to attractor I'm going to set up an attractor point now would be analysis number 2 so now I can put that in here I can choose from the drop-down whether to use 0 1 or 2 now of course two doesn't work yet and I can call this my analysis type all right okay so the next point is I want to set up in Rhino and in fact the point that I want to measure the distance between the attractor and the centroid and color-code the surfaces based on that so in Rhino I don't know why my escape life isn't it doesn't work anymore so since I can't go back to Rhino for some reason I'm stuck yeah I'm stuck in Rhino for some reason it's because I'm recording this screen and it doesn't it doesn't work together so so I will just set up a point with with two status on the XY plane or whatever I'm gonna draw a circle I'm gonna draw a circle in grasshopper and just make a point go around the circle so I just want to create some sort of attractive point oh wait see here's an idea I can take I can create a box let's see you can create a bounding box you know there it is bounding box around the entire surface oops not per object okay now from this pox I'm only interested in the bottom most surface Peter the bottom of the top surface and then I will just create a point on that surface so let me just take the bottom must find the bottom of surface so I'm going to explode the box it's filled this box poly surface into six different phases and then for every of the phases I'm just going to now take the face that has the lowest X the lowest elevation because I'm interested in the bottom face there so I'm going to for every face I'm going to find the centroid so for every face I'm going to evaluate it at 0.5 0.5 but we always have to remember right Yuri parameterize them so here we go now I have a list of six points and I want to find the point with the lowest Z values I'm going to extract the Z values from all of these points and I'm going to sort them and I'm also going to sort the services in the same order and I'm going to take now the first surface which is as elevation minus four so I'm going to take one item from the list of services CMS ordered services yeah my started services I'm going to take only the first item so if I'm preview all of this and up with this surface here and now on this surface I will create a point give me a minute then haven't done this maybe ever on a long time but I want to use the empty side of the multi-dimensional slider to basically create a point on that surface so actually yeah we can just use the same command here again this would be our surface this would be our UV and if I preview the point here we have a point now so we can kind of control where on the surface the point is using this 2d Snyder so lower left corner upper right corner etc okay so much work just to get a point just because because I couldn't minimize right now so I couldn't I should draw a point in my nose but this could also be a point from reference and from Rhyno so yes all of this has been done simply to set up an attractor point okay so I'm kind of gonna clean this up for a second actually another this is taking up space I will reshuffle things bear with me and just taking the SAP surfaces from the top and here we go make this one size 70 and group all of this all right change the group color one more time and group the imports in this to the background like taking control B so here we go inputs on the left and yellow make sure this big box is part of the white box so I right they can add it to the group and now on the right this is my attractive find well so much work so I'll take the output color make this the default color and group it changes to the view in the back add this to the group and call this check the plant and now the attractor point is going to become part of the inputs for the for the analysis here's our attractor punch and now what I want to do is I want to add so I want to add one more analysis type you know the track the distance so I'm going to zoom in and now I could click and add in another input number to which this will output number two and I will put in a list a value of distances between these centroid points and the attractor point so I'm just going to go to vector and measure the distance between all of those points all of these points here and this red point down there and those distance values are now going to drive basically the the coloring of the surfaces so let me turn this off again after go down to a track the distance you can see the further away the more leans towards blue and the closer the more leads was red now for change to go back to our kind of panel here we cannot change which which elements are red and which ones are blue but moving the point around okay so let me just clean up this definition and then we're done okay this is I think all pretty self-explanatory this is not the TV analysis very simple so it's just I mentioned in the homework as part of your homework should come up with with some of your own analyses so so here please just add a couple more instructions I don't know you could come up with some some maybe some interesting math simple stuff like multiplying the area by the area of the panel by its elevation value or maybe something more interesting you know I could also do something like instead of taking the elevation that could take the X or the y axis the Y value instead of taking the Z value here if I take the Y value and set this to elevation of course it just kind of goes in one direction so animation is a bit more interesting but I hope that you can come up with a couple of nice examples here that to add to the roof analysis and to add to this component here thank you very much okay
Info
Channel: Jonatan Schumacher
Views: 22,960
Rating: 4.9661016 out of 5
Keywords: rhino grasshopper
Id: jPY0dsLsd3M
Channel Id: undefined
Length: 55min 35sec (3335 seconds)
Published: Fri Sep 13 2013
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.