Grasshopper - Using the Graph Mapper

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this tutorial we're going to look at how to create something like this but we're going to our main priority in this is going to be using and understanding the graph mapper and how we can use it to drive values and functions so we're going to make a new document and I'm going to start by dropping down the graph mapper so the graph mapper is found in the input tab graph mapper there it is and in order to run the graph mapper we need the list of values or could just use a value but I'm going to grab a list of values we're going to grab a domain and we're also gonna grab a range component there it is and so our domain by default is 0 to 1 so actually we might just leave that so we leave the domain component for a bit later on and we'll grab an integer slider and I'll need to get some maximum value of 100 plug it all in plug that into my graph mapper and I'll give it maybe just seven steps for now so now what we do with the graph mapper um as you can see at moments doing nothing it's basically just going to spit out exactly oops exactly what we plugged into it but well what we can do is if we right-click on it we get these graph types and so maybe I want to try let's just try a busy a graph for now and so what's the what this is doing is the graph map exists between a 0 to 1 space in the X direction and the y direction so when you plug in a list of values those are the values it reads in the X direction and then it spits out all your equivalent Y values so if we look at this list each of these red lines mark the point at which of the number which we're going to be returning so there is a red line at zero there's also one at the end and this point over here is zero point zero three eight in the Y this is zero point one six six nine eight zero point four two and so on and so forth um and as we increase these steps you can see our red lines change and beyond syn point they just completely fade away don't worry it's still there all right so we're going to use this I'm gonna delete these panels we're going to use this to try and drive some data so I'm going to make another copy of my range component and I'm going to plug a domain into it actually I start up a new domain because I'll show you another trick what we can do let's see we said we want the domain between 0 and 100 all we need to do is just plug one slider in and if we plug that into our domain it will automatically assume we want to create a domain between 0 and that number really handy trick um and so now we're going to construct some points on the other side so my x value will be this range here and my Y value will be this here now you what you'll notice a very subtle change because what it's doing is its cutting out the value between 0 and 1 which is almost negligible so I'm just going to grab multiplication component and I'll grab another slider drop that down increase my next value to maybe a hundred plug that in and then when I plug that into my Y you should notice a much more drastic change and as we see if we move these points of the graph mapper around the points in our Rhino space will update automatically as well now we can change this to any kind of graph type we want maybe we want parabola or maybe we want the sine now this is very similar to what we did in our in the tutorial where we looked at sine functions but basically this is just a more graphical way to do it if the if the formula method is a bit too much for you we can just plug this in and very easily edit and see the result as we want you can see it all updating absolutely live which is fantastic now we could may are let's try something else we could create a grid of points by grafting our X and then if we want to plug this into a Z there we go now we're driving this entire grid which is really neat um and so just for visualization purposes I'll pop out the surface from points component I'll flatten my list of points and our U value is going to be our number of steps plus one as you may have guessed if you've watched some of my previous tutorials so we'll just change this to you just I've got my convention alright and we'll plug that into here and there we go now I can turn these points off um alright now we could take this a step further and let's say we wanted this graph to control both directions of our of our elevation what we need to do okay we need to change the set up a little bit instead of grafting this function here what we're going to do is we need to cross reference so we're going to cross reference this range on itself those will be our X&Y oh so silly me I forgot to uncraft that let me just undo that release this lot I'll release the solver and now I'm also going to cross reference this graph mapper on itself now what do we do with these inputs it's basically it's just going to create a two dimensional matrix out of this so what we need to so we need to multiply these results by themselves and we also need to plug it back into our amplitude and so there we go now we can control this surface in two directions once again we can change this to anything we want I like quite like for Bezier tool um also I person just a personal preference but I find using the mesh from points component let's see where to go mesh and points my U and V values are exactly the same I prefer to use the mesh from points component just because we can visualize all the mesh edges along here um makes it just a bit easier to understand what's going on exactly and of course anytime I actually want to bake it out I would bake out the NURBS surface just because I don't know if I've touched on this before but on meshes Misha's RL our mesh it's a good for previewing geometry but what you will notice is that they rely on bit more resolutions when we're down all the way down to three here three point or three divisions we get this very boxy sort of hard edged surface we can you can really tell all the mesh edges apart whereas this NURBS surface will remain completely continuous and smooth NURBS surface will always have completely smooth curvature whereas a mesh will never have smooth curvature but if you bump up the the um the face count enough you can get it to fool you into thinking it's quite smooth as you can see anyway that was a bit of a tangent I'll just keep this on for visualization purposes um another thing you should note if you you might be seeing your mesh like this you might be wondering what I'm talking about um in order to turn mesh edges on just click in your own OVR in your graphs upper canvas and hit ctrl M or I think you can go to the display tab and preview mesh edges here okay anyway back to the task at hand no we could also do here is we could bring in the second graph mapper and I could change that to maybe a sign and so I'll plug that into my B and now as I add this also bump up my steps we're getting our busy a curve controlling one direction of the surface and this sine curve controlling the other direction of the surface now I might for all intents and purposes just change this to assign summation in both directions just so we can create something a little more interesting um maybe I'll do all this for me bit much bump up my resolution a bit more and this one will do something like no not quite maybe something okay there we go yeah yeah I'm happy with that alright cool now next thing we're going to do is we're going to look at some something we can do with the surface a really cool component is the ISO trim component um if you've never proven if you've never come across the ISO trim component I'll just I'll just bake the Smasher are this six under grass up so we can do a little bit of an explanation of what it's going to do so if you wanted only see of this surface and right now what you could do is you could trim up button up front you could split it and you get this split by ISO curve option and so an ISO curve is basically a curve a rot along the direction of along one direction of the surface which is along the consistent parameter so this might be point one in the U this might be point two point five um actually and so if I were to split this here somewhere what you'll get is two separate surfaces split by that ISO code all right pretty simple now we can do the exact same thing with the subsurface component um what we need to get it to work is we need the surface and we also need a domain but it's a bit different to a usual domain that further normally we've just used these these one-dimensional domains but because we're working with a surface we need a squared Omega two-dimensional domain and so what we're going to do is we're going to grab this divide domain square and component and so it asks for the base domain and interestingly enough our base domain can in fact be serviced and then our U and V values are just adjusted by a slider and I'll give that a maximum value of 20 set of two integers okay plug it in and this basically controls the amount of divisions we want on that surface so if I plug this in now you can see what we're gonna get is seven surfaces one two three four five six seven in both directions and as I do this it updates accordingly so now what we have is four completely separate surfaces as a result of our ISO trim ISO trim just means by ISO curve alright now we could if we wanted we could take the subsurface of this isoh trim we could do another ISO trim but we're going to do something a little bit different for this one instead of using the divide domain squared we're going to construct a square domain and you can do this one of two ways you can either do it whoops it's the same component you can either do it using two domain components so we just plug these into here and set our minimum maximum for each or you can just plug those numbers into here does the exact same thing so what I'm going to do is I'm going to grab slider I'm going to check it in actually you plug that one there and then you do the same to these two and so maybe I want it from zero point one six to zero point one in both directions this will plug that into our domain and it's going to throw an error just because it's not understanding what we're going to do with the domain yet so we're going to reap Ram to raise the surface and there we go so basically what we can't what we are doing here is we're taking each of these surfaces that we created with the initial sub surface and we're extracting just a small area of that surface so I can use this to basically trim off as much or as little as I want in my direction now a really neat trick that we can do here is we could grab a expression and we can make a real simple expression which is one minus X and we'll plug that in get rid of out why because we don't really need that and we'll plug that into our U and we'll do the same for our V and so what we can do with this is we can control both sides of our trim so that we're getting a uniform shape in the middle a pretty neat little trick in fact if we wanted we could control this all from one single slider so that we are just getting the absolute center of each and every single one of these little surfaces there we go now just to finish this up well we'll take all of these surfaces and we will project them there's okay years we've got to beware because there's four different project components the one we want is to project an object onto a plane so the object I want to project is each of these sub surfaces and the plane is our world X Y that's absolutely fine and so now we can just add so now we've just dropped down into that plan what we could do we could laugh these together now just watch what happens okay I might just quickly turn these diversions down in case glass I've decided to crash when I do this next step if we were to try and loft this it's going to try and lock all of these surfaces together that's because what we need to do is we need to set up a data structure little differently so we're going to graph this and off the bat it's not going to do anything just yet because we've only got one item in each of these lists so I'm going to plug in our projection as well and so what it turns this list into ISM our is nine lists of two items each and well that's what we want to be honest yes yes so it's really important to make sure your data structure is doing the right thing now we can go in and we can increase these divisions um and the last thing we need to do we just need to join these up because through the bake this loft out it's only going to be the mid section it's not going to be anything else so I'm just going to use a brick giant opponent and good thing is these data structures will all still match up perfectly so I'm going to start plugging in the bottom of the shape followed by the middle of the shape and top the shape then we'll turn these off and if we bake these you can now see these are all individual objects and there we go now if we go back to the beginning we can see that this is all pipe lining through here so there's going to be really slipped moment because there's a lot of calculation that it's doing but we can control all of this at any which stage we want to do the same with this graph mapper we could change our elevation to whatever we want we could change the size of this grid and we could go back in let me just reflect these values in here you go and trim this to whatever size we want so maybe I only want that much in the V direction and that much in the U direction and maybe I want a whole lot of these and then I can just fake those out and then we got a whole lot of we're like maybe like a weird sort of monolithic neighborhood of some sort here we go hope it was a good tutorial
Info
Channel: Daniel Christev
Views: 54,236
Rating: 4.9498434 out of 5
Keywords: mapper, trim, yt:quality=high, grasshopper, tutorial, graph, surface
Id: 3FA_1sL6J0w
Channel Id: undefined
Length: 20min 1sec (1201 seconds)
Published: Wed Jan 27 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.