Grasshopper Tutorial 03 | Dividing Curves

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright in this video we're going to be discussing different ways of dividing a curve so first of all we need a curve type in the curve command I'm going to start with fairly straight bit strongly curved area and then something a little bit more gradual at the end just to show the effects of the different ways of dividing a curve now how do we get this into grasshopper well and grasshopper for that we've got these hexagonal parameter blocks I'm just going to double click type and curve and there you can see our parameter block now to set this curve I can select the curve in rhino then right click on the block and go set one curve and now I've got it in grass offer so the curve was black because it was in rhino and now we've got the red curve from grasshopper also being displayed on top of that now to divide it if we go to the curves you can see we've got very we've got very different options to divide this clip I'm going to start with divide curve and if I curve takes three parameters the first is obviously a curve the second is into how many segments we want to divide this curve and the default is 10 and then there's a true false input which is currently set to false which is split segments at kinks and a king is basically a really sharp corner in a cup see how this goes continuous continuous curve now if we take a second continuous curve and attach these two then we'll have kink in this corner and we can tell the divide curve block to automatically split at these points as well alright so I'm going to connect our curve and then I'm going to create a slider going from one to honor let's go 10 and you can see that if I tell you only split one segment obviously it has only got one segment now and then here we go now what comes out the other side is actually points not segments of a curve the second thing that comes out is tangent so the tangent of that curve at those points and then T which we'll get into in a little bit so if we look at this in a panel look at these points you can see that each of these points is described in x y&z coordinates and because we're working on the base plane z is 0 for all of these points now if I don't want to have points but I actually want to have the individual curve segments I need to use another block which is called shatter all right and shatter takes two inputs namely our original curve and then T so let's talk about t when we have our points of where we want to split the curve it takes three parameters to describe a point x y&z but if you think about it this way if we say this curve is a wire and we put a little ant on it and the ant is walking along that wire we already know that the ant is on the wire so we only need to have one number to actually describe its position accurately and that's exactly what the T parameter does the T parameter describes a point on the curve so if we already know that we want to describe something that's on the curve all we need is that T value so if you look at these T parameters you can see that it's only one value along the curve now what's very important to note is that T is not a distance or length along that curve it is a parameter for the internal mathematical representation of that curve and depending on how strong the the curve bends for example if I move on this curve two units in T the distance I travel will be very different in a straight fit to a strongly bent bit it's just something to keep in mind and we'll talk about this a little bit more in the lecture for now let's just connect these two and if we now look at what comes out of this we've got eight plane our curve so grasshoppers actually noticed that these are all lying in one plane and has put them into a container called a plane up curve now that's all fine and dandy and we've got these planar curves now we could work with them let's say we don't actually want to of curse between these points but straight lines how do we do that salute this panel then we can use a block called polyline here we go and polyline takes a list of points and creates a straight line segments between these points it also has got a true/false setting if it's if we're supposed to close that or not so you know put a little toggle switch here just to show you what it means if I set this to true by double clicking it it'll close that polyline but let's get rid of this we don't need that right now as you can see it's getting a little bit confusing here in our in our Rhino viewport because all this stuff is layering on top of each other and there's two ways to deal with this the one quick and dirty way is to switch on this option only draw preview geometry for selected objects so if I click on that will only see the original Rhino line and I have to click on each individual component then have it shown in right now so this is the original curve this is the points that were created by the divide curve command and then we've got the segments which are connected and you can't actually see the different segments because we all touch each other and then this is the polyline what you can also do is simply select multiple blocks hit the spacebar and he got lots of options you can use the spacebar to group items for example but you can also use it to enable and disable preview I'm just going to disable the preview for this and now you can maybe see more clearly what the polyline is doing if you want to hide the original reiner object there is the visibility tool here and if you just click that you can hide the objects or you can show all objects again it's very simple to switch between the two okay another thing that's nice in the spacebar is if you select a component and hit space or multiple components you can bake them if you click on this fried egg what will happen is it will take that the current state of that object and grasshopper and turn it into a rhino object and then we can simply move it in rhino and you can continue working on in rhino and if we then change this and bake again it's very easy to then compare multiple versions of your model right now when you compare these two polylines you can see that if we've got few segments it's very obvious that they're all different lengths because here we're taking a shortcut we can also analyze the length by going on the analysis and then there's length so if we look at the length of the original curve and panel behind here we can see it's 70 point 27 and if we say shatter it into 10 10 pieces then those shattered pieces whoops don't want to do that we want to put the shattered pieces inside length block and then listen to them panel we can see that they're all the same length apart from rounding errors rounding em is a dangerous but we'll get into that some other time and if we now plug in the polyline oh we only get one value again so if we want to measure the individual segments of the polyline there's another block similar to the shatter just called explode and what that does is it takes a polyline and explodes it into lots of segments and now you can see that they're all different lengths which of course becomes more obvious if we go back down to say four we've got big differences in the length of these segments if we actually want to have exactly the same length segments we need to use a different divided command and this divided command would be divided distance right so if you plug in the curve here and we give it a distance of say 12 then what will happen is that let's take this let's keep all this and now let's instead of taking the points from our divide curve command I'm going to use the points of our divided distance come on let me go back to this view so this is our divide curve and this is our divided distance command and now if I take these points you can see that a segments of the polyline are all the same length alright so this is the polyline that's created there's one thing to note and I'm going to bake this quickly here we go whoops this let's undo that and let's bake this polyline so that we've got single polyline here we go you can see that this is shorter than our original curve because this last segment doesn't fit into the length of 12 so that's something you need to keep in mind when you're dividing by distance that things will get chopped off at the end if you do that so now we've got something that can divide a curb into equal length segments and this is what we had in the beginning right we divided our curve into four segments of the same length but let's say we want to divide the curve into segments which have a given distance a given length there's also command for that which is called divide length and takes curve and a length and now what happens if you see here all these segments along the curve will have the same length and once again when we change that and it can't fit a segment of a length of six into here it will just chop that off and lose it so that's the three basic line division command and a little bit of information on how to make sure that you remain in control of what's being shown and Rhyno so that you don't get this chaos and can't see anymore what your code is doing thank you for watching
Info
Channel: Individualized Production in Architecture
Views: 20,363
Rating: 4.9581151 out of 5
Keywords: Grasshopper, RWTH
Id: tJErbes0PCs
Channel Id: undefined
Length: 12min 51sec (771 seconds)
Published: Thu Nov 17 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.