Grasshopper Pufferfish Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this tutorial will aim to give a basic introduction for users new to the puff fish plugin for grasshopper so what's pufferfish pufffish is a plugin that focuses on tweening different types of data in grasshopper we could think of the word tweening to mean morphing or blending one object or data type into another version of itself kind of like the animal the plugin is named after the plugin also contains a collection of more general tools for grasshopper that may save you time in your workflow because of the enormous number of components in the plug-in there's no way i can cover it all in this tutorial so instead i'll aim to treat this as a general introduction to how you might use the tool we'll start by looking at tweening curves then move to surfaces and meshes before completing a final exercise looking at a more complex twisted box algorithm using the plugin so on my screen i've got a template file with some starting geometry that we'll be using to complete the tutorial to access this file for free just create a profile on our website and you better log in and download the file so before we get started with tweening i just want to show an example of one of the many object manipulation tools that's available to us in puffer fish so i'm just going to firstly come over here and reference in this curve with a curve component right there i've got that guy in and what we're first going to use is something called the prude component so let's go over to the pufferfish plugin which is here and we'll come to our drop down menu and we just want to grab the prude component which is prude curve here and what the prude component does is it tries to just remove all the sharp edges you've got in a piece of geometry so i just want to basically flatten out or curve out these hard edges of this star i've got so i'm going to drop my curve into the prude curve component and we don't see much going on straight away i just want to add a few parameters so i might add something with a value of about 25 for the length and that just straightaway offsets our component you can see already it's giving us a nice curved version of our base geometry we've got a few different blend types which is how it creates that curvature so i'm just going to create a slide between zero and one and you can flick that over i actually kind of like the curvature of number one so which was the curvature output not the tangent t and then for bulge it's asking for a number between zero and one so let's go zero is smaller than 0.50 which is smaller than one and plug that guy into here and that'll just enable us to control that bulge i can i'll make that 0.75 for now i'll preview that guy off and i might just hide that curved geometry there like that cool so we'll group that guy and we'll call that bulge oops actually it would make more sense to call it prude wouldn't it so i'm going to go ahead and bake that guy because we're going to use him to create our first tweened object so let's copy this curve upwards because what we're going to do is we're going to tween through three different curves here so i'm actually going to scale this one in a little bit and i might actually rotate him by 30 degrees as well maybe 25 trying to get him into that middle i'll just do it manually actually around there just like that and i might make him just a little bit smaller and then this one here i'm actually going to just rotate a little bit like that and maybe just pull them out a little bit so what we're going to try and do is create a blend between these curves using some of the tween curves tool available to us in puff fish so if we come up to our curve tab on here the main tween options are here at the top and we're going to look at all three so let's start with tween consecutive curves i'm going to drop that onto the canvas i'm going to create a curved component and reference in our curves so i want to reference these in order from bottom to top so i'm going to go set multiple curves i'm going to select the bottom first the middle and then the top geometry and hit return and let's just straight away go ahead and plug that kind of curve so straight away we'll get something we're getting a couple of objects tweening so what is it we're getting two that are being output i might just create a panel so we can clearly see what that output is there and the way that it's basically creating where these tweens are happening has to do with our factor and our factor is currently set to 0.5 so what it's doing is it's taking this first curve and this second curve and creating a kind of middle morphed version of the 2 which is represented at the 0.5 so that's our tween factor if we were to make that you know a value of 0 between 0 to one we could easily start at zero and you'll see as we move up to one it goes to the top curve so a value of 0.5 means we get a tween in between these two and then of course it's 20 between the top two as well but what if we wanted to have multiple curves so not just one that goes in between them we could create a range component which will give us a list of numbers that sit between 0 and one because this base domain just by starting point is set to zero and one so i could go and create you know a number slider that sits between zero and a hundred and i'll plug that into range and what it'll do if i make it 37 for example is would give me a series of even numbers all split up that go from zero to one so if i plug that into factor now you'll see we get a big tween coming through and what it's doing is it's so if i have that set to 30 it's creating 30 between the first two and 30 between the second two that's specifically for the tween consecutive curves and because this is parametric we could go and adjust you know these curves in the middle and that will update quickly for us so that's kind of a base intro to how this kind of tweening operation works in puffer fish let's have a look at another tween curves one let's look at the tween two curves here so very specifically it's asking for between two curves in particular i'm going to preview that guy off so what i might do is i'll create a list item component and i'm just gonna grab these curves here and we're just going to get item one and then item two so these two here will tween in fact actually let's go between the top two just so we get a full one so we go from curve a to curve b here and once again we're getting you know a 0.5 factor by default like this so i'll add our old range in so we get more of a tween just like that okay what happens if we wanted a little bit more variation in our tween what if perhaps we wanted to bunch a few of our curves up to the top and have kind of a more spaced out approach down the bottom we could easily do that by manipulating the numbers coming out of range because they're set between 0 and 1 it's really easy for us to use something called the graph mapper in grass up so go and create a grab mapper sorry a graph mapper component and drop that on the canvas and i'm going to right click and change the graph type to a bezier type just like this so i'll go and plug my range into there and then i'll plug the output from that graph mapper into the factor and what this will do is it will enable us to be able to skew these range outputs so if i go and drag this you'll see i'm able to bunch some of those curves up to the top here similarly if i go and drag these ones so we can get quite a large skewing effect just by easily manipulating that graph mapper i want to show you that it like the problem that kind of comes up when we try and do that with the tween consecutive curve so i'll plug that into here and we'll preview that off and we'll preview this guy back on and what you'll see is it bunches basically towards one curve then kind of spreads out to the middle and then bunches back again when we're doing this tween consecutive curves and that's once again because what the twin consecutive curse is trying to do is trying to create 30 in between all of these outcomes so it's going to basically do this you know tweening for one double set of curves and then tweening for the next double set of curves which doesn't really give us a very nice kind of tweening effect between all of the curves so what if we wanted to do a more gradual tween all the way through all these curves in that case we'd want to use the tween through curves component so let's put that guy in here we'll plug our curves in and we'll plug our factors in i'm going to preview this off here and then you'll see rather than tweening from this guy to that guy then the middle one to the top one we're actually getting a gradual tween through the entire thing and we can actually manipulate this a bit further to get like more of a curved tween in between these things i'm going to create a number slide that's between 0 and three and we're going to experiment with the interpolation type so we've got a base type of zero but we can easily change that so we get more of a you know smooth curvature between these tween objects which you know enables us to create a much kind of more graded approach with this tweening objects we could increase our range so we get a little bit more of a complex outcome and that gives you a bit of an understanding is how you kind of would go about creating the basic tweening with curves in puffer fish so i might group these guys and we'll label that tween curves and then the last little experiment i want to do is i want to just try and apply this to you know some kind of problem or task that you might face somewhere in the real world so these um tweened geometries to me start to look a little bit like 3d printing paths so what i want us to do now is try and simulate how we might apply this to some 3d printing paths so i'm actually going to well start again i'll create a base curve component and i'll go in reference in multiple curves i'll go this guy this guy and this guy hit return i might preview this off for now and i'm going to create a tween through curves component here put that guy in there and we create another range we'll create 0 50 100. so we've got some nice steps in between let's put that into steps plug that range into factor and i might copy this number slider actually here so we can get that nice interpretation going through our curves just like that in fact let's get a graph mapper on so we get a slightly graded effect just like that looking good so when a 3d printer is operating generally what will happen is the 3d printer will go around the layer complete its loop and then it'll jump up to the next layer and grow around again and then jump up to the next layer and so on so forth so the way that we could go about doing that is basically we could go and divide these curves into a certain number of points i'm actually going to make it about 200 points we could go a bit bigger so i'll just make that number slide i have a range of up to a thousand something like this and what i'm actually going to do here is i'm going to call at an index and the indices that i want to call i'm going to do a bit of a list so i'll just create a panel is number one zero and number one and i'll just change that to multi-line data here and plug that guy into indices and that's basically going to get rid of a couple of these points here we could add you know 0 1 2 to get rid of an extra one in fact maybe we do just because we're not getting rid of too many here and that gives us a new set of points and basically the order of our list right now is we have all of these points on one branch of our data tree then the next branch is the second layer here and so and so forth so if we go and flatten this list we've now got a flat list of points that looks like this something with gaps in it and we could easily just go and create a polyline that would represent our 3d printing toolpath and you'll see what happens now if i preview of our tween is that i might actually also just hide our geometries is that our tool path preview that off too jumps up along this curve when you're creating 3d printed geometries sometimes what's really helpful is the ability to actually control where this jump occurs you want to control where your seam line is and in puffer fish there's a really great tool that allows us to realign where the seam is for any curves in our geometry so basically when you ever have a closed curve in rhino it has something called a seam which is its starting point which basically is sitting here in all of our geometries so we're going to go and try and adjust this and we're going to do this by using a tool in puffer fish called curve align or sorry curve align curve seams it's down here curviline curve scene so we're basically going to align the seams of our tween geometry to a curve that we're going to draw so put these curves in here like that and then i'm going to reference a new curve into here and i'm actually just going to draw a line straight up like that that's taller or bigger than my 3d printed geometry and i'm going to go set one curve and we'll apply that in as our guide and you'll see what it does straight away is it gives us a collection of points as to where our seam is going to be reiterated so if i move this kind of closer to our geometry it gives me the opportunity to kind of control exactly where that seam is going to be and if i go and reference that in now that jump that we're programming in over here is actually occurring wherever i'm manipulating these seam lines so i could go and move this over here perhaps we get a bit of an error in where i've put it because i haven't put it in the greatest position but you could also start to rebuild that curve you know give it five control points and really start to manipulate that geometry so we get a really nice seam line let's prove that on for a second so we can see exactly where it is oops we'll move this guy here like that and you just want to get like a nice neat seam line if you're ever using 3d printing technology like that but it's a good little tool that's available in puff fish that makes that seam seamline manipulation a lot easier than having to write your own custom seam generating algorithm in grasshopper so it's easy to have a little play around until you get something that you're kind of happy with i'll just move that one more there we go looks good so we'll group that guy and i'll just call it 3d printing logic okay next let's take a look at how we might go about tweening surface geometry so i'm going to move over here to these two surfaces sitting to the side and i'm going to reference them into grasshopper let's create two surface containers so i'm going to create one surface for the bottom surface and then one for the top surface just there cool and if we come up here to our surface tab in puff fish we've got some very similar components to what we saw in the curved geometry we're just going to have a look at the tween 2 surfaces one for this one because you kind of get a feel for the different types of tweening just from the curves one so i'm going to click on tween two surfaces and drop that onto the canvas and then very similarly to what we did just before let's plug those guys in here and we'll create a range and you know between 0 and 10 i don't think we'll go as intense as what we're doing just before and basically if your surfaces are aligned properly and they're kind of reparametized in a similar way you'll be able to easily tween between those surfaces just there so one thing that we can do that's a little bit more complex with surfaces we can actually use some guide curves to affect the way that our surfaces are tweened so if we come through here there's another extra option called tween two surfaces along curve which didn't actually exist in our curved tweenings earlier so i'm going to click on that guy in fact i might just group this and we'll just call that between two surfaces and i might make a copy of those surfaces so we're not re-referencing and i'll put that surface in here and that surface in here might copy that range as well drop that into factor and basically what we could go and do is we can draw a couple of lines that will serve as guide curves so i'm going to go and draw a line from this guy to this edge here and then another one from here to here and i might rebuild them as well actually let's rebuild them so they have five point counts just like that and then i'm going to reference these curves in so i'll go curve and i'm going to set one curve and make a copy of that and set the other curve so we've got both of those curves referenced in i'll make that guide one and that one guide two just wanna make sure i'm getting that right and make sure the directions heading in the boat right in the both way yeah it looks okay but we are getting a little bit of a strange error and my hunch is that that error is actually caused by the order you put these surfaces in so if we flip them around oh actually i think it's actually caused just by this geometry being previewed ah that looks pretty good anyway so we're getting a nice tween by the looks of it i think it was just previewing this geometry my bad but now if we go and manipulate these curves you'll see we're able to kind of affect how that tween is happening in kind of a more interesting way so it can bulge out based on the way our curves working or it can kind of be pushed inwards a little bit so you get a little bit more control over the manipulation of how that tween's working so it's not so linear with the surfaces so that's kind of a basic intro to you know surfaces as well it's very similar to the curves we had at the start it's going to group that guy and i will just call it tween surfaces along curves and the next thing we could start to look at is um i might preview this off as well is how we might go and deal with some mesh tools in puff fish i'm just going to hide that geometry because we might come back to the origin here so rather than getting straight into tweening with the mesh geometries i want to take a look at another handy tool or interesting tool in puff fish called the voxel mesh tool now the voxel mesh tool basically lets us quickly create pixelized versions of any mesh geometry you might have in grasshopper so i'm actually going to go ahead and start with a mesh sphere i might make its radius about a hundred so it's a bit bigger and we'll give it a u and v count we want it to be a bit high because the voxel mesh component relies on lots of vertices so if we go and deconstruct that mesh oops deconstruct mesh you'll see we get lots of points basically if we drag that to a lower res you don't have as many points so for the voxel mess it's usually better to have lots of points in that the voxel mesh component should just be under the mesh tab it's right there so we'll click on that voxel mesh and we see the kind of inputs it's going to take straight away let's make the x y and z sizes all regular so i'm going to make them 10 10 and 10 like that and then the points are going to be these guys and by default it's going to snap to the x y plane uh what we can easily do though is we can kind of manipulate that axis in fact i might just quickly show you what that's looking like so it's creating like a pixelized version of our geometry here we could you know view it a little bit more easily with a custom preview there we go now you can see it a lot more clearly preview that guy off and basically as we kind of you know increase the number of points we'll be able to close off a lot of those holes that we're getting the geometry until we get a more closed off pixelized version of our mesh essentially what it's doing is it's taking all of these points and trying to create a cube or voxel around of it so you get this pixelized version of the geometry at the end but as i was saying we could also try and manipulate that bass plane so i'm going to create an x y base plane and i'm going to rotate based on an axis so rotate axes here and the geometry we're going to rotate is that x y plane that we have at the start i might just preview this guy for a sec x y plane's pretty small so i might just make my preview plane size a bit bigger there we go and we can go ahead and change that guy degrees and just rotate based on you know a 360 degree angle and you know as we rotate that plane it will actually rotate how our voxelized mesh is applied so i'm going to preview this back on oops preview on plug this plane in here and you'll notice as i go and rotate this you can create your voxel mesh at any kind of angle that you like based on a plane and it'll still go ahead and compute where that base mesh is so that's kind of a brief intro on how you could use that voxel mesh another potential way to do this if you're starting with a geometry that isn't as you know controllable based on its vertex count is you could populate the geometry like this by basically placing that in and maybe giving it a count of like 2000 this is a really slow component though like you see when i plug that in that it takes a little while to compute but that could also serve as the starting point so if you wanted to put a custom mesh type in here you could use that populate geometry so we might group that and we'll label that as voxel mesh cool so i want to scoot over to this piece of geometry over here which is a little meshed cross geometry that i created earlier and what we're going to do is we're going to look at a component called displace mesh which actually allows us to kind of morph or transform a mesh geometry and puffer fish based on something like an attractor point so i might just reference this mesh in first and we'll go and set one mesh here and then the next thing i wanted to get up if we go to the mesh tab again we want to go ahead and find that displace mesh component and if we come down here it's just there and we just want to see the input so we have a mesh input and then we have a distances input and basically what that's going to do is we're going to put input the mesh and every little vertice on our mesh is going to be displaced by a certain amount so we can easily set up and attract a relationship to do this i'm going to go and deconstruct my mesh like this and then we're going to do a distance and i might create a point and reference that in so we go it's at one point so he's in there and we're going to measure from that point to each of these vertices which will give us a nice distance we can then use a little handy tool that's available in pufffish called reparametized numbers so if you come up to the number tab and click on reprimatized numbers it's actually an easier way to do reprams which is really good so you just basically put in the numbers which are all our distances and if you've done attract points before this will make sense and it just spits them out in a zero to one domain which means you don't have to find the original domain here which is sometimes really handy and can save you a lot of time you can also really quickly invert them so i could go and invert that and then the larger numbers will become really small so they'll be close to zero and the smaller numbers will be close to one basically so what's going to happen essentially is if you're really really close to this and you've got a small distance you'll oops a bit bigger than that and that's going to serve as our distance multiplier so the largest displacement we're going to have is about 25 units so i'll plug that into distances and you'll see what happens straight away wherever this point is basically our mesh is going to displace itself or move itself based on the normal of its base geometry so we get like a very transformed version of this mesh output so i'm going to group those guys and i'm going to just label it as displaced mesh and i might actually bake one of these hit bake and i'm going to move it over here and i might rotate it as well because the next thing we're going to look at is we're going to move back into our tweening i'm going to preview that off and we're going to tween between these two mesh geometries that we've got here so very similar to what we've been looking at so far with other tweens we firstly just want to reference our meshes in so we'll create a mesh component and go set multiple meshes like so and then we can come up to the mesh tab in puffer fish and we're just going to tween through meshes here plug our meshes in and it's going to create our one at 0.5 as we know it has done before and then we might just create another range 0 10 20 maybe whatever you like plug those steps into the factor like so and then you get a nice tween between all of these geometries so you're able to tween between these two meshes that we just kind of created earlier we could change the interpolation type of course so we could go zero to three have a look at the effect that it has on our tween nothing really with the meshes so we won't worry about that and of course you could add a graph mapper if you wanted as well change it to a bezier and basically this will kind of just affect the location of those guys so maybe we pull it back towards our base geometry just because it's getting a bit bunched up towards the end there like that that looks pretty good and then you get a nice tweened output between those meshes so i'm going to group that guy and call it between meshes great so pufffish also enables us to create mesh geometries from base surfaces so i could go ahead and create a surface component again and reference this surface in and what i could do with that is i could come up to the mesh tab again and create a mesh geometry from this surface using the parameter surface mesh and we'll plug put that guy down and basically it's going to ask for some parameters u and v so this is another point where we can use our range components and i'm going to grab one of those guys i might create in fact let's just plug those in and just get a feel for what they're doing so you can't quite see what's happening but if i were to create in fact i think if i turn on my preview mesh edges you might have it on already you better see the type of mesh topology you're getting from this so if we created a graph mapper we can actually manipulate the topological kind of build up of this mesh output so i'll plug that into u and v again like that and if we adjust this you can kind of bunch up where those kind of edges are and distort how your kind of mesh is so you get a larger face in one corner and much smaller faces in another corner and we could actually go and extend this logic a little bit and we could create you know a second one based on this bottom surface here like that and i might hide all of this stuff and preview the surfaces off and then we could essentially continue the logic we've been using without tweening and tween between these two meshes so i go up to the mesh tab here and i could tween two meshes mesh a mesh b once again we could create a range and we could copy the graph mapper over as well and suddenly we're getting a pretty interesting tween through all these different types of geometries that look something like that you might just make it a little bit more subtle than what it currently is so we can get a few more in like that so it might group that and we'll call that tween through two meshes and this is an important step because we're going to go and use this to create an even more complex geometry type using one of the more powerful set of tools i think in the puffer fish toolkit and that tool is called the twisted box components or the twister box transformation tools in pufffitch they're perhaps some of the most powerful and fun tools that i think we could use in this plugin they basically allow us to tween transform and morph all types of interesting geometries so we're going to use these tween meshes we have here to create something really complex with this kind of base component that i've got sitting over here on the side so just a heads up i'm going to also make use of the weaver bird plugin in this demonstration you don't necessarily need it to complete this little demo but i just want to create a smooth geometry with the final outcome and if you've got it installed that'd be great so i'm actually going to make a copy of all of this because rather than redoing it we might as well just go and use it as it is and we'll come over to the twisted box components and we're looking for the twisted box consecutive meshes tool so that's sitting right here there's obviously a lot of twisted box components and throughout this tutorial series we'll take a bigger look at a few of these tools and how we can make really good use of them but right now we're going to look at the twisted box consecutive meshes there drop that in here as we've always done it's a tweening exercise so we can basically go ahead and actually instead of tweening this guy we can put this one in first and this one in second like that um i might just preview off this so we can get a better look at what it's doing so what it's trying to do here is it's trying to create a collection of boxes that tween through our base meshes and they're following that topology so i'm going to plug in the graph mapper range that we copied earlier so we can get more divisions in between that tween plug that into parameters w you can see like that and for those of you who don't quite understand what a twisted box is it's essentially a transformation tool that is going to enable us to morph any type of geometry and stick it into these little boxes we've created so we've gone and created 343 twisted boxes in this little array here and we're going to grab this geometry over here and we're going to morph it into each one of these boxes that we see so let's reference this geometry and i'm going to create a mesh component and go set one mesh and reference him in and to morph them into the boxes we need to create our box around this geometry itself so let's create a bounding box component there and that's going to serve as the box that encases our geometry now basically the way that i've designed this component is that it's going to tessellate and i'm just going to turn the light grass off off for a second and demonstrate this if i copy this on top of itself you see how it continues its tessellation similarly if i copy it you know to the side or up here it's going to tessellate itself over and over again and that's very deliberately that i've modeled it like this basically it's going to sit in each of these boxes and it's going to tessellate through all of these twisted geometries and hopefully give us a really complex outcome whereby the base geometry that we're using actually kind of dissolves and morphs into the greater hole that we're getting out and puffer fish so to put this sorry to put this mesh into these boxes we need to use the box morph component which isn't actually a puffer fish component it just sits in your transformation tab there in grasshopper and the geometry that we want to morph is this mesh the reference box that we want to mesh is this container that's containing our current geometry and then the target box is all of these boxes that we've created using the twisted box component so we'll drop that over there and you can see straight away that our little piece of geometry has gone and morphed itself into all of our twisted boxes in quite an interesting way so you're getting a pretty complex piece of geometry coming through here so the next little step that i want to do is i'm going to join all of these so i'm going to use the mesh join component like that so they become one mesh rather than 343 separate meshes so i'm getting an invalid mesh which is a little bit annoying but that's okay and then i'm going to use weaver bird i'm going to use the catmull clark subdivision tool how many levels do i want i probably want to have zero to three but i might have two actually zero two and then we'll give the option of three so we'll plug that guy into there and do i want to smooth the naked edges no i want to fix the naked edges i think so we will copy that and we'll make smooth naked edges a value of one plug those mesh curves in and what that will do is we'll just smooth out some of those geometries we've got here and output our final mesh i might just unify the normals because i'm pretty sure if we preview this we'll get all these weird intersections see see how we get this obvious change in geometry here if we unify all the faces by you by using mesh unified normals it should basically get rid of that awful piece of geometry there it's just turning all the faces to make sure they're facing the same way and then we get this really complex geometry like just um disable all the stuff we've done before this sorry oops disabled there we go so we can get a really good look at this guy oops preview on zoom and if we go into rendered mode we've gone and created a really complex piece of geometry from a very series of simple steps just using puffer fish so you can already start to see some of the potential of this plugin and its ability to quickly manipulate geometries and make them much more complicated than they could be in future tutorials we're going to take a look at some of these twisted box components in more depth and see what types of other complexities we can draw out using the puff fish plugin
Info
Channel: Grasshopper Tutorials
Views: 1,398
Rating: 5 out of 5
Keywords: grasshopper, Rhino Grasshopper, grasshopper pufferfish tutorial, grasshopper pufferfish, pufferfish tween, pufferfish twisted box, rhino pufferfish
Id: LFqACSeGsuU
Channel Id: undefined
Length: 38min 10sec (2290 seconds)
Published: Sun Sep 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.