hello hello hello and welcome welcome to grasshopper course for beginners I'll start with a little bit of an intro first from my experience in teaching ideally learning grasshopper is done in two wavs first controlled and structural learning where you gain technical knowledge about how the tools work and also you figure out what kind of a mindset one should have when operating these computational design tools and the second wave you learn by making you learn while making while doing things you begin a project and you struggle at every step there are things that you don't know and that you need to figure out you Google them you search for them on YouTube for tutorials on YouTube and you figure them out right and you push forward and once the project is finished you have learned those things and then you start another project and continue on the aim of this video is to get you over the first wave I will build up enough of a knowledge for you enough of a knowledge Foundation I guess for you to be able to do simple parametric models on your own the course will be divided into chapters so that you'll need a if you'll need a refresher you can easily just check up some of them here all of them here cut a portion of this video sponsored by PCB way hey we all design stuff but when it comes to making things that we have designed not all of us have a literal Factory at our homes this is where PCB way comes in they offer 3D printing even in metal CNC milling even in metal sheet metal bending as well as injection molding Services you just send in your files you get the price you approve the price your stuff gets made and sent back to you great service link in the video description below back to the video okay course chapters chapter list if you struggle find a chapter that you struggle with watch it again easy I'm not sure why I'm struggling with explaining this concept to you anyway we move on there are virtually no prior knowledge requirements for this course of course I do expect you to have basic understanding of rhino but when it comes to grasshopper we start from scratch Rhino for beginnner course by the way is in the video description below while I'm at it all scripts models and drawings that I've produced in this channel on this channel with this video included of course can be downloaded by the patreon supporters also Link in the video description below you'll be able to follow along without these files of course but it's a nice thing to have in case you get stuck somewhere and One Last Thing One Last Thing Before We Begin the mindset I think it's extremely important not to think about grasshopper as this T typical design tool for example if you're working on a design of a teacup with Grasshopper you're not designing the 3D Shape Of The Teacup but rather you're designing a system a set of rules a set of logic of how this 3D shape should be constructed should be made in the first place the shape itself is simply just an output of the system that you that you design was that good I a better analogy uh car a car you're not designing the car you're actually designing a factory that builds the car and then if you change a parameter within this Factory right a single parameter it can build then a different type of a car right parameters parametric modeling hopefully it's beginning to connect okay enough blah blah blah I'll save some for the outro but then you'll get what I mean for now let's jump right into it all right let's begin let's begin at the beginning so first of all I guess how do you start grasshopper in the first place so of course um there as with everything in Rhino there are two ways there's a tool you know a tool Icon Lounge grasshopper that's available in the stand standard tab right here or there is a command so you can just simply type in grasshopper and it's going to launch it for you if it's your first time launching grasshopper it's first of all going to take a little bit longer and second of all you will be presented with this getting started with Grasshopper window once you have launched it these are just simply tutorials by the developers to you know give you a very basic understanding of how grasshopper Works after you have finished this course this this video you can check these ones out as well as for a refresher um if you're completely new to grasshopper I suggest not unticking this show tutorial browser when grasshopper starts uh tick mark uh keeping it ticked just so that you can you always have access to these tutorials for now we will have have this closed all right so now once this is loaded in once grasshopper is loaded in what you see is an empty screen empty grass upper screen with nine three 3x3 um icons I guess in the bottom bottom center of your screen so those icons are previously used files I believe if I remember correctly if there are no files used then these icons will be the tutorial files um for using grasshopper uh but once you will begin working on your own scripts on your own definitions those will appear here the ones that are available will be green the ones that are that you have deleted or moved will appear red right so that's just color coding for now we will of course ignore this then uh simply just going through the menu to to explain like different clusters of the menu you have the typical program file edit view display solution blah blah blah you know you have the typical tab here or Ribbon I guess here and then under it you have a bunch of tabs that correspond to different types of tools like in rhino in Rhino you have standard C planes tab set view tab display select viewport layout visibility and so on all of these tabs which change the tools that are available for you you know so it's almost like modes in which you work in grasshopper it's kind of similar right you have your mathematics tab so all of the math formulas and so on are here you have your let's say surface tab everything that has to do with surface manipulation or Surface creation is here intersections tab anything that has to do with intersection of let's say two geometries you know all of that Math logic is here and so on so different tools different tabs you will immediately noticed that in your case you have much less tabs than I do and that's simply because grasshopper has an insane amount of add-ons and insane amount of plugins that are made by the community and it's great it enhances the the program it itself quite quite far um beyond the reach of how the vanilla software can can what the vanilla software can do but uh in in this case we will mostly be working with the base uh Rhino or sorry base grasshopper tools and we will only be delving into to some of these plugins uh at later stages of this course um for a for a beginner course I think learning too many plugins will be over overwhelming right so that's the general general idea of the this kind of UI logic is that you have this ribbon with the tools inside of it and of course there are different ways of how you can create tools which I will cover in just a few minutes and for me to continue explaining on the UI what we need to do is we actually need to create a node we need to make a single function inside of of grasshopper just so that we can actually save a document right save grasshopper the grasshopper file grasshopper files are saved separately but I'll talk about that in just a second let's go to the maths tab here maths and let's click on this addition node right here click right and you might see uh shall I do it again I'll do it again I click once on the plus sign here the icon with the plus sign and I click once anywhere on the screen and thus I place the node nodes are functions in this case this function takes two numbers and gives you an addition result so 10 + 5 is 15 we'll talk about that much more a little bit later so now when at least one node has been placed this has been converted into this whole grasshopper file it has has been conver converted into an actual grasshopper file which we can save so now if I go to file save document is not grade out I can choose to save do doent and I can save it for instance simply into my desktop and I can call it my first file right my first file and you can see I already have two files lamp and shelf grasshopper files on my desktop here so if I hit save that's it now uh this particular function has been saved and I can access it anytime I want I can also do I can also go to file new document file save document and I can save this as my second file hit save and now I have created two files so the question is how do I now go back to my previous file right do I need to open it or is it still open and the answer is everything is still open open right so here on the top right corner where you see your file name in this case my second file if I click on it there's also my first file right which I can select and now I just jump into the first file that we have created with the node right so grasshopper can run multiple uh files at the same time right it can at least it can have them opened at the same time that's an important thing to to know and to to understand um typically grasshopper saves outo saves after every node place so when you place a function or a node I'll keep calling them nodes grass oper saves your file great for Autos saving purposes for crashing this is excellent It's also very lightweight so the Autos saving does not really uh destroy performance okay let's move on let's move on to this actual node and what it does what's the reason behind it okay so nodes as I mentioned before nodes are basically functions grasshopper calls Rhino the functionality with that that you already have within Rhino as a function and can do stuff with that functionality with those functions right so in this case it's just simply adding two numbers together to give you a result um if if you don't see it in this view you know if the node appears different then you can fix it by simply going to display tab here in the top and these three or these two draw icons and draw full names draw icons should be turned off draw full names should be turned on uh let me just show you what happens if I turn on draw icons now the name of the node has been replaced by an icon and if I turn off draw fold names the result output the name for the output has been shorted short tend to R this is very useful when you want to make a compact physically compact script but it's really bad for readability of beginners so instead we go for display draw icons turned off display draw full names turned on tells you what it does tells you what's what right as I already mentioned a is input B is input result is output you always construct a script in Gras with a few exceptions but 99.9% of the time from left to right meaning you have some numbers here I can actually show you let's follow along follow along let's go to parameters Tab and let's select this panel tool right here click click the orange one Right double click the panel tool and type in 10 don't hit enter simply click anywhere anywhere else on the screen if you hit enter it's going to actually I can show you let's make one more panel click click double click and let's do 22 and this time hit enter you can see that when I hit enter it jumps to a second line and that second line will be empty so this is uh going to be I I think now there are let's click outside let's see if it's going to complain or not no it's not okay so there are already kind of checks involved that eliminate the the space bar or the empty line that we have created by accidentally hitting enter But previously uh this would have made this node complain uh in this case it doesn't so so we're we're kind of happy but just in case I'm going to uh delete that that that break the that new line uh so that we can we have just 10 and 22 if I hover my mouse over the top right corner or any corner of the panel I can shrink it right of course uh I forgot to mention apologies scroll wheel Zooms in zooms out right click and holding p ends the view there's no rotating with the left click and dragging you can select multiple nodes right now with panel uh 10 if I drag out from the right hand side corner or right hand side output of panel 10 click and drag you can see this uh wire appear while I'm holding the mouse button of course and I can select where I want to plug it in so I can just take it and plug it in into input a for panel 22 I can plug it in into input B and we have our now addition node adding up these two numbers and the the result is spitting out a number for us if I grab one more panel here connect result to the panel now we have the number 3 two being sped out a very simple function but hopefully helps you understand the the flow the data flow that that's happening here of course if I now double click on any of the panels and I type in instead of 10 uh 63.1 128 hit okay now I get the out output here 85128 right so it it's real time like it updates real time of course okay so that's that's that in terms of um like different types of nodes I guess um there there are different ways of how we can look at it first one being if I zoom into this node right here you can see that this one this in particular has a possibility to increase the amount of inputs right so there's a b and I can click this plus sign here plus icon here and now there is C so I can create one more panel 88 and I can plug in the you know one more input to the addition node not all nodes have that but most of the nodes that deal with addition subtraction multiplication uh that deals with lists of items they usually have a possibility to increase the amount of inputs or outputs that they have if you have some sort of a node that is um creating just a line between two points for instance then of course since it's creating a single line between two points you can't have three points you know for for that note right so it's it's uh um just keep in mind that that some nodes uh you can change the amount of inputs and output right and I have noticed by the way when when working with Rhino 8 in particular and grasshopper that there have been made quite a few changes to how nodes react to weird stuff that you're trying to do before they would break much quicker now they kind of just ignore you example would be if I were to just double click here in the panel and instead of number 22 we would use a number called cat or something like that you can see that it kind of just ignores you right and you know as as if it's not not even connected um before this would just throw an error and this this wouldn't wouldn't work I believe if we were to just create let's go for let's create some geometry and I explain you know what happens when you connect a cat to the geometry so if I were to go to Cur curve tab right here under Primitives let's find one that says Circle CNR oh by the way I forgot to mention if you click on any of these tabs right here Vector curve surface right uh so under curve if you click on this primitive sub tab then a bunch not a bunch but all of the tools in the subtab show for you that's the same thing as clicking this little triangle here next to let's say the surface tool brings you to all of the tools that are surface related in Rhino right so U back here under primitive Circle CNR click on that you know get it in here basically creates a circle uh around the center point around a normal Point around radi with a certain radius and that's it right so to give it a Center Point uh we can actually um it's it's waiting for us to give it a point but instead of giving actually giving it a point I can just lie a little bit and grab a panel so param tab panel by the way shortcuts let's start talking about shortcuts if you double click anywhere on the screen you can type in what you want panel right gives you a panel addition gives you addition CNR Circle CNR Center normal radius gives you that so in this case panel enter much faster than than trying to fish out the notes from here and we just simply double click here and for the center I can just type in XYZ coordinates of the point 0 comma 0 comma 0 hopefully it makes sense right so if it doesn't let me let me just really quickly explain uh if I look into the perspective tab not tab viewport um 0000 is located you know it's the origin of the world right it's located where the X and Y axis meet right so 0 0 0 is actually right here that that's the point right that's that's where it is and at least those are the coordinates of the point so what here we're saying is and that's all the point is by the way in the language of grasshopper or generally speaking uh in programming it's just a set of three numbers basically a location that's all Point has because it's a Zero Dimensional thing anyway so if I connect the panel to the center bam automatically this um node becomes light uh light gray right before if I control and disconnect oh yeah if you hold down the control key I I believe in Mac it's going to be the command key and you drag backwards so from Center you can see if I hover my mouse it changes the icon you drag backwards into the panel it disconnects so you will see that the node in this case was orange what why was it it was orange because basically if a node is Orange it's a warning that the node is not generating any output outs or that it's generating only partial outputs in this case this node was not generating a circle that because it didn't know where to generate the circle and because of that it was orange if I were to zoom in or I don't really need to zoom in in the top right corner of the node you can see this little balloon here icon here well note icon here if I click it you can see in uh it you can see why it's or you know if it's complaining it tells you why sometimes it's readable sometimes you don't understand what it wants from you even when you read it here input parameter Center failed to collect data in this case it's pretty straightforward Center no data no Circle give give give it the data yes Circle zoom zoom zoom zoom zoom Circle appears here in the middle of our uh world the question is why because Normal and radius are not we are not giving it anything right so how does it know what's the radius of the circle how does it know what's the normal normal by the way is a 90° vector or direction from a plane so if you have um if you have some sort of a book thing right a normal of this this surface would beop this right 90° that that that's the normal important concept uh is being used a lot in grasshopper not not just in grasshopper generally speaking is being used a lot so why does it manage and in this case by the way it's using normal to understand the rotation of the circle you know how is it rotated in the world so if I hover my mouse over normal you can see that it says one locally defined value 0 0 1 so in X the vector has zero strength in y the vector has zero strength in Z the vector has strength of one meaning that by default um normal is already predefined right and it has the vector Z right it's up upwards and that's why in this case the circle appears flat if I hover my mouse over the radius you can see that the radius of the circle is set to one by default right so this is one unit and of course I can I'll keep creating panels honestly if I create another panel and I say 1 comma 0 comma 0 that's a vector going in the X Direction you know aligning with the X Direction and if I connect that to the normal the camera doesn't rotate properly but you get the idea right now this is the normal direction for this circle if I give it a panel of a radius of 11 now it's a much bigger circle with a Rus of 11 actually so now if I change the radius to cat the node turns red red node means doesn't mean a warning oh nothing is being pushed out you know no geometry is being generated no no no it means you just literally gave me like a cat instead of a radius you know that that kind of an error where never is this going to work um unless it's like solution exception index out of range you will see that a lot and then you cry anyway that's later so now if I click on this error sign here data conversion failed from text to number always if there is an error always read the error it's going to help you a lot to troubleshoot so in this case Tech uh data conversion you know uh translating the data from text which is you know I I have a guess which which input is text to number you know radius wants a number we give it a cat doesn't know what to do with the cat we give it a number again is happy again right so a node can be white a node can be orange when it's a warning a node can be red when it's a error critical error and the node can be dark gray you still haven't seen the dark gray node a not is dark gray when well actually sorry note can be gray and node can be very gray okay I I'll explain it so a note can be gray when the preview of it is disabled when you can't see it in Rhino so if I select this node and I right click on its name here I have the preview option right which I can just click on and now the node if if I just click anywhere else the node is gray if I select the node right click on it and click on enabled and click anywhere else the node is very gray this means that the computer does not calculate this node at all it's ignored by the computer so it's disabled disabling a node and hiding the node are two completely different things because if if this circle is hidden it I can still use it in further operations for example don't do this but for just as an example if I want to then take the circle and move it along a z Vector with um with a slider you know um ignore ignore these but just just to clarify the circle still exists because we take it and we move it now along the Z Vector right with with a given number um if this circle was disabled this would be an orange this becomes an orange line meaning that there is no data code going through this line and this move node doesn't have anything to move right so it stops working it still gives a transform information so it's not orange but it doesn't uh get the circle so let's oh uh let's enable this and let's click on preview as well let's preview this um there is another menu uh that that you can access that helps you with this so if I select the circle and click a scroll wheel the middle button the scroll wheel button if you click it then you have enable preview here disable preview here at 2:00 around 2 2:00 or 1:30 right and then at 3:00 you have enable or disable and there's of course more options here that you I will teach you how to use in just you know just just a an hour or so honestly okay so that's that's that that's with the nodes let's move on so another important thing that I I should note is that you can have multiple things connected to one input you can so uh addition is kind of boring isn't it let's just delete it um you can just select all of them and just hit delete button or backspace also works and you can click or you can drag around select all of the the nodes and drag them around like so you know place them wherever you want and in this case let's say I want to make two circles right technically I could select all of them here like this uh this Arrangement here control C copy crl Ctrl V paste and drag it to the side and now this is my second Circle where I can change let's say the center position of it to be um 10 0 0 right so one circle is created around 0 0 0 point the other one is created around 10 0 point and the radius of the circle is like five or whatever right so I have two two circles sure I could do that but that becomes a little bit annoying to keep track of so instead um in this in for this example I will create I deleted it by the way uh I will create one more panel here double click and I'll type in 10 comma 0 comma 0 click a point at 10 0 0 and now I will connect the second uh panel into the center and you can see that as I connect the new panel the old one gets disconnected if I connect the old one the new one gets disconnected and so on doesn't work but if I hold the shift key click and drag and connect and release the shift key if I do that then I can connect two wires great honestly um later ju just for the sake of of P pedagogy um it's better to use one node in between here called merge so double click merge like that uh p panel goes into Data 1 panel goes into Data 2 and then result comes in into Center and you can see I I just really automatically clicked on this minus sign here um just so because I don't need the third input so I just release or reduce the third input it really doesn't matter you can you can have it anyway this is exactly the same thing as taking you know with a shift key as connecting the two panels into the center Mark except that in this case with the merge you know which one comes first so which Circle later you know these are two circles that are generated now right and if I were to create a panel here and I were to look at it like so you can see you know two circles are being generated so with merge I know that the first Circle in the list this circle is actually at 10 0 0 coordinate and second Circle in the list is at 0 0 coordinate right if I were to disconnect and connect them this way control to disconnect by the way control and drag backwards to disconnect so if I connect them other way around now the first Circle in the list or you know first Circle in this list is at 0 0 0 and the second Circle in the list is at 10 0 so I know which one comes in first which one comes in second if I just simply use the shift key to connect you know to Center visually I can't tell right I I go off to make some coffee or whatever I come back I watch my um my definition here and I I don't know which circle is which so of course there are ways of how you can figure it out but just generally speaking the merge command when you need to plug in multiple things into one um input is very very useful so keep that in mind okay now what if you want to actually not type in the coordinates here but you want to have a point somewhere in Rhino a point in Rhino that that around which this circle is created how do you link Rhino and grasshopper well first of all let's get rid of these uh these two coordinates and instead what we need to do is we need to create an empty Point container which we will fill in with a point from Rhino so empty Point containers or empty containers for that matter I'm going to cover them much more in depth in the next uh chapter but empty Point containers are container is located under parameters tab geometry the first one in the list point you can also double click and type in point to see it here it's a black hexagon icon all empty containers are black hexagon icons what I mean by empty container and I selected it by the way what I mean by empty container is that it does not do anything it just holds geometry right so it's not a function Circle CNR for example creates a circle addition adds two numbers together Point holds a point that's it references a point right but it for what we want to do it's excellent so this is going to be like a bridge then in Rhino we need to actually create a point there it's done um then how do you you know how do you take this point and connect it here well in for the point container you right click on it and you choose set one point and you uh then click on the point that you have created and that's it now you can see if I select this object here this node here it turns red the oh this is not red what do you mean it turns green uh if I select this point component here it turns green in Rhino meaning that these are linked and now if I just simply connect my point component to the center input here it is going to create a circle around the point and I can move it right wherever I move the point the circle moves can I have two points I land answer by having Five Points well five extra points I uh I will right click on this point uh component here and I'll choose to clear the values so I break the bridge clear values then I select uh or I right click on this point component again and I choose to set multiple points not one point multiple points and I just simply drag around all of these it's going to give you this kind of weird zigzag it basically just tells you you know this is going to be the first one the second one the third one fourth fifth sixth in the list that's fine we don't care we hit enter and now six points generate six circles it's weird that they are vertical so I'm going to change it from Zer from one Z 1 0 0 to 0 0 1 so Z vertical if if the per perpendicular Vector is vertical that or if the normal Vector is vertical that means the circles will be flat it's always 90° like that right so now we have a bunch of uh points and a bunch of circles created around the points I forgot to mention that if you select a node it's going to show that geometry you know that the node has that the node generates uh in green right if you don't select the node it's going to be this this red color so for instance circles not selected uh the node is not selected right now they're all uh brownish reddish color and then if I select it it's it turns green and select brownish reddish again okay so that's how you reference stuff into grasshopper how do you get it from grasshopper back into rhino because you should right so in this case the circles that are generated let's get them back into Rhino right right now I can't operate I can't select the circles in Rhino I can't do anything with them in Rhino because they only exist as part of the system in grasshopper right we need to manufacture them to bake them so if I right click on the circle uh output here and I choose to bake right here egg uh it's going to ask me what's the layer into which I I bake and would I like to group them up everything else is whatever uh if I would like to group them up so yes please I would like to group them up I would like to bake them into the default layer and I just hit okay poop and now I can now they have been baked by the way I can select them and I can move them wherever I want right I have my circles in Rhino and you will notice that you know sure I baked them out you know I got them into Rhino but they still exist in Grasshopper And that's because yet again grasshopper is not a 3D design tool it's a 3D design system I'm sorry it's a system tool for 3D design meaning that now I can change the panels to let's see sorry to the radius panel to six I can bake this again with radius of six right so you basically are just freezing um the output or or sorry you're freezing the system and you're outputting the current state of the system right uh back into Rhino any geometry that has been baked in Rhino will not automatically update if you update your your grasshopper file right so most of the time you have um you only work within grasshopper and only at the last step do you bake it into Rhino to actually you know produce drawings or whatever um or manufacturing uh the detalization not the documentation uh documentation for manufacturing in Rhino right so that's baking a shortcut to bake is the insert key on your keyboards that baks uh not group geometry but it baks immediately to any active layer that you have so insert key in your keyboards usually located above delete the delete key also um to bake something you can click the scroll wheel you know hovering above a node double uh just click the scroll wheel and at 4:30 o00 in the radial menu you'll see the bake tool right here okay what else I think that's that's about it that's about it with with the basic user interface I guess I can just simply show you a few a few little little tips and tricks so the first one is under display under canvas widgets you can click on this profiler the profiler will okay it doesn't show anything one second if I extrude okay there we go so I had to give it a little bit of a heavier task so in this case extruding the circles and the Z axis unit z um along the Z axis um and you can see it says 6 milliseconds so under display canvas whiches the profiler um calculates how long does each node take right how long does it take to to calculate and it's a very very good way to see if you have some nodes that are just destroying the performance and to troubleshoot this is going to come in handy of course much later so that's the first thing that I wanted to show um don't forget even though the Autos saving does indeed work and it's great but don't forget to file save document you know have it saved um the points that are currently referenced right from rhino file if you open up this grasshopper file without the Rhino file present uh this will complain because it won't be able to find the points that it should reference so of course the Rhino file should come together you know with Grasshopper file so I will go to file save as desktop I'll just call it my first uh file RH for Rhino hit save alternatively if you don't want to save the Rhino file and you just want the points to actually be you know hardcoded in or or to live inside of this node you can actually rightclick on the Node on the point node and you can choose internalized data which will it will break the link between the points that you have here and the points here but it's going to basically save the data from here in this node right so let let me show you right now I still have the points here but if I right click internalize data I can now select these points simply delete them don't need them just have all of them deleted and this still works right and now if I select this by the way it gives me the option to uh still move the points but now they are completely within grasshopper as long as you're internalizing points or Curves it's fine but keep in mind that you can really uh slow down the system if you internalize too much right so I would strongly suggest Simply Having a rhino file um paired with Grasshopper file and grasshopper just simply references geometry from the Rhino file rather than having it internalized okay okay there's a scribble tool this pencil thing here where you can draw stuff hit that accept that really doesn't matter uh it's it's very useful for when you need to write down notes when you're explaining things and I'm sure I will be using it but just for the general design you know purposes doesn't really uh it's not really necessary for teaching for sure okay enough blabbing let's move on let's move on to talking about what kind of data types we we have all right let's talk about containers then and about about referencing or geometry types I guess within the containers um that these empty geometry containers and I say geometry containers because that's what we will be focusing on the purpose of this chapter is just to give you an understanding of what kind of node in this case we created point the point node but there are more clearly there are much more nodes that you can use to reference things what kind of notes should be used to reference things so a very very easy answer to it is just go here to the geometry tab parameters tab geometry subtab and find the geometry node black hexagon icon place that and that's this note can reference literally any 3D geometry that or any geometry that you have in Rhino let me just place a Point Place a line place a poly line a curve perhaps a box a surface what else Let's uh create a mesh or rather let's create a subd shape like that and let's create a mesh mesh mesh mesh sphere whatever okay so we have all of these geometries I'm not sure why the curve just went went down whatever we have all of these geometries I can select all of these geometries right click on the geometry note choose set multiple geometries and it literally can just reference all of them so this is like foolproof way of how to get run know geometry in grasshopper without really thinking about it the clear drawback is that now you have a node here that has a crap ton of different types of geometry so you will need to be filtering it out somehow because now I can't really use this note uh for the circle is going to complain like crazy right it does give me output a circle on the point it does so sure but then everything else it just throws me error you know null null null null is basically error null n n n n n null right and this is never a good thing to later deal with all of these uh nulls in the list right so while geometry node is very very powerful um in in terms of just getting geometry in here referenced without really thinking about it it's also messy so how do you make it cleaner well you need to use a type of geometry you need to specify what's the type of geometry and there are five five main ones type number one we already covered this point I'll just double click type in point start getting we need to get used to typing point right and clearly you know if I right click set multiple points and drag around all of this only single point gets selected right here right then for under geometry tab I can find curve so this is zero Dimensions uh Zero D okay let scribble scribble is a useful um little tool here where I can just write Zer D like that is basically for note taking and curve is onedimensional object meaning that point does not have any Dimensions curve has a length so out of these what has a length this straight line segment this Jagged light segment and this curved light segment line line segment all of these right click set multiple curves are curves so I noticed that students tend to think that curve component Can Only Hold curving things you know uh things that are swoopy curved but not really no not at all it it can hold poly lines it can hold line segments um curve component deals with onedimensional objects such as curves then then then then then then you have this box and you have this surface a surface is a two-dimensional object and a box is a threedimensional object for surface uh you could use honestly you could use a surface tool surface tool or Surface node right right click set one surface bam it's here or you could use and uh actually that is a 2d Tod thing it has a length and a width but you can see that I'm kind of putting surface here a little bit lower uh and making room here for one of the other main ones which is a BP B boundary representation if I hit enter here B can be both a surface and a poly surface a box or whatever a sphere a sphere is a Surface uh duck that's shaped a nervs geometry that's shaped like a duck or whatever right so B is basically you can think of it as poly surface that can also be made out of a single surface right click set multiple BS oh sorry I should select both of these set multiple BS and now we have you know uh both of these referenced by a b so while surface is surface is kind of a part of it part of a b so a b can be 2D as well as 3D geometry right so it can contain surfaces but it can also contain unclosed volumetric object as long as it's uh nervs all of the nervs stuff all of the polysurface stuff is B okay moving on two more we have a mesh and we have subd well that's what we're going to use mesh black hexagons don't forget actually I want to experiment if I select subd can I reference it as a mesh no that's a no I can only reference the sphere and then for uh subd you also use black hexagon icon for the subd you reference that as well okay so now we have 1 2 3 four five main ones and the nerves geometry has like a sub component that's surface if you want to specifically only reference in two dimensional object objects without referencing in threedimensional ones right so and I guess I should also say like that geometry can be anything right so this is like the mindset that you should have when you're referencing in stuff what's the dimension and what's the type because you have nurs you have meshes and you have subd right of course there are components you know there are much more components here like Point clouds and you have fields and block instances and you have Primitives such as booleans and integers not all of them are used for referencing geometry in the first place some of them are just containers that can hold geometry uh for example here we have the point component and I can just simply say well actually po Point component goes into an empty Point container and now this point container also has six points right so there are instances where this is useful this kind of methodology is useful so that's why we have um containers for literally anything any type of data that you can have in uh Rhino uh in grasshopper well both actually both in Rhino and grasshopper um I guess the daddy of this geometry node would be data node under primitive data because if I right click um maybe I can't wait set no no it won't let me okay I thought that it's also going to let me to reference in literally everything in in Rhino but it doesn't but I can do this I can take the geometry node and I can literally connect it to the data node and it doesn't care it it's just going to parse through the information so it has the capacity to hold everything that the geometry node does and also cat with the shift key and if I were to check not just the geometry but also Al textual information right so the data node is actually able to hold even more stuff like numbers and text and and so on fields um so this is like the overall the umbrella node that can be used for you know referencing well not referencing you don't use it for referencing as as I showed you but uh that can hold literally everything that Des scan and even more okay I think we're starting to scratch a little bit too deep uh right now I'm actually going to keep this we're starting to scratch a little bit too deep so I will stop here and hopefully you know this is going to be this should be enough all right and while we're still on the topic of data and not data management but just generally data that you can work with in grasshopper I think it's important to also cover this input uh subtab right here so this is what kind of a input data can you generate in Grass oper to later use so at this point in time we already know the panel right we have used the panel here to input numbers we have also used in some examples I have also used the panel to input text right so panel is useful for text and numbers and also honestly panel is quite used for useful for checking what kind of a data is generated by different nodes you just hook up a panel to for instance the output of the circle CNR and you get a list of circles so you know that it's um six circles that have been generated by this circle CNR node a shortcut to creating a panel is if you double click anywhere on the screen on Grasshopper screen and you type in SL slash two slashes then that generates or that suggests a panel that's a shortcut right SL slash also panels can have if I were to type in dog cat Mouse 1 2 3 like that if I were to right click and untick this multi-line data uh option a panel can hold a list of things as well but I will cover this much in much more depth in later stages of this this course so for now just think text and think uh numbers and also of course three numbers corresponds to either a position or a vector so it can go a little bit um how do you say uh a little bit more uh complex than just simply text and numbers moving on uh here you can see under the input sub tab you can see uh a number slider if I select this and I place it here right a number slider is basically it always generates a number right and you can slide it that's the number slider from left to right and you can adjust the number right in this case by default the number slider generates a number between zero and one and you can choose whichever you you want if I were to delete this um panel for the radius of the circles and I were to connect the number slider here I will need to zoom into this you can see that the as I change the number sliders input the circles you know change in radius of course right how do you control the number slider well if you wanted to generate a larger number than one well you right click on it anywhere you click on edit and here you you access the options for the number slider right so the first one being the name I can call this radius of circles right and it's going to um if I'll just H okay to show you it's going to change the name of the number slider uh for clarity purposes this is quite useful especially if you tend to forget you know what different number sliders are controlling you can give them names I strongly suggest you do so it's a overlooked feature but definitely a useful one then here we have an expression an expression is um basically you could say x * 100 right like that hit okay and now you can see that that whole um range between zero and one has been multiplied by 100 so you can bake in a mathematical function uh let's go back here you can bake in a mathematical function that takes a number that you have in the number slider and multiplies it by for in this case by 100 but you can also do a square root of it and and so on right in this case I will keep the expression um empty grip style shape and text usually we just do that we have shape and text if you just choose to uh choose shape it doesn't show you the the actual number that you're getting so we usually want the U the Little Dot as well as the number just to get give us as much information as possible so shape and text then uh before I go for the accurate see let's look into the numeric domain this is the range this is how far the slider can go right so what I can do is I can say well between zero and let's say 100 right so I can change this to 100 you just double click on it hit okay and now I have a a slider that goes between 0 and 100 easy peasy edit you can also of course the minimum can be minus 100 I wonder how that would work yeah it just inverts that's fine right so now it's between minus 100 and 100 edit now uh of course numeric value is the current value that is set and you can adjust it to any value you want if you want to be accurate you double click on it and you type in you know 50 and now it's going to be set exactly at 50 double clicking this well I'll show you but that is also how you can set the precise value and and then we have the rounding so usually you have either a floating Point number that means a bunch of digits after the comma you know it has accuracy and you can choose how many digits after after the comma does it have like that so so that's the accuracy or you use a uh integer number so it's full numbers right it has no digits after the comma for for this kind of application I do want to have digits so I do to have a float number so I'm choosing that with two digits after the comma hit okay and now it's set to 50 right with a certain accuracy attached to it I can also uh as I mentioned before if I double click on the Range here I can type in whatever you know 25 I can type in whatever number I want right so if you want an accurate rep some sort of accurate number and you don't want to wiggle the mouse too much then you can adjust it this way of course a number SL can be enlarged right to give you a more granual you know movement I guess right more accurate movement now on to shortcuts that we can use with the number sliders so if you type in if you just double click anywhere on the screen and you type in the number 50 hit enter you you immediately get a number slider right that is set to 50 and the range of it is going to be between zero and 100 because 50 fits quite well between 0 and 100 it automatically guesses what's the range that you want if I were to type in double click type in 50 50 or 51 2 3 let's do this so four digits after the comma enter Then then it generates a slider with that amount of precision with the same range between 100 and zero right so for instance if I were to do a slider 10 10 one then suddenly my range will be between zero and a th000 you know it it tries to tries to get what kind of range you want if I were to type in nine slider with nine that's going to be between zero and 10 right so how do we um pred describe the range while we're generating a slider that's quite easy actually I will double click and I'll type in first you type in the minimum range how you know what's the in this case we're dealing with radius of circle so what's the smallest radius that you um want to have let's say six right then I type in dot dot six dot dot then I type in the the actual number that I want let's say 20 5 dot dot again and now the maximum 55 so the full syntax is 6 do do 25 do do 55 minimum is 6 maximum is 55 the actual value that we will get currently is 25 I hit enter and that's what I get a slider set at 25 between 6 and 55 I can connect it to the radius like so so that's the slider input and now you know everything that I know about sliders okay moving on besides sliders and panels you also have like multiple different um in instances I guess or not instances apologies you have multiple um possibilities of how you can input different types of data and or rather how you can manipulate data and these are most of uh most of them you learn about once you really need to learn about them but I will cover um four more uh really quickly and then all the rest we will cover once we actually need them because calendar or clock I don't I don't think in 10 years I have ever used the clock in grasshopper anyway bullan toggle this bad boy right here this is true or false statement toggle where if I were to SL slash panel if I were to hook up a panel to it it just gives me false or true statement meaning um it's it's quite useful if you you have certain nodes that are asking you for instance polyline the polyline node right asks you for a bunch of points uh since we have points here I can show you so I'm going to really quickly actually I'll just borrow those contrl Ctrl V so these uh six points right here I'm borrowing them and I'm connecting them to the vertices vertices and points are virtually the same thing right so I'm connecting them and it draws this polyline for me let me hide the circles real quick to hide them I right click I click on preview or and unclick preview right disable preview so I have six points and it draw a polar line through those six points and but here I have this Boolean which asks me is the polar line closed or not should I you know connect the last segment between the last point and the first point and here let me just grab this like that if I connect this as true it creates the segment if I connect this as false it doesn't create a segment so so this is a way and of course you don't need a panel for this the panel just chose uh there we go um so this is a very useful thing that you can you know you can use to to generate or not to generate but to input yes or no statement another way of how you can do it um like true or false in grasshopper is literally either zero or one so if I just do SL slash one enter it automatically generates a panel that has one in it and I can connect that to closed and now it reads this as true if I change this to zero it read this as false if I use three or 325 it's true anything other than zero um is considered to be true uh zero is considered to be the false statement so technically you could also use a panel for that uh let me just check one thing okay that's true and if I type in false okay so you can literally just write in the panel as well true or false then we have this button button is basically the same thing as Bull and toggle but it works in a little bit different way if I just connect the button to here you can see that it's always false except for when you click it I I should click click and hold so that you can see if I'm clicking and holding my mouse button it's set to True at any other given time when I'm not clicking and holding it set to false so false click true release false this is very useful for nodes that need a special trigger to run uh in the future especially in simulations you will see those kind of notes for now we just know that it exists and we skip over it okay moving on we have our control knob which is basically this the same kind of a slider thing except that you can just keep keep rotating it right until you know you you reach the the number that you want and of course you can edit it and there are exactly the same ranges and minimum maximum ranges and so on that that that you have in this uh number slider you have the same thing in the control knob I have noticed that some people tend to use the control knob I personally never do so I will not talk about it as much just know that it's an alternative you know just like we have the number slider we have the control knob I guess and the last one is digit scroller if I plug this in here you can see that it's at 0.25 and I can just make adjustments to the digits like so cute quite useless in my opinion if I oh I can't even edit this that's weird but I guess you know the the useful thing is that you can choose which digit do you do you adjust at which given given time but whatever number slider is where it's at and Boolean toggle is where it's at so you should focus much more on those as your learning you know the the basics of grasshopper so those are the main inputs of course there's more and you can use a color swatch right so for this polar line if I were to use some sort of a custom preview you don't need to follow along with this and I give it a color swatch as its material now you know the polar line is drawn as white and I can click on the color and I can adjust it to be drawn you know in any any color I want so that's uh of course there are much more inputs than just simply numbers but for creating uh numbers or toggles but for creating geometry usually it's you just use sliders you know you just or panels um so I I will be skipping over these and I will be revisiting them once we actually need them okay and I think that is just give me a second yes I think that is it with the data types and the inputs and the um what kind of data does grasshopper use and we move on to the next chapter all right let's do some basic operations now so I will be deleting all of this in Rhino just so that it's not in the way and I will be keeping these guys right here um just so that you know if we need to we can look at them back at them uh I will just group them up oh I should probably mention how do you group things so if you select a group of data right a group of nodes just like that and you click your scroll wheel the middle button at 12:00 you here you will see the group option if you select this group option it's going to draw a group or or this rectangle around your objects then you can if you just click anywhere on the rectangle and you drag it you're dragging all of the objects together the nice thing about it is that you can rightclick on this group you know anywhere on this rectangle and you can name it so I can name this data types hierarchy that's not how you write hierarchy but it is what it is right or is it I'm not sure so data types hierarchy I can also right click and I can choose that the outline should not be a bounding box but rather should be a blob outline right right for more organic um definitions I guess in this case I will be using a box outline we use groups quite a lot to just color code and differentiate different parts of the definition of the grass oper script just to make things easier for us speaking of colors if you rightclick on the group you can choose to color and you can choose whichever color you want all right so I will do this right click color drag it over here or rather this should be white as well because it all belongs to the same chapter so the first chapter will be white like that and then I will just select all of these and group them up all together right so now I have the large group here and I have like subgroups inside of my large group quite a useful thing right moving on uh let's select everything in our grass oper script click the scroll wheel anywhere middle Mouse button and choose to disable preview this inherently will just hide literally everything that was selected so you don't don't see it just helps okay and now we can move on to um Regular uh not regular but basic basic operations or simple operations we'll start with non-geometrical ones where I just explain I guess at this point you already kind of get the sense of it but this is just to lock it down um and their math I will just explain um a few operators here and how they work and how we can um yeah uh how you can operate with them so somewhere on the right hand side let's create a slider that is going to be just double click that is going to be uh between 5 dot dot 32 dot do 50 right 5 do do 32 do do 50 so minimum five maximum 50 currently set to 32 let's create another slider that's uh or actually we can just borrow this one so I'm just going to select it crl Ctrl V you know make a copy of it and maybe change the slider to somewhere closer to 20 something like that I can add them up by either going to operators here and choosing to uh choosing addition or I can just uh double click anywhere on the screen and just use the plus sign right for addition like that connect these two and let's create a sphere right so this let's say this is our um mathematical kind of equation for calculating the radius of the sphere so then I can go to surface tab go to primitive sphere you can also of course just type in sphere and choose that one right both work asks me for a base by default the base is set to the world XY 0000 0 position and it asks me for the radius so I connect the result as the the radius right and I have myself sphere and of course now if I change the radius of it oh sorry if I change either one of the sliders the sphere radius changes super simple you know works exactly as how you would think and this really showcases left to right you know uh flow of of of within grasshopper so let's say we have this addition here uh back in the map there are of course multiple operations that we can do that we can use for example I can divide it so Division I can divide it by a number let's say five five times less right and now we are adding up these two numbers then we are dividing them I can show you the with panels so SL slash to create a panel uh 31 + 19 is 50 ID 5 is 10 and I have a sphere with radius of 10 right then I can also take it and I can produce apologies give me a second I can raise it to the power of uh two for example you know so so I can uh get get get the power of two of 10 which would be 100 and and and so on right there there's like multiple multiple mathematical formulas that we can uh get from this if you're really into it you can also um where was it give me a second was it utilities no trigonometry no scripting evaluate expression there we go uh you can also write an expression right which you know if you really want a heavy mathematical formula uh you can write an expression here I would suggest not to honestly because it can be you know X Plus U uh y um divided by Z in Brackets X and Y in Brackets like that of course XY and I need one more variable that I change this to uh Z I believe I'll just name this y name this X like that invalid name only use on what it's not okay anyway and then if I connect this this should work yeah it does work and then I get the same result I don't know why it was giving me an error uh I think just plugging in different values triggered the uh recalculation of the node so now now it's happy and now I can use you know this this mathematical equation instead of of of these two nodes right which does exactly exactly the same thing so I I see a lot of people use this uh but I personally prefer to honestly I I I prefer to use this instead that this just for me I don't know why but for me that that flow of what happens after what you know first we add then we divide then we get the radius much more clearer than trying to read a complex function but it is there you know the possibility is there right so that's I'm just grouping it up that's the non- geometrical kind of simple operation that I wanted to show you and now for the for a geometrical one let's do a easy easy simple one I select all of these I click the scroll wheel I choose to disable preview I also group them right so this is uh simple operation uh non geometric or math let's just call it math right then for uh something a little bit more geometrical let's just get um one second I'm I'm I'm just really quickly thinking let's just get some points in here so in in uh grass in Rhino apologies so I'll just grab one two two points in Rhino right here the gap between them doesn't matter I'll just put them in into grasshopper so I create a point component Point container you already know this right click on it set multiple points and as long as I have these two points selected already will put them in if I didn't have these points selected in Rhino then it would minimize Grasshopper And I would actually need to select them hit enter and then we would be at the same uh at the same page okay so I have these two points let's say one second I want to create a line between them how do I do that well the logic is that you go okay a line is a onedimensional object it's a curve so I go to the curve tab okay that's it first step second step is okay it's not going to be an analysis I'm not analyzing anything I I need to create a thing so it's going to be a primitive right either a spine or a primitive honestly so I choose Primitives and here just looking through the icons I see this create a line between two points you know there's two points shown and a line I have two points great so I used it I can also of course type in line and just find it it's super useful when you hover your mouse over a node uh over any apologies any icons to just read the description of what those nodes do create a line between two points great that's exactly what I want right so this uh this note right here asks me for start point and an end point but hey there's a problem and the problem is that here I have two points in one node and here I need two separate inputs and I can't really do this you know it does doesn't work doesn't create a line that's because there are now if I plug it in like so uh since there are two points here there are two start points and same exactly same two end points so the line between two points no does not know what to do or rather it creates two line segments that are zero and length but it doesn't matter right you want one start point one end point so we need to I'm holding the control key by the way to separate this we need to somehow separate this list of two points into separate outputs right into point a and point B output and technically you you might be thinking oh yeah you you could just do this right set one point set one point right and now I have one point here one point here and this would work indeed right but usually what you want is you want to have the least amount of uh reference nodes that you can because simply re-referencing stuff is very annoying so in this case we have two points in one node and we just need to separate them in grasshopper right the way you do it is with a list item I will be covering lists in um I I believe the next chapter something like that but for now all you need to understand is we have a list of two points and if I use list item node right here and I connect my points to the list then by default the list item will spit out the first item on the list with because by default the index is set to be zero and these numbers here on the left hand side that you can see in the list those are indexes basically the number at at which position in the list does the geometry exist right so in this case by default index is zero here meaning that it reads you know the first point from this list and it spits it out and I can use that as my start point the question is how do I get the second point you know how do I get index one well I could create another like I could just do this index one right and that would give me the the the second point on the list but a much much faster way is just to scroll into this list item Noe and you click on this plus sign here insert parameter and you can see it says plus one right so if my index here is zero right and SP the first item then plus one means that it adds one to zero so this is index one which is the second item in the list and we have our endpoint so this is how you separate out a list right now as I have my um my line here right I can choose what what I want to do with it right so so for example I can create a pipe right I just double click and type in pipe I can also go in here uh where was it curve no sorry pipe is a Surface uh under Primitives I believe that is not under Primitives utilities oh no please don't start struggling no no no no no no no okay under free form pipe exists right asks me for a curve a line as a curve a type of a curve connect that immediately gives me the pipe here which I can zoom into a radius that's going to be a slider um let's say two dot dot uh 22 dot dot 222 enter slider between 2 and 222 connect that to the radius there we go there's our pipe that I can control basically makes a cylinder right and then for the caps you can see if I hover over the input of the Caps it has um suggestions it has a suggestion of what kind of inputs you could have if you give it a zero it says None no caps will be created if you give it a one a number one it's going to create flat end caps if you give it a two it's going to create round end caps so since this is like um a value that I will not be changing that much I will be creating a panel with a number let's say I want flat Caps or Let's do let's be fancy let's do round and caps those are by the way very heavy so um be careful when you have a lot of Curves in the future but uh I will do it so I just do SL slash two because two was round end caps right like that like that and now I have this pill looking thing right if I change this panel now from two to one it gives me the flat end caps if I change it to zero it gives me empty you know no no end caps uh side note wait two uh side note a nervs pipe tool is the heaviest way of how you can create a pipe I will talk about this a little bit more later but the multipipe tool is the the fastest I I would say or mesh pipe but mesh pipe tends to become messy so multipipe tool is what you want if you have like a huge network of Curves uh multipipe this bad boy right here as you can see much more uh settings much more inputs but gives you a much more controlled subd geometry not nerves subd but subd can be converted into nerves very very easily okay so that's that now let me show you exactly the same thing let's group this up and hide it and let me show you exactly the same thing but with more than one point uh more than two points because right now what we have is we have two points we create a straight line and we pipe it but what if you want multiple points I already kind of showed that here we have six points and a polar line that's you know creating that that's being created through those six points but I will show it again in a much more controlled or pedagogical way so I will be reusing these two guys right here but I will also be adding a third one or maybe four let's do four so four points in total I will right uh double click type in point get a container in here right click on it set multiple points and then then I will not just drag over all of them Al together I will very meticulously select which one is first second third and fourth because that is how it's going to be read when it tries to draw a line through them right hit enter and then now through this I can draw a poly line poly line that's easy right but the polar line tends to be quite uh naughty when it comes down to piping actually I kind of want to check it out how it's going to work so I'm going to contrl Ctrl V copy paste the pipe tool connect Polar line to the pipe tool check it out and you can see that you know when when it has a pretty sharp turn with a large radius it tends to um crap the bed as they say and if I increase it even further it breaks all together right so that that that's an issue so for now I'm deleting that so polar line um it's not great not great instead of a polar line for this kind of application I will be using a nerbs curve and there are two ways of how you can create smooth curves uh through a set of points there's the actually let's go here under curve under spline there's the interpolate curve and then there's the nerves curve and of course there's like a more advanced uh interpolate curve but we we one step at a time right what's the difference between them a nervs curve if I just get get it in here and connect my points to it ma'am uses these um these points as weights right so it's exactly the same thing as me taking this uh control Point curve here and just drawing through the points enter just drawing through these points you can see the control points of this curve uh being used right and of course I can still use it like that alternative to this nurs curve is interpolate so under spline I have this interpolate tool which also asks me for vertices again veres are points like that and you can see that interpolate actually forces the curve to go through the points so it really depends on what you're after and which you know what what kind of a geometry you want to uh create sometimes you want the your your control points to be weights or anchors I guess of a nervs curve sometimes you want your curve to really go through the points so you choose either one of these for this particular example I will be using the neres curve right um nervs curve can have degrees right you can specify a degree um anything beyond three is for you as a beginner is not important I almost never use anything beyond 3 Dee curves so what's a 3° curve in the first place well let's create a slider between one dot dot uh 3 dot dot 3 a slider between one and three set to be at three hit enter right we have the slider it can be one two or three and I'll connect it to the degree node here uh input sorry to the degree input here this is at degree 3 it's a continuous curve that cannot be exploded into separate segments degree 2 is a non-continuous curve that can be exploited into segments that it's basically a curve that is made out of arcs right well in this case I guess that wasn't the the is that an arc well pretty close but it the the idea is that it can be exploded into segments that that's the main idea right most important one right so that's degree two while degree three is is continuous and always perfectly smooth uh degree 2 is smooth but is not necessarily continuous it's made out of segments and degree one is a polyline sharp edges between them right so technically this and a polarine tool are literally the same the same thing right right then the last bit is in here we have this periodic curve toggle so which is literally a remember periodic closed that's a toggle a Boolean toggle it asks us is it does the end do the end points connect right so if I choose that it is periodic so let's just type in toggle Boolean toggle like that connect it double click on the false then it closes off the curve for us and we can kind of adjust it something like this perhaps you know you you are able to make a blob blob kind of a thing there we go banana well crappy banana and then with this curve done uh we get three outputs first we get the well it it says that it's a periodic and a planner curve and it's planner because it's flat right if I were to move this up like so now it's going to say only periodic curve it's not planner anymore uh perhaps you don't see it I'll just create a panel it says periodic curve now if I have all of the points in the same plane it's going to be periodic planner curve right flat if it's planner it means you can create a c surface inside of it very easily by using uh boundary surface I'll cover that a little bit later then we have the length of the curve 512 mm and we have the domain of the curve 0 to four I have no idea what that is what that makes no oh is that a points okay that's cool okay okay okay okay so that's uh the 0 to four is the the amount of like control points that it's using and if we don't have it closed then 0 to one I will not be explaining that because I have no idea what's the logic behind it I've never in my life used it okay we continue curve and length is the things that we use right so now let's do the exactly same thing and let's create a pipe through it I'm lazy so I'm just going to borrow this or actually no pedagogically let's actually create it again pipe tool bam curve connect to curve radius uh 5 do dot 25 dot dot to 100 that's going to be the radius and then the Caps uh SL slash2 for the Caps right if the this is not periodic then the end caps are um Whatchamacallit I'm I'm going to get there give me a second the the end caps are around it if it's periodic it doesn't matter because it's you know um looping onto itself and you can see that the pipe is you know trying its best let's let's call it like that it's trying its best to you know not self intersect but uh typically it does uh you know especially if your curve is uh bending at a steeper angle or the radius of the bend is steeper than the radius of the pipe clearly you know Ma just geometrically speaking the pipe will be self intersecting right so you just need to you have a limitation of how thick the pipe can get you know when you're bending it so much right so now we have ourselves a nice little pipe tool here okay this was like a little example I guess of the workflow and of the logic of how you can take stuff in how you can manipulate it and how we can convert one thing to the other one last thing that I would like to mention be very important one that I would like to mention before we move on is that students tend to forget that okay here we have the pipe right but the nerves curve does not disappear anywhere like it's still being generated still here right if I hide the pipe it's you know it's not like we are um the moment we use the nervs curve it's not there anymore right it is there which means that then you know on this curve we can say um what would be a good example let's see uh we can say divide curve we can use divide curve component here and connect our nerves curve to The Divide curve component which automatically since this is set to be 10 it automatically will give you 11 or 10 segments like these segments here and 10 segments corresponds to 11 points because the start and end points don't match up anyway or wait will it if it's periodic oh if it's periodic it's actually 10 points if it's non- periodic then it's 11 points because the end point Point don't match up right so since we have it periodic since count is by default set to 10 we get 10 points if I change the count to 50 you know 50 points and so on so we can do uh we can do this and then on top of these points we can create spheres sphere come on come on and we can use these points as the base for the Spheres with a given radius of uh if the radius of the pipe is 10 so let's say 15 bam right so now you will have um and actually let's let's let's uh have less of them right so now you have um a pipe and spheres going through the pipe and of course it's a message geometry but it's this is just to show you that the the curve can be you can be reused for multiple things and also just to show you that when you are creating a large definition a large grass oper script start hiding things that's important to join the because it's going to overwhelm you with amount of geometry that will be present on the screen um to join in these four nodes into the existing group you just select them you right click on the group and you choose to add to group and then they are joined disable preview we're good to go uh so that single operation math um simple simple operation um pipe simple operation curved pipe right and all of that is grouped under I I want to group it hello grouped under let's do like greenish color and simple operations okay so that's our um second chapter or third chapter I lost track uh completed now we can move on to a little bit more tricky things such as lists and vectors and planes next chapter all right let's talk about lists and domains two quite quite important Concepts to get a hang of so domains all of the tools that are domain related are located under MAF under domain here and all of the tools that are lists related are located under set tab list as well as sequence to a certain degree right so for example let's in the top view let's just create some sort of a curve doesn't matter what kind of curve just a curve right and let's reference it in as a curve set one curve select it I'm just creating a this curve container right you have done this quite a bit by now so you should understand how it's done um then this curve I want to create a bunch of points going along this curve right so what I'm going to do is I'm just going to say divide curve divide curve into equal length segments perfect theide curve curve connects to curve and by the way uh when I type in divide uh there's divide curve divide distance divide length there those are different ways of how you can div wide uh curve in our case we are just using the wide curve simply because um that do the simplest one uh it the distance between the points along the Curve will be uh the same right then we have uh count that's how many segments there are not points important not points but segments so if I were to use count of five like that you will see one two three four five sure but then if I count points 1 2 3 4 5 six right there's always one extra point at the end because that's the you know the end point you start from the start you know and the last segment has an end point right so no matter how many um no matter what kind of a number you plug in to the count for the Divide curve as long as it's not a closed curve it's going to have one extra point that you will need to account for so six actually seven points right so we already kind of touched upon this but how does grasshopper actually um showcase or or work with multiple outputs you know because suddenly this not mod is not generating a single point it's actually generating seven points right also seven tangents and seven parameters I'll talk about those a little bit later but most importantly single point how does that work well the first thing that we um need to do is is to create this uh panel node here and we just connect the points to the panel node to see what the hell is going on and I'll make it bigger as well and you can see that it generates this uh list list of items right Actually it's seven items just like we have seven points what a coincidence right and those points of course are described by their X Y and Z position so every time when you see like X Y and Z it's either or sorry when you see three numbers divided by a comma it's either a point a vector and it can also be a color red green blue right uh but either one of these three right in this case it's clearly a point right and if it were a vector it would be a vector that's starting later next chapter is going to be about vectors for now we're just talking about points so we have this list of points right and let me make it a little bit longer just like that what can we do with it right so of course now if I have this list and I just create a circle either Circle CNR or just circle doesn't really matter I'll just use Circle CNR for this and I use them as a center point for the circles and I use a radius of let's say five for the radius you can see that it creates uh it takes this list of points it goes through the list and for every item in the list it creates a circle and this if I connect this here we get you know 10 items in this case uh 10 10 circles right on each corresponding to a point that's great what would happen if uh we we change this number of course the amount of circles shrinks as well easy easy peasy it starts getting tricky when you need to operate with the list or rather when for for example when you want the circles to be different lengths or different radius right different uh different r radii so let's shrink down the list to like three or something like that right so only two segments three points in total and instead of giving it one slider let me disconnect this I'm going to contrl c contrl v contrl c contrl v I'm going to give it three sliders and one slider is going to be set to two one slider is going to be set to five and the last slider is going to be set to eight and I already taught you this but first one connects easy second one and third one you need to hold the shift key like that shift key like that now it starts getting a little bit weirder right well it's kind of you can guess that it's going to work this way but um it's nice that it does I guess but you also need to operate around this notion of how it works so three points come in here as a list and receive three different radi also since we use the shift key as a list right and thus they produce three circles the first point um generates a circle with the first Value First radius value second Point generates a circle with the second radius value third Point generates a circle with the third radius value easy easy and I think um again pedagogically speaking I should disconnect these guys here come on uh control like that and I should use merge tool instead merge data one data two data three what merge does it basically I'll I'll show a separate example cat dog you would think Mouse but actually horse it could be mouse cat dog horse like that uh don't bother trying to figure out why sometimes it says panel sometimes it doesn't I don't know as well it doesn't matter we use merge cat dog horse and we check the list that we got it it creates a list right and it's pretty straightforward uh the first thing that comes comes in is a cat second thing that comes in is a dog third thing that comes in is a horse and then you can use the cat again and you can use then a horse and a dog and a cat and a cat and so on right so you can build up a list with merge that that's how that's how it works that's what it's used for so in this case it's not cat dog horse but it's rather 258 and if I check with the panel it is indeed a list of 258 if I check with a panel the points that I'm uh generating here with the white curve it's you know just three points first second third right so now um what it does it matches up um index zero this is by the way the index the um position in the list right it starts counting from zero keep that in mind very important it doesn't start counting from one it starts counting from zero so index zero uh radius two corresponds to this point right here and thus once we create a circle around this point it's going to fetch this radius then this point this radius this point this radius right so that's pretty straightforward if I connect it voila right it just oops it just matches matches up easy peasy what happens if we have more points than we have radi right so if the list of points is larger than the list of radi well let's check one more so suddenly we have 0 1 2 and here we have 0 1 2 3 we have four items here and three items here it just keeps repeating the last the last item in the previous list right so it just keeps on repeating the last radius so no matter how many we add the circles after index 2 will all have the repetition of what we had for index 2 because it's it's ran out of numbers right to use so just going to use the same number so keep keep that in mind as well when two lists don't match up it's going to force the lists to match up by taking the last item on the list and just repeating it until you know for as much as it needs to easy peasy lemon squeezy okay what else let me just I'm just clean cleaning this up a little bit actually yeah I'm I'm I'm going to clean this up let's do something like this something like that okay so now uh on to different ways of how you can manipulate these uh these lists what what you can do with them right so in in this case we are giving it you know 258 like we we're giving it specific values for the radius but perhaps we want to do something a little bit a little bit different with it perhaps we want to generate uh we want to generate a list right for values to to give uh for the points for for the radi sorry for the circles so instead of as giving it predetermined values that we you know we ourselves manipulate instead we want to generate it uh we want to generate them so what we can do is we can use random uh a random number generator that's one I'll actually go to I believe it's under sets it should be under sets if we go to sequence there's random right here so we can use a random number generator or you can create a sequence of numbers sequence wait I'm I'm being stupid one second I did something wrong no it's not sequence it's something else oh series oh my my bad lost my mind there for a second series of numbers so I'll cover both of them first I'll start with a more controlled approach of Series so if I just grab a panel here and I show you you know it just generates uh it just it's a counter right it just Counts from zero until you know in this case until nine so it generates 10 numbers in total I can change from which number does it count so in this case it starts counting from zero I can SL slash yeah you should start counting from uh five from the number five right like that I should give it a step size of how you know what's the gap between the numbers so in this case the the step size is one meaning that it just goes 5 6 7 8 if the step size was eight or something like that it would be 5 13 21 and so on if the step size is 0.01 or 02 is going to be 5 5.02 5.04 and and so on right so I can control the step size in this case I'll keep the step size as it is set to by default value of one the count the actual amount of numbers that is being generated is very important right because that needs to correspond to the amount of points that we have in this um in this divide curve list right that are generated here right from the Divide curve so I could honestly do there are three ways of how you can do it way number one is you take this number and you keep in mind that it's always always going to be one extra so you can take this number you can say plus you know connect it like so so seven connects to a and for B I'm just going to use SL SL one so we always connect one to it and we have our we use it as a count here like that so this is like uh not not it's it's automated but it's not elegant I think right but it would work right it would always correspond you know I have um this set to eight meaning that it generates nine points meaning 8 + 1 is n and it generates nine numbers right this would work but I think uh I feel like a much better uh way of doing it would be to let's make a little bit of room here um and probably this should be in the top yeah something like that come on go here so a much more elegant way would be to actually ask the question of okay how many points are you making right before giving it uh before generating the different numbers for the radius for the future radius of those points and the way you do it is you just go to sets list list length am I blind hello is it seriously not okay list length and I'm going to control alt click it is here there it okay it was here uh okay list length I just connect my list of points to here and I get an answer right uh again I love to show you things within panel nine you know nine points so then and with the nine we just give the series The Count of nine like that right now we get the nine points I'll disconnect the merged values I'll have these grouped up for you just so that uh don't forget but now we will be using the the new values generated from uh generated with this series node plug that one into radius and now we can see that um one is going to have a radius of five because is starts counting from five and the last Point has a radius of 13 right so that's series and the nice bit about that is that you know we can we can mess mess around with this actually let me edit this and increase the maximum rage to like 20 oops to like 20 increase that you know so it corresponds quite quite neatly so that's that's a controlled way of how to do it you can change the step size and then blah blah blah yada yada right um semi parametric well not semi quite parametric model another thing uh how you can do this is with a random number generator so if I do SL slash and I connect the random number to the panel you can see that it generates some sort of a I don't know a number somewhere between 0 and one and actually always between 0 and one first notion is that there's no random truly random numbers in programming everything is pseudo random meaning that there are algorithms that generate numbers that seem random that you know because there are so many operations that happen with them that they they seem to be random and they um sometimes are connected to um I'm going to get there sometimes are connected to uh the the the stock market fluctuations sometimes they're connected to the date and and so on but it's it's all quite quite random I think the random most random ones are like do they have to do something with chemistry or physics I don't quote me on that anyway since they are pseudo random they deal with seed inputs seed is if you change this it will generate a different random seemingly random number so if I change the seat to five a different value six different value I go back to five same value right so a seed is um like you can choose a different random number from a this jar of random numbers the question is how do you control you know the minimum and the maximum and that's the rate range and this is going to be our first uh look into domains right a domain is basically first of all we'll start with a one-dimensional domain which is literally just uh a scale between two numbers right boop boop zero one that's the you don't see it there we go that's the domain right so a domain is um basically all of the possible numbers in between this range right and that zero and one that can be uh anything you want that can be minus 55 and in in here it can be Pi or whatever right but but that that's basically the domain and then if you say that oh I want the middle of this domain then you know you ask what's what's right in the middle between minus 55 and Pi you know you need to add them up divide by two and you get the middle of the domain and the reason why we use domains is because it's very easy to get different ranges and it's very easy to then divide them up and extract numbers from them and manipulate them as well so you can take a domain and you can stretch it out or compress it to um like different values and I'll explain that a little bit more in just a few minutes but the that's the basic premise of it is a range of numbers right that's the domain so here where where you have random that also is set to be a it uses a range so this is when it generates a random number it asks you know within what kind of domain should it generate the random number in and in this case the domain is set to be between zero and one we can change that we can say that the range actually should be we need to go to maths domain construct domain right here the first one not construct domain squared uh that's later much later uh construct domain simple one asks us for domain start and domain end and I can say that okay um I want a random number between five and 25 so domain start will be I'll just create a slider five domain end will be 25 right something like that should make a little bit more room here and now if I check the output of it in my panel bam between 5 and 25 easy peasy if I connect that to the range now every time I change the C it's going to be generated within that range okay that's great and all but how do we generate you know this amount of numbers uh or I should show here probably this amount of numbers uh that correspond to the amount of circles well that's the number input right I can use the exactly the same trick as what I showed with the series so let me just disconnect the series node and disconnect the list length node here grab those in group them up just like that and let's use this uh random number generator instead like that I can actually delete this the construct domain is so huge okay I'll just put it here right now for the uh points I ask with list length I ask what's the length of the list connect that to the number input of randomness of random number generator and it generates a bunch of random numbers at this particular seed right and I can change the seed and then I can use those random numbers to plug those in into uh the radius and now I have random um circles if I say that oh no no no the big circles are too big I can very easily just say that I just sish the domain right down to 11 from Maximum 2 five right so the maximum range of how far it can reach is now 11 the minimum range I can also squish that down to two I can increase the amount of points that there are and so on right so I can I can I have even though this is random I have control at least a little bit of control over this and then if for example I don't like the pattern that I get I can always change the seed until I until I get something that I like more right so that's uh the basic premise of a domain and how it works okay with that out of the way with that out of the way let's make a fanc your definition what I will want to do is I will want to uh well first of all let let's make all of this clean and nice and dandy so I'm going to select all of this group it up um lists and domains part one and I'll also select all of this and hide it and now I'm going to draw beautifully of what I want to do in this next example right to continue talking about domains and how you can operate with them and lists of course we have our curve beautiful let me let me just try it one more time I I Know I Can Do Better sure okay we have our curve I want to have a point somewhere here like that I uh create in Rhino I want to divide the curve up one two three four that's way too many okay why am I doing this to myself okay sure whatever we explain it with a lot of points I want to divide up the curve I want to measure the distance between my the point that I have created and all of these points right and then I want that distance to be Rema uh to radi the radi radi of the circles that I will be generating on top of these guys right so the closer the point is to a circle to a point to a point on the curve the smaller the circle the further it is away the larger the circle right so the the distance controls how big the circles are this is like the most BAS basic attractor Point kind of a tutorial I guess that uh that I can do but that will highlight a few a few Notions about the domain and generally lists that I would like to specify um before we actually let's do this and then I will kind of cover a few more instances of where lists are useful and how they can be used so for now let's do that I reference in the curve component is that one curve I ref in the curve with the component set one curve then I divide up the curve just same repetition of what we did here and I will use a number slider of uh 20 for the count so I have 21 points here I will create a single point in here bam like that single point and I will reference it in as well Point set one point selected there we go now I will measure the distance between this point and all of these points distance you don't know this node I haven't used it before but it's kind of self-explanatory right compute accuity and distance between two point coordinates compute distance between two points point a is going to be my point here point B is going going to be a list of points since this is going to be a list the distances output is also going to be a list right I can visually show you what it's doing by creating a line between point a and all of the points right it's measuring these distances and these are the lengths of the of these lines or the distances right then I could be very kind of simple about it and I could just say CNR Circle Center normal normal radius the center are the points the radius are the distances and call it a day right and the nice thing that is that since uh all of the distances are um give me give me a second all of the distances are um the the the the radius radius of the circle uh you're making sure that the circles will always hit the the point that you have placed right they will always try to follow along the point that you have placed that's just mathematically you know how it works but that's not what we want we want to have more control over the radius we want it to be an influence but to have control over the maximum and the minimum range and how fast does it fall off and so on right apologies I'm sorry sorry uh how fast does it fall off and so on so I'll move it quite close to one of the points just to see better right of of what what's going to be happening and I'll disconnect the distances from the radius for now because we need to make a few a few changes a few adjustments right so the first the first thing that I want to do is I want to um one second uh sets uh no that's going to be under parameters uh utilities come on come on come on yeah it's a remap okay sorry uh what we're going to do is we're going to use this remap numbers node it's a very very useful node that will enable us to um take a range like of of these guys take take take a range uh from the smallest which is 4.94 to the highest 8314 8133 you know so so you have the minimum in a maximum and then squeeze it or expand it or move it to any other range that you want I will explain this graphically so first of all let's just place it so that you can see what we're talking about remap numbers asks us for a value a source domain and a Target domain example value is is five Source domain is oh by the way you can write it like so sl/ uh 0 to 10 that's that's a domain it's going to accept it Target domain uh 0 to 100 Target and if I look at mapped output it gives me 50 what just happened let me explain we have uh we have one domain The Source domain that is between zero and 10 right that's our source domain and we have another uh the target domain that is between 0o and 50 oh sorry zero and 100 I'm stupid zero and 100 right then let me just use red and those domains have infinite amount of numbers you know divided uh can be divided infinite amount of times right so the scale is like like that you know a BN a bunch of numbers exist in them and one of the numbers in the source domain is five the value of five and you know just reading through proportion five is literally going to be right in the middle right the value five so then the question is um if we take this domain and we just look at the proportion right and we map according to this proportion onto the new domain what will the value be you know oh that's an ugly color let's not use that yeah sure so if I were to you know I just map it like so in a in this domain you know it hits here the question is what's the value right and since it's quite straight forward between 0 to 10 0 to 100 clearly it's going to be 50 right but sometimes it's not so easy you know if if the range is actually uh 0 to well actually it's always going to be easy because five is right in the middle of the domain so 0 to 200 is going to be you know going to hit at 100 0 to uh 500 going to be one uh hitting at 250 and and so on but you get an idea right you have like a domain and you can shrink or expand it and since it only cares about the proportion of where the number is in the source domain it will find a new like numeric value at the same proportion in the Target domain why is this useful well and I'll Pro I probably should uh this is going to stay but let me just that should be 100 there we go like that that's going to be saved for for you um so why is this useful it's useful because currently we have all of these distances that we need to squeeze right that they're too big radius they're too big I could divide them you know I could use division divide them by five or whatever you know and that that would kind of work but that's not a lot of uh not not a lot of control because I can't control what's the smallest value I can't control what's the largest value all I can do is just divide it right and then try to to get it to work so instead of that I'm going to use remap numbers I'm going to say that well the distances are the values that I'm going to be remapping you know uh to two new values The Source domain you know I need to somehow know what's the smallest value in here and what's the largest value in here and thankfully there is a node for that so under domain under bounds we have that node it's called bounds I just give it like a set of numbers and it produces a minimum and maximum value for me 4.94 to 83.1 5 right 4.94 83.1 5 right so that's my starting domain and then for the Target domain I can use whatever value I want right so uh here I created a panel uh usually I do create panels but as you saw here you can also use construct domain right to create one but in this case uh just simply to make it a little bit smaller I will be creating a panel SL slash and I will be saying well the smallest um diameter or radius that I want should be two then space bar two word the word two um let's say the largest one 15 I can always adjust it right enter 2 to 15 connect that to my target I get all of my values remapped you know the smallest one becomes two the largest one becomes 15 and all of the rest are in between and I can now connect the mapped values to the radius like so if I then look at this and I say well 15 is a little bit much I can replace this with seven like that increase the amount of points here to 100 and now I have a system that reacts to where my point is located quite useful right this is like the beginning for for parametric parametric modeling uh quite quite quite a useful useful thing of course you are when you're dealing with domains and so on um there are more use cases uh for them but as long as you know you know the pure basics of how they operate then you'll get the sense of you know what's a curve domain what's a surface domain you you're going to get that uh much much faster and we're going to revisit domains quite a bit in this course so don't worry if you're not you know completely clear about how it works so we have our our circles and one more thing uh yeah one more thing that I would like to note is if I then take these circles right the circles that we have if I take these circles and I were to extrude them so I can use extrude tool asks me for what's the geometry that I want to extrude that should be the circles and asks me for what's the direction so basically it asks me for a vector in which direction should I extrude and the vector can have strength associated with it thus um you just don't describe just the direction you also describe the amount so I will in the next chapter I'll cover this much more but uh when it comes to vectors you have the basic ones x y z directions uh that you can access through Vector tab Vector unit X unit y unit Z so in this case we use the Z Direction like that connect that and by default the unit Z has a value associated with it as one meaning it extrudes upwards as one but you can use any factor that you want so for instance if I use 50 connect that now the strength of the Z Vector is 50 mm you know or yeah 50 can we make the extrusions correspond to where the circle is uh where the point is of course we can right we already have the distances here we can just reuse them right and we have the bounds here we can just reuse them so what I can do is I can just say another remap numbers right the value values are the same you know we measure the distances like that the bounds are the same you know the minimum because the values are the same right so we reuse that and the only thing that we change is the target domain the target domain so SL slash let's say the smallest one is five and the largest one is 50 right connect that to the Target connect the map to the unit Z and now it corresponds to uh that the height of it also corresponds uh question what happens or rather how can you make it so that they're tall where the point is and they're small where the point is further away by the way this point is called attractor point if you want to Google for tutorials more tutorials on this you Google attractor Point tutorials so all you need to do is just flip it right so the smallest number or the number that corresponds the smallest number should be 50 and the number that corresponds to the biggest number should be five so I flip this 50 to 5 now the closer you get to the point the taller the structures will be but since this is not flipped they're still going to be pretty uh wide here right so so they're going to be narrow and Tall here and wide and uh low here make it even more narrow like that so that there's almost like a not almost but a gap in here last bit to do is just to take the extrusions and to cap them oops that's the wrong here cap cap holes just creates a surface on the top I'm disabling the preview of literally everything except oops uh literally everything except the final cap holes node right click bake default group yes please just to show I will be deleting it soon like that we have our first you know kind of parametric model Arctic view neat stepped weird come on weird stepped thing sharaban paper tubes all right back in here uh this definition is finished let me delete that back to to shade it and I will just just so that we are all uh kind of just so that it doesn't get lost I will right click uh internalize data for the point right click internalize data for the curve delete those group this up call it part two or List send the meain part two okay so that's done and then we have uh uh remap explanation okay so now uh one last bit about in terms of domains currently that's that's all I want to show you there are of course more stuff to show but in this particular beginner tutorial that's all I want but for the lists there are a few more things that I would like to um showcase and I will be showcasing them in U just a theoretical framework so uh the Rhino file doesn't matter I'll just show this in grasshopper so I'm going to create a panel and I'm going to go for CAD that's CAD or actually sure CAD dog cat Mouse horse um 5 23 false uh doesn't matter U let's just have this this list here so this is still not a list because you can see it does not have any indexes right it's not regarded as a list it just regarded as poetry right by uh grasshopper it does not understand that this is a list so I need to right click I need to choose multi line data for this to turn off to be turned off if it's turned off then immediately it just takes every line and just places it at its own object into the list so now it's a list things that we can do with the list number one use list item if even here right oh actually I said I won't show it in Rhino but I will in this particular example cap holes right I have a bunch of these cylinders right what if I want cylinder number 23 out of these well I can go for the list uh like I can connect this list of cylinders with capped holes to my list item node and for the index I can say SL sl23 connect that here visually nothing really changes as much uh that's because it's you know the the geometry that it gives us overlaps with the geometry that already exists so I need to hide the capit holes one and now I can see it it's cylinder number 23 what about number 24 that's the next one what if I say give me 23 and 24 it's going to complain why does it complain it complains well we click on this little error data conversion failed from text to integer or this is not text this is two numbers don't forget there are two lines right now but they are not a list so it reads this as poetry if you right click and you choose multiline data to be turned off suddenly it works right so now we get 23 and 24 uh I can also fetch out five and 69 and so on right and I get those um those cylinders here as well so list item is useful for fetching geometry if I showcase it uh here in our CAD dog CAD dog cat Mouse horse uh example list item by default with the index zero it gives us the first item in the list if I want the last item in the list the index should be minus one it's smart like that it counts backwards as well so if my index is minus one poop gives me the last item in the list which is 23 right um don't forget that you can also always click this little plus sign and then we get plus one here so what comes after 23 CAD it just keeps wrapping around right it keeps repeating plus two dog and so on right so you can zoom in uh also you can of course go backwards as well if you want to right so in this case I'm just going to have index set to zero so it's CAD dog cat right it gives us uh gives us that very very useful for extracting extracting geometry the WAP is what happens when it reaches the end should it then well actually I can show you toggle oh yeah uh what kind of input should you give it uh just look at the icon so RP has an icon for the toggle right index come on index has an icon for uh integer number list has an icon for any type of data right and the outputs also are color coded or icon coded I guess so if R is said to be no don't WP and then I say give me an index 7 which does not exist in this list all of these will freak out right because it can't even fetch the first one not to mention the second and the third one if I make this um wrapped if it can Loop then seven is going to be back to the start uh so it it goes through the list and it goes back and it fetches cat dog cat right so that that's how this works um panel let's set it to three just so that it's not as extreme okay that's that's the first uh first thing let me place it here we're going to reuse this the same uh same list um then if I want to insert an item let's say into this list I use insert items uh insert items note I'm just going through this notes right here that I find to be quite useful so insert items I have my list and the item that I would like to insert uh is going to be let's say uh octopus come on again octopus with a capital O because they're great connect that and it asks me okay where indices you know at which index would you like to insert it so I can just do SL slash and I can just write or I can actually create a slider um five please add it to uh index five right so it's going to push five and 23 downwards if I look at the panel right now octopus has been added to this list and I can choose where where it gets added of course if when it's wrapped um it Loops through and it can uh you know it goes through the list and then keeps on going uh if this is not wrapped then it's going to start complaining we already covered this right so that's insert items really good if I want to I can have multiple indices here right so I can insert octopus in multiple different places or if I have two items here octopus and quid and I choose multi-line data to be turned off then first get octopus gets inserted you know at index 3 and then second Squid gets inserted at index 5 right and since uh okay it it gets tricky you can see that squid is said to be uh index six uh that's because when we insert octopus everything kind of scooches over right so so so it starts becoming a little bit uh weird with the with the numbering I guess or not counterintuitive but a little bit harder to follow so what you need to do is you need to just check uh the original list and just see okay uh I want in between cat and mouse I want the octopus and then in between the uh horse and number five I want the squid right and then then it makes sense rather than trying to follow follow along what what kind of numbers would you want them to have um geometrically this is I I use this much less compared to list item but uh also sometimes quite quite useful when you need to insert a specific object uh into into the list okay so that's that's that oops I'm I'm grouping things too much give me a second um measuring list length I've already showed you that item index is eh not so useful sometimes useful of course but not not as much dispatching weaving replacing numbers all of those are quite starts becoming a little bit tricky okay uh let's do one last one before we move on this patch this patch is out of all of these is the most uh most useful so this patch I have a list bam and I need a pattern and right now the dispatch pattern is said to be true false by default you can see me hovering my mouse over it dispatch parent true false so it gives me uh two lists dispatch gives me two lists if I check them list a has four items in it list B has three items in it and let's let's try to figure out what the hell the pattern you know what how the hell does it work well we have our cat dog uh okay I'll I'll change cat to something else like pigeon there we go so we have our pigeon dog cat Mouse horse 523 and here we have pigeon cat so this item this item or can I draw on top of these yes we have our pigeon right we have our cat we have our horse and we have our 23 right and then dog Mouse 5 dog Mouse 5 most likely you know that has something to do with the pattern of true false so imagine this you have a list and you just go through it as true false true false true false true false and whatever lands on true goes to list a whatever lands on false goes to list B so pigeon true list a dog false list B cat true list a mouse false list B and so on right so it separates out it dispatches according to some sort of a rule set so what I can do is I can say um SL slash true true [Music] false true true okay sure whatever true true false true true true true false true true right that that's what's the pattern that's that's going to repeat if I go for multi-line data always needs to be a list by the way connect that to dispatch pattern uh let's get rid of the of these this nonsense here then I have true true pigeon dog false cat true true Mouse horse right finishes the the pattern starts repeating it true true 523 and now if I had one more that is like a uh zaha um then we have false Z lens on false right so that's dis patch uh showing it in action uh let's go back to our CA hole cylinders right here and I can say um well I I could just do dispatch for this dispatch pattern and then for list a I can just say oh this is going to be the first time when we use a container not for the sake of referencing so I can use a b container and I can say I only care about list a so I just f patch that right and if I hide all of it like only every other entity gets dispatched because the pattern is true false right and I can say uh true false false false uh by the way faster uh faster way remember when I said one is true zero is false I can just do 1 0 0 0 multi line data dispatch pattern and now I get only every fourth element in the list you know extracted right but uh I can do even crazier stuff with it uh because since this is true or false I can start playing with logic I have all of these distances here right all of these measurements that that we've done um let me remind you line you don't need to do this by the way um the line from between this point the the anchoring or the attractor point and all of the points on the curve we have all of these distances so those distances I can ask yo is this larger is this larger than it's under math operators uh larger than or smaller than right is this larger than let's say it's a long wire I know but it is what it is um whatever 55 is the distance larger than 55 and guess what I get from it I get answers yes it is yes it is yes it is no it isn't no it isn't and then so on right so I get answers and if I get those answers I can use that larger than as a dispatch pattern right because it's all true or false statements so all of the N entities that are further away than 55 mm from the attractor Point are placed in list a and all of the entities or in this case cylinders that are closer are placed in list B right so what I can do is I can then play with the with the range right and mess around with that if you want the logic to be reversed you can just uh use use a tool that's called not gate not which literally takes true makes it into false makes it takes false makes it into true flips it on its head right so now if I use gate not it only will give me what's within the range of U 60 let's say millimet right so that's one way of how you can um dispatch uh objects or how you can separate the the list lists into two um parts right okay group that up um Let me give me just a second uh for now that's fine mhm okay a few more a few more things and then we we move on so we have um ways of how we can remove data from the list right and in this case I will not be showing it here with the dispatch or or whatever I will be showing it uh or actually we should I I should I should okay so let me just copy over this panel right here and we continue with this list right so I guess one two three yeah four I I I'll show you all four culling C is remove have that in mind right C is remove so col index I can just select this um it is literally like list item only reverse right so if I have this list and I want to remove something from it I need to give it an index and I can say I want to remove uh dog which is index one I want to remove Mouse which is index 3 I want to remove the both of the numbers index five and six right and I connect those uh indices here and you can see it's complaining why that's a test why why is it complaining I'll give you a second you can do this I I talked about this like 50 times already multi-line data right click multi-line data needs to be a list or else it's poetry okay so now we are removing index one dog we're remove index 3 Mouse and we're removing 5 and 23 and what we end up with is Pigeon cat horse Saha right so that's that's easy that's very straightforward um then the next one is call enth call nth is well it takes a list and basically which every number should be called so in this case call frequency is set to two which means that every other object will be removed so pigeon stays dog gets removed cat stays horse gets mouse gets removed horse stays five gets removed 23 stays zaga gets removed that's call frequency of two if I set call frequency of three it's basically true true false true true false true true false you know every third item gets removed so you can probably start seeing that you can mimic exactly the same behavior with dis patch of what you have with K enth and this is a re reoccurring theme in grasshopper there's always multiple ways of how you can do something right and you just find the one that works for you or you find the one that you know how to how to do right so that's called nth boom boom okay call pattern um that's going to be literally like dispatch except that it does not provide you with list a and list B it only provides you with list a right so col pattern and dispatch I kind of want to group them up here I won't even kind of talk about it as much because if you think that you need to use call parent just use dispatch just keep that list B in there just for you know in case you need it in the uh layer and then the last one is random reduce well that's that works exactly what you might how you might think it does uh you connect the list and it asks how many items would you like to remove from the list right so you could say h get rid of five five items please and it gets randomly rid of five items and you can change the seed of course you know for this so you can remove five random you know different random items from the list um a way of how you operate random reduces usually not with a number slider but rather by asking the question of okay how many list length how many items are there in the list and then multiplying that that number by a value between 0 and one 0.50 Z right what does this give you this is this becomes percentage of how much do you remove right imagine that this is a number 20 you know there are 20 items in this list there are not but imagine okay uh actually there are eight numbers in this list you don't need to imagine eight numbers this gives you eight you know list length gives you8 number slider 0.5 8 * .5 is 4 50% of 8 is four 2 is 1.6 what happens when you try to remove 1.6 elements from the list if I connect that to reduction you can see that it actually apologies it actually um rounds off the number into the closest integer so 1.6 is 2 so it will remove too but by doing so you're able to say how you know what's the percentage of the all of the elements that you want to remove and sometimes it's super super useful especially when you're dealing with paneling and you want to remove some of the panels you you just have this setup you know list length multiplied by a proportion uh which becomes a percentage and you just reduce um the list that way okay so that is that I think with this we're kind of done with the lists there's weave as well but weave I will cover a little bit later Jitter ROM sets we don't touch sets just yet and then data trees those are uh very scary we will talk about them later and this became orange that's fine all it needs is just a curve and it's going to start working again okay sorry sorry for just blabbing around uh we move on to the next uh step which is going to be learning about vectors and learning about planes and what those are a little bit more geometrical I guess I'll see you there all right let's talk about vectors and planes I'll start with vectors first of all so in grasshopper in Rhino honestly everywhere vectors are used to define Direction and the way they are constructed they basically have a direction at which they're pointing at and they have a strength associated with that direction right so it's like a function of uh Direction and strength if we go to the vector tab here in the top um right right here uh under Vector subtab we will have most of the tools that are associated with creating or manipulating vectors for example if I were just to use Vector XYZ Vector XYZ nodee I have the X component the Y component and the Z component with which I can Define you know a direction for a vector the problem with that is even if I were to let's write uh something actually let's do five and zero and let's just use 0 0 five right so a vector that is pointing upwards you know um vertically and at a strength of five it does it is not shown to me in the Rhino viewport and that's because by default vectors are not shown so to actually see a vector you need to create a a tool or use a tool called Vector display there's also Vector display X but uh for this in this case we will simply use a simple one vector display X I think is extended or something like that anyway Vector display asks us for two things actually anchor and Vector why does it and we can connect Vector to Vector sure but the question is why does it ask for an anchor well that's because a direction right does not have a starting point preemptively kind of the described right it's just a concept of a Direction so you need to say you know you need to Anchor that that direction to somewhere right to be able to display it or else it's just you know how do you show norf you know well you need first of all to you know select where that norf arrow is going to be located and then you show it right so that's exactly the same thing here so for this I can just simply uh construct point I can construct a point and thankfully by default construct point point component gives us a point at 0 00 0 coordinates so I can just simply connect the vector and now you can see a vector appear here right so now how does this work actually I will disconnect that copy paste I will have three sliders going between 0o and 10 like that right and I can just explain to you how how does you know how do you construct the vector so if I increase the X component you can see that now in X Direction the vector goes by five units in y direction the vector goes by zero units and in Z Direction the vector goes by four units right so we have a direction and then if I do nine here then or 10 here then uh we we have a different kind of a direction and of course it can go opposite you know it can go into the negatives and so on for sure it can but basically with three numbers you can Define any direction in 360° Globe right as long as you have X Y and Z component and that is one of the kind of not necessarily tricky Parts but one of the more uh hard parts for people to not get confused about is because the point also corresponds to three um apologies a point also corresponds to three uh coordinates x y z right and if I were to actually construct a point with the same coordinates they would end up exactly at the end of the vector as long as the vector is anchored to the 0000 0 coordinate of the world right so that's that and also vectors have as I said before before they have a length 11.87 in this case right so that's the the complete Basics you know the of how you construct a vector right um or rather what a vector is I guess should I keep going to the to the right I guess I should we just keep going to the right construct Vector okay now if I look at this here we have the deconstruct vector node which basically can take this Vector that we have and it can explode it into X Y and Z components right so we can get these numbers separately that's great um I mean it's it's a no-brainer so I'm not going to incorporate that too much okay uh what does unit Vector do unit Vector for example here we described the direction right and we have a pretty uh long Vector which is like 12 uh almost 12 unit Vector if I connect it and in instead of this let me just quickly instead of this Vector I preview the unitized vector you can see that it became much shorter how short you ask always one unit in length in this case my Rhino file is running in millimeters so the units are are set to be millimet so this Vector while keeping the direction becomes 1 mm in length this is very very useful for when you need to then you know you then you can multiply this vector by 50 and then you know that you will have a direction that is set to you know uh you you have a direction that is set by these three numbers you know for the vector but you know for a fact that the length of your vector is 5050 right so that's one way of how it's useful other ways are just you know um unifying all of the vectors to have one uniform length of one or strength of one I guess another way I'll delete those another way of how to introduce 50 the power 502 a vector is by using a command called or note called amplitude right here this bad boy right here amplitude Vector connects to vector and then here we describe the amplitude with 50 connect that to the vector display and we get exactly the same Vector so amplitude basically takes takes any direction and overwrites its length with you know with the number that you give it here exactly the same thing as what we've done before with two nodes now we're doing it with one node right so I'm going to keep it as it is here add to group there we go now moving on uh you can of course construct uh vectors simple vectors such as unit X unit y unit Z I have an anecdotal thing for first I would say three four years of me learning grasshopper I always thought that this is n not Z and I didn't understand why the hell you know unit X and unit y that makes complete sense you know because it's these are vectors that are aligning I can show you Vector display construct point they're very small but these are vectors that are one unit in length and and aligning aligning with X Direction y direction and then you know here and then I would freak out and I would not understand what the hell is an N Direction it's just a rotated Z anyway but those are these are like the world axes that you can just get right and if you want to define a factor such as 50 it's just a slider or any number for that matter so you can just give it factor and thus you give it power so for example when you're when you move want to move something up uh for translation you give it you know this this kind of a a vector with a certain power associated with it I'll show that of course in in later stages but just keep in mind so we group those then uh to measure the angle between two vectors um I'm just going to borrow or actually we can create a few so let me make three points here move one point up like that and I'll just get them in um as three separate nodes just for the sake of clarity that's going to be the original Point second Point origin point Sorry second Point third point right and now I will will construct a vector between these points so under Vector there's uh there should be Vector 2 PT this one right here Vector between two points I use that and for my first Vector I I use the origin point which is this guy right here it really doesn't matter which one you use origin point and for point B I will use this one right here and I get a vector right and if I use Vector display and I use my origin for the vector display you know you can see that the the vector that is created right here and then I'm going to create another vector vector 2 PT between the same origin point but this time the third point that I have here referenced and I'll use Vector display again anchoring to the origin and looking at the second Vector there we go something like that technically I could I could also do this and not use this that would work as well but I want just want this to be kind of clean as clean as possible honestly so we're doing this so now we have two vectors and clearly these two vectors right have an angle between them that can be uh measured at a specific uh surface right at a specific plane if you will so to measure the angle between the two vectors you can do uh you could do a cross product type of a thing and then use that but we ain't about that life uh because that's a little bit more uh complex we will just simply use the angle component here angle which will ask us for um the two vectors we do have those Vector a Vector B and it is also going to ask us for a plane for a two-dimensional angle right even though um if I remember correctly apologies give me a second if I remember correctly even if you don't present it with a plane it's going to figure out the closest fit plane for the angle so that's kind of nice anyway so once we have the angle it's in Radiance right uh the angle is in radians so I can do um uh degrees conversion to degrees so from radians to degrees you always you can just hover your mouse and you will see angle in Brackets in radians right so you convert it to degrees and we can take a look at the angle between the two vectors which is 91 if I look at it yeah seems seems kind of accurate that's really close to 90° this should yeah this increases the angle this decreases the angle right so that works okay what if instead of one origin Point like what if these two vectors are disconnected so what if let me just clear clear clear and I'm going to hide the preview of everything else just so that it's not um too too complex and I'm just going to to make a copy like so and let me really quickly redo redo the points right so I just deleted all of the point components and I'll I'll rebuild it so that you don't get uh confused point a point B for the first Vector set one point that's going to be point a point B is going to be the one that's let's see looking up like that connect connect and the vector display anchors itself always to point a so we see the vector and then two more Point contrl c contrl v point point a is going to be this one point B is going to be this one connect connect and again anchor see that it's definitely not a problem for it to measure the angle simp because all it needs to do is just move this you know these two points together and then it gets its angle from there very kind of useful so that's that's kind of simple that's kind of easy and that that's how it works right okay so that that's measuring uh let's let me hide these let me group these place them here internalize internaly internaly internaly okay delete there we go uh I'm not touching upon the plane because we're not there yet we're going to get there but not there just yet uh cross product and do product for now I'm going to skip over these these are just slightly more advanced and I think you need to get a hang off you know generally of how vectors work uh before you start moving into cross dot pro products and so on um instead we will one second thinking yeah instead I will show you like a nicer nicer uh a few nicer things of how vectors can be used so first one being let's say we have a curve there are two types of vectors on the curve there are perpendicular vectors or sorry on a curve it's t tangential vectors on a Surface there's perpendicular vectors so first of all I want to show what the tangent Vector is so for this curve I will reference it in set one curve and I'll just use evaluate curve component evaluate curve and it's going to ask me to evaluate it at a certain parameter right the curve domain is basically if it's not repar reparameterized is going to be the along the length of of the curve so I'm going to say that the parameter is uh let's say at 101 mm bam you know along the length you can see I can easily move it and I can even go beyond the curve here in this case um simply because it's uh how it's how it's constructed one thing that I would like to know this for evaluate curve is usually you don't use it with a regular uh parameter but rather you right click here on the input of the curve and you choose reparameterized what does that do when you choose reparameterized this little icon appears and once this icon is appeared then you're not dealing with millimeters you're dealing with proportion so now I can do 0.5 and that's going to be the middle of the Curve zero is going to be the start of the curve one is going to be the end of the curve clean and nice so that's that and the reason why I'm showing you a valuate curve is because it gives us the point the tangent and the tangent and the angle the angle we don't care about right now a point we don't care about right now too much and the tangent tangent is what we care about because that's a vector right and I will just use display Vector display sorry Vector display for the tangent and the anchor is going to be the actual point right so I want to draw a vector from that point and if I zoom zoom zoom zoom zoom zoom zoom I can see a little angle like vector sticking out here it's too small so I'm going to use the amplitude node connect Vector to it Vector here and for the amplitude I'll use like 50 or something like that bam now you have a proper Arrow you know showing it now now if I drag the the parameter slider you can see that the angle changes and the angle the change of the angle is actually um it shows the tangent Direction along any point of the curve that you want right so this is super useful for when you want to create um something that is quite seamless and that connects seamlessly to a curved object really really uh useful stuff alternatively you could do so this is like one let me group this hide this alternatively you can do I'm just copy pasting it I'm just going to delete a bunch of stuff just kep the curve uh you can divide curve like that uh do the count of let's see 50 points and along the tangents tangents you can uh increase the Vector amplitude of the tangents to like 20ish and then Vector display you know get get that kind of a information along the whole curve again right now it's pretty dry in terms of theory but it's quite useful it will become quite useful in the later stages so just understand the tangential um logic of the curve okay now when it comes down to surface uh let's internalize internalize and let's create a surface instead um just four point surface really doesn't matter 134 um flip F10 I'm just going to move it up you might see the iso curves anyway all you care about is is this this kind of surface by the way if it looks funky if it's all Jagged and so on in Rhino you can just select it um go to properties choose custom mesh tick mark that adjust and then for the density just choose like one or something I think that should do the trick that indeed did not not do the trick so let's test out smooth and slower preview no that's pretty bad one second um density one and maximum Edge to surface distance 0.1 millim hit okay that should okay what what the hell hello uh maximum angle five preview okay that starts looking much better okay five maybe two yeah that's not bad that's not bad so something like this hit okay and now your surface will be meshed properly right will be shown properly that's a usual issue that uh Rhino has when trying to display like curve geometry is that the simply the resolution at which it's meshing is pretty bad anyway back here I will reference in the surface as a surface surface component set one surface there we go and this is going to be the first time when you will see uh what happens when you well actually you already saw this but this is where I'm going to put attention on it what happens when you reference in a service in Rhino and also I've just noticed that it's anyway it's going to crap the bed when it comes down to previewing the geometry simply because there's two geometries at in the same place one from Rhino one from the representation from grasshopper so usually what I I do is I just uh once I reference the geometry I hide it in Rhino and I only look at the geometry in grasshopper and you can see that the geometry in grasshopper even though we fixed it in Rhino and grasshopper it's still pretty crap so I can go in here into this menu and instead of lowquality preset I can choose high quality preset which slightly helps out with a preview not too much though I will not spend too much time making it pretty because all we care about is just getting the geometry in here and rating a bunch of points on it so I can do just just like I did evaluate uh curve here I can do evaluate surface here right bam which actually asks us for uh a point it does not need a point it needs two values uh X and Y right X and Y value so or u and v value so in this case a point is not accurate it's actually just just two values but the way of how we can construct It Is by actually using uh either a point tool or a multi-dimensional slider so that's that's one one thing I'll show you both variations of it if I go for a point or rather sorry construct Point like that I can completely ignore the Z coordinate I only care about the x and y coordinate and you can see since it's 0 0 it already creates a point right here I don't care about those I care about the you know about being able to freely freely navigate on the surface and then find any point that I need so I will create um a slider of 0.5 just like here you know a slider between one and zero like that and I will just simply connect that uh connect one slider to x connect the second slider contrl c contrl v to Y and now I should be able to as I move this I should be able to find any point you can see doesn't work why doesn't it work kind of does but it really doesn't move that far and that is because this is also this needs to be reparameterized right now it's reading millimeters rather than proportion so to re reparameterize it I just right click on the surface input here and choose reparameterize and now that point that we are using can interpolate anywhere on the surface right just like that so that's one way with the construct Point another way I'm just disconnecting this grouping this up moving it to the side um another way of how you can do it is if you go to parameters and you go to input here you'll see multi-dimensional slider if I select it it looks like this so basically it's a slider that generates two numbers not one and I can use that and then as I move this I can move you know the the the point or the plane uh anywhere on the on the surface right and just uh to show you how it works here you know as I'm moving it it generates a point at that particular coordinate it generates a normal Vector that's the important one at that particular coordinate and gives me the direction or the uh tangent the tangential direction that U Direction and V Direction I'll show all three of these vectors for you just so that you kind of understand what what's going on and also it gives me a frame which is a plane I will touch on planes a little bit later so now for the normal I use exactly the same thing amplitude I increase the strength of it because I know for a fact that the normal will be only 1 mm in length and I'll give it an amplitude of 50 and I'll use Vector display uh to actually show you the normal on a point just like that so what is a normal that is a vector that is sticking out 90° from any point on the surface oh that's the wrong slider see it's always going to give us a perpendicular Vector this is super useful for when you have a bunch of elements on a surface and you want to move them as if you're offsetting them right when you want to move them away from the surface super useful I'll will make the MD slider a little bit smaller just so that it's not so much in the in the way okay so that's that's that that's the amplitude and we group this up there we go and actually this needs to belong to the group so that add to group just like that now uh to I I'll just borrow the same surface in here and I'll repeat the same thing as what we've done here with the Divide curve only that we will use for the surface we will use divide surface tool the wide surface will give us uh you know points along not just points also normals along the edge oh apologies I'm sorry hold that thought go back in here I showed you the normal I didn't show you the U Direction and The V Direction I need to show those as well so that's the normal the U direction is here tangential along One Way V direction is here tangential along the other way right so think of it x and y u and v uh basically XY Z are Global directions while U V and W are local directions right so what what's the best example if I have a box this box has its own X well actually that's X Y and Z directions right and currently they are aligning with the worlds X Y and Z directions but when I rotate the box like that it still has its X Y oops and Z directions but now they are you know not aligned with worlds X Y and Z so they need a different name and in computers in software you just use U V and W then so when you see u and v and W you know that it's locked or attached to an object and it can rotate when it's x y z you know that it's Global that it's just from the origin of the world aligning with the world's uh coordinates uh or directions hope that makes sense so now we're done with this now I promise we're done with this and we move on to here right so I had the surface I divide it up into points I will I can increase the amount of points 20 x 20 let's say or maybe less 13 by9 sure and I get a bunch of points sure and also I get a bunch of normals the normals uh just like here I can use amplitude for the normals I can use 50 for the amplitude and I can use Vector display you know as an anchor and you can see the you know that the angle at which these normals are um drawn I guess you know the directions of the surface at different points what's the purpose well for example if I want to use CNR Circle normal Center normal radius then I can say and I want to place a circle that's aligning with the surface um on these points right then I can say well the centers of the circle should be the points right and let's say the radius is like 10 or something 10 is a little bit too much let's say eight right all cool and all but the circles are horizontal right if I were to hide everything you you'll see it better the circles are in the correct place but they are horizontal this is where this is where the normals kick in right because then I can use the normals to align the circles to follow the curvature of the surface right because suddenly the circles align themselves with the normals so now if I hide that and hide that I can see that this is becoming much much cleaner right and now I have my uh my my my little circles and then I can also use use this information to let's say extrude you know extrude these circles along what direction along the normal Direction with a certain amplitude because I need to give it a a strength right because if I just use the normal extrude like that it's going to be locked to one unit you know because that's the strength of these normals one but then if uh if I use the amplitude and I extrude then they will be extruded by 50 units right and I can control the Extrusion rate cool huh and that gives us the the Extrusion right so those are the you know one of millions of useful things for why why you need to know you know understand the tangents and the normals okay group that internal alyze that internaly that and hide that so that's about it when it comes to uh vectors right of course there's much more to it but most of it I think I have covered most of the base uh bases I think I have covered and vectors let's say will be beautiful pink color that's yeah oh great o a little bit too [Music] much I accidentally made this a default color it is what it is uh right click color a lighter pink something like that okay so that's that's vectors then when it comes to planes it's quite a similar thing as vectors except that it's like two-dimensional right it's an object on which you either build things or on which you can move things around so in Rhino uh you are accustomed to the world XY plane you know a plane has an origin a plane has its X Direction y direction and it has a z direction right and it follows a right hand rule which is basically if you hover if you do this you know thumb this finger and this finger right if you did do this and you have your uh let me remember oh no oh no yeah yeah if if you have your thumb and your y uh if thumb is X and Y is sorry if thumb is X and this finger is y then this finger is set and it shows that it's looking upwards if it would be flipped and X is looking this way Y is looking this way then Z would be looking this way Rhino gang signs uh Rhino is following uh the r hand red hand right hand coordinate system rule um programs such as Unreal Engine or Maya follow the leftand coordinate system rule which means that stuff that you export from Rhino into Unreal Engine will typically have its y AIS flipped and stuff will be mirrored which is weird but okay I'm getting sidetracked so a plane has an origin and two or or three axis right XY Z axis so there are multiple ways of how you can define a plane you don't need to Define all three axes because two is enough for the third one to be calculated and if I were to go to uh Vector tab plane here here we have all of the different ways of how you can actually use the plane tool or create the create a plane and how why you would need to create a plane uh that's going to be um a completely another thing I'll of course show you a quick example of where planes could be used but for now uh let's just let's just create one right so under plane there is this construct plane plane out of line the two lines uh if you have a line and a point you can create a plane a plane between three points and so on a bunch of different different methods so I will use the simplest one construct plane bam and by default it just creates a plane at uh origin 0000 0 with xaxis aligned with X and Y axis aligned with Y if I were to let's say if I want a plane that is crooked that that's some somewhere just floating um what would be the best best idea for me to show you this let's say our origin is actually construct Point our origin is actually 10 units along the x coordinate 5 units along the y-coordinate and 11 units along the Z coordinate right that so the plane moves that's the origin of the plane and then for the x-axis let's say I actually want to construct Vector that's only deconstruct okay let's go to vectors Vector oh Vector XY Z of course it's not construct Vector like that bam that's our x-axis and right now since it's set to 0 0 0 um it has no length so this is just freaking out it's not being it's not able to construct a plane so for this plane to be actually constructed I need my Vector in X um coordinate let's say to be uh let's see five right so now it's or actually it doesn't really matter if it's five or it's 55 or as long as it's not zero right so I I just do one in X Direction and one in y direction direction right so it's crooked like that and you can see that even with me just giving it an xais IT rotates the Y AIS uh by 90° and it it interpolates where the y- axis is and from it inter interpolates where the um Z axis should be and if I give it even the Z component to this as well like that it's still going to you know properly draw the x-axis and then from it is going to figure out where the y- AIS should go so what happens if I also give it the same Vector for the y- axis breaks does not understand right but the moment I start uh denying uh some of the uh some of the values for the Z component or X component it starts to correct itself and it starts to understand you know TR try its best to align right this is like giving it like locking it in so much is a bad idea by the way uh you should not um the the best way is to actually have like a proper um proper threep Point setup and you know exactly that things are aligning properly for the construct plane to work but you know for for the sake of just training this is I think good enough so I'm going to keep it here a much more um convenient I guess way is when you use the I I personally enjoy using the plane between three points um tool right plane between three points where it just ask me for three points and if I just poop poop poop have these three points Point component my vacuum cleaner just turned on wait no okay we're back so where were we right creating a point component right clicking set multiple points and just getting one two three in here then I will use list item to separate separate them out because this requires three inputs list this is first item on the list second item on the list third item on the list point a point B Point C creates a plane for us and you can see that you know this is the since this is the origin point and this is the X point that the X Direction that's um pretty straightforward but then how does the y direction get interpolated that's that's the question right if I move my uh move the third Point anywhere here the y direction is locked right because it can only be 90° from X right but if I have if I move the plane or the point over here the Y Direction gets flipped which is quite quite interesting and you never see the Z Direction and I really want to show it to you so what I'm going to do is for this plane I will create um where was I uh I'm going to deconstruct this plane deconstruct plane bam and I'm going to show you the Z axis so Z axis AIS just like x y and z z is a vector right so I will use Vector display on An Origin with the axis and it's very small so of course I need amplitude as per usual and for the amplitude I'll use 50 or something that's too much and you can see that now since X is looking that way Y is looking that way the Z is looking downwards if I take this point and I move this over to the other side you know the right hand rule right the coordinate system Rule now the vector is looking upwards the perpendicular Vector is looking upwards and the Z axis in this case is indeed the perpendicular Vector so that's also quite U an important notion to have is um depending on where the Y uh vector is or towards where does the Y Vector look the Z Vector is going to look either up or down that usually trips up students quite quite a bit at early stages of of their learning okay so that is um the premise of of creating a plane and of course as I mentioned before there are multiple ways of how you can create planes some are trickier others are um easy I kind of want to show you one example uh for example for one example for example if you have a polar line that's too many points let me do it again 1 two three four five six seven let's say it like something like that and that polar line is weird rotated like so and it's a little bit crooked it's not a little bit not planner a little bit messy right just slightly well that's not slightly but you get you get the idea right just slightly crooked then to actually make a surface out of this you know you can't use plender surface or anything like that in Rhino so um you kind of can clean it up in grasshopper uh quite quickly I will take this curve I will curve reference it in of course po I will get all of the points of the Cur curve so I need these these control points of this polyline so for that I will use you can either use explode explode which gives you the vertices that's cool and all or you can use discontinuities discontinuity is basically where does the line change direction rapidly right so I prefer to use discontinuities that gives me all of the points right along the curve and then for these discontinuities I will use a tool that's called plane fit right here plane fit fit a plane through a set of points does not tell me how many it's just going to try and you know do its best to fit the plane like that bam a plane is now fit and you can see that it's like in a weird spot and I can should I okay I'll show you how you can move the plane into you know the middle of of this surface it really doesn't matter where it is because a plane technically is infinite in size just like a vector you know it's just directions so it's does not have a size I can even go one step further and show you if you go to display tab here the top preview plane size here you can change the plane size to whatever size you want 200 sure no problem now it's 200 right and now you know my my little uh surface here or curve here kind of fits on the plane but I tend to have them smaller so that they don't uh intersect too much right so that plane uh even though it's located right here it doesn't matter um you know it still has the same effect because it's just infinite an infinite surface with that being said the representation of the plane can be moved you can move it right and actually not just representation you can um while if you move the plane along its X and Y Direction wherever you want right the moving of the plane along its uh Z Direction offsets it offsets it and that's quite important so I'll I'll show you how to do that and uh well actually right now so if I were to yeah let's build a little bit of a trickier trickier system first step I want this plane to be in the middle how do you get a middle point of the surface right of of this U polar line well you can use polygon Center polygon Center tool connect Polar line there and it gives you uh the vertex average the area average oh sorry the edge average and the area average and I believe area average is yeah it can't calculate it because it's non planner um typically I always use vertex average the first output which gives us a point right and then for this plane I can use it to fit not fit sorry sorry uh plane plane origin yeah there we go this plane origin tool plane origin Base plane that's the plane that we have generated origin point the center point bam that's it now this plane is represented on this Center Point right easy as that I'm as you can see I'm really quickly hiding things uh it's it's just a habit uh once something works you just hide everything um to to clean things up on the screen then for this plane this plane I want to be able to also move it along its Z axis up or down wherever I want but along the Z axis right how do I do that well I can take this Center Point that we have here and I can move it move you know move it along some sort of a vector right and after it has moved that will be the origin point of the plane right right now it's not good because it's being moved along vertical Z axis because that's the default movement uh of this move Tool uh so instead of uh using the vertical Z axis I want the Z axis of this uh of this plane that we have created right I want this bad boy right here so how do you get a z axis of the plane well that's the same way of how we got it here we used deconstruct plane I'm going to do the same thing here deconstruct plane bam like that now we have the Z axis and I'll use amplitude to define the strength of that Z axis and I will actually this time around I'll create a you know a proper slider between minus uh 20 dot do0 do do 20 enter slider between minus 20 and 20 right connect that to amplitude and connect the resulting Vector to the move and now what you have is you have um a plane that you can move up or down okay what's why why what's the purpose now since we have a curve that is messy right and we have this plane um origin uh or or this this plane um that is flat and we want this curve to be flat what we can do is we can project an object to the plane so you can see here the first one is Project a curve onto a BP that's doesn't work a second one is Project an object onto a plane excellent that's what we want I select it ask me for geometry the geometry is our curve asks us for a plane the plane is the you know the the new one that we have created that we went through so much effort to create Ma and it just simply projects this uh nonf flat curve onto a flat plane making it a flat curve and now I can use boundary surface to make it flat right alternatively I can also take the the original curve and take the projected curve and merge them into one list let me make this bigger original curve data one projected curve data two merge them into one list uh you don't need to do this and I just yeah merge them into one list and then I can use Loft to make a nice little Loft between them oh ooh okay sometimes when you make a bunch of nodes when you use a bunch of nodes when you use a bunch of functions it messes up the address of the list don't worry about the address part I will cover that in like an hour or so once we get into the data Tres um just understand that sometimes the list uh addresses the names of the lists don't match up and this is the case uh in this in this case that's the case if I were to check with the panel what I get you can see that I have I don't have one list I actually have two lists they are separated for some reason and I have my referenced polarine curve right here as index zero and my polarine curve that you know I have generated that I have projected uh right here in this list as index zero right so there are two separate list lists living in one merge why that happens I still I understand why that happens I don't understand why it wasn't coded out of uh of the functionality but it is what it is a very easy fix when you see this happen and when you think that well clearly these two objects should just join up into one list you can just rightclick on the result and you can choose to flatten and that is just just simply going to to flatten it yeah clearly flatten it makes sense right um this is called like data tree like manipulation and we will get to that chapter in the as I said in an hour or so uh before that I don't want to dive too deep because it's um in my opinion the hardest portion of learning grasshopper so that is going to be uh much for now trust me bro it's going to be flatten here and then suddenly The Loft works right so now what I have is I have a crooked curve and a flat curve and I am lofting between them and with this amplitude I can choose you know what what's what's the thickness where do I you know get the Loft as well as the surface here I guess you know the boundary surface and the Loft right what's the offset I guess that that's that's the how I should call it so of course this is a much more complex version of what I wanted to show you a much simpler version Let me you know this is complex that's the original one one second and a much simpler version I will just copy and paste this and I'll delete a bunch of stuff so you need a curve you need discontinuities and you need to fit the plane through the discontinuities but then you don't really need a polygon Center you don't need to deconstruct it you don't need the amplitude neither you need to move it because you already have the plane all you need to do is just project it and you don't need any of this and you get your flattened uh flattened curve right from here which from which you can create a boundary surface right so you can create a a surface from it so this is just you know to show you a few Concepts and the actually like the the the real structure or the real definition is just here it's much much simpler right and that is how you uh internalize that is how you can flatten out any you know a little bit crooked curve how you can clean things up hope that helps okay delete those so those are basically uh planes let me let me just check if there's anything else of course you can rotate the plane along its Z axis [Music] um Can offset the plane so instead of using this uh amplitude you could use offset plane tool where is it there it is offset plane but then you know you still need to uh type in the offset distance but all of this yeah all all of these three nodes can be replaced by just simply taking the plane and then offsetting it by minus 5 [Music] um and for now that's it for now I don't really want to do too much so I think we will stop with the planes here okay one last thing I promise I promise one last thing if I have some sort of a surface and I will talk much more about it a little bit L later on but actually one second okay or actually let's talk about it right now um I'm just changing my there we go I'm changing my notes so that that I talk about it right now okay intersections right planes and intersections work quite well and I will cover that a little bit right now so for example let's say I have some sort of a some sort of a shape poop circle circle oops circle circle and this is let's say smaller and this is let's say squished and this is let's say squished a different direction and um this is also rotated and this is rotated a different direction and moved here whatever LOF looks ugly but uh that's fine uh and capped right I have some sort of a weird weird ass looking shape right um I can get it in here as a b set one B you can just draw like three circles Loft between them uh cap and that that's going to be exactly the same thing right I have it as a B I hide the original shape in Rhino and then here let's say I want to extract certain sections you know a along this the shape I I want to extract like ribs along the shape how can I do that well one way is to actually just create an XY plane XY plane is the default plane right here and move it up by series of numbers so we move the XY plane up in Z Direction unit Z by um series of numbers so series and I will say well first of all let's check how it looks like okay that's way too dense so the step size is going to be like 20 like that it should start at a lower level so it should start at minus or I'll just use a panel for this panel minus uh 50 or something like that like that minus 50 was a little bit too much but we'll adjust and the count the amount of how much we how many we use is going to be like uh well right now it's 10 let's do like 20 just in case bam of course it goes beyond now but that's fine so I have a bunch of planes right then these planes as well as this B can intersect I can find intersections so if I go to inter the intersect tab under is it mathematical I think it's mathematical under mathematical there should be B plane intersection right here I use it B goes into the B plane goes into planes go into plane and it's complain complaining intersection failed ah of course intersection fails in places where plane does not hit the B and this is one of the instances where it actually works as expected except that it's complaining really really hard because it can't calculate any sections for these so what I'm going to do is I'll I'll um reduce the count until it's happy with us 15 12 11 okay 11 after doing um after reducing this is not complaining anymore and I will hide all of the previous except the final one and these are going to be the floor slabs right so I can uh for these curves I can um offset them a little bit inwards or actually no for this example we stop with a using it we'll just use uh boundary surface like that extrude in Z direction or actually we don't even need to use boundary service apologies the curves can be extruded in that direction by let's say three units and then they can be capped and we have ourselves floor slabs you know for that particular shape and I can since this is a parametric model I can change the I hate that it makes that sound one second like that maybe that's going to be a little bit better okay so we we can of course change the the the um range of it and now I can see that it's complaining again okay fine 21 not complaining anymore great so this this guy is complaining a lot that's fine so now for any shape that you have you can create floor slabs easily you know generate floor slabs easily right of course you know in this case the planes are horizontal because we're using XY plane but you can use any kind of Direction and make a slice uh you know of any geometry in any direction because here under mathematical uh plane can intersect with uh curves with meshes with B reps um it can intersect with surfaces and so on and also of course here you can do much more you can intersect two pieces of geometry together and so on right if you're looking for Boolean operations such as Boolean Union Boolean difference bull intersection that is under shape here you will have your uh solid Union solid difference solid intersection so while in Rhino it's called Boolean Union difference intersection here it's called solid Union difference intersection ask me why I don't know uh there's also mesh Union mesh difference mesh split that seems to work sometimes sometimes it does okay so that is that with the planes I believe uh just give me a second I need to to check yeah for now that is it okay we can move on to the next one okay it's time to get on with the 3D geometry or rather to start talking about geometry types and how you manipulate them in grasshopper so we will begin with meshes meshes is one of the three different types of geometry that you are able to operate with when working in Rhino and as well of course when working in grasshopper so we have meshes you have nervs based geometry B reps and you have subd geometry in this chapter I will cover meshes so I guess we begin by me stating that meshes are the simplest form of 3D geometry representation and everything that you see in uh let's say animations for example you know just Pixar or whatever animations or video games and so on all of those geometries are meshes simply because the geometry itself is very lightweight and you can use meshes for multiple things um for you most important two most important ones being first simulation you can't really simulate nervs geometry that well because of the calculation times meses are much easier to simulate simulate for instance physic simulation and the second one complexity when you need something to be super complex for like a most basic example would be a clump of hair right if you need to generate a clump of hair a bunch of pipes if you will if you were to do just a regular pipe tool the computer would crash so you need to optimize and use meshes for that meshes can be 3D printed when it comes down to you know manufacturing them in some other ways like CNC mailing there are certain limitations but recently they have been kind of worked on and now it seems to be a pretty solid U type of geometry for manufacturing as well okay so enough blah blah blah meshes consist of three major components they have or actually I'll I'll write here scribble they have vertices vertex they have edges and they have faces and basically the edges when it comes down to actually kind of working with the mesh or constructing a mesh edges are just simply a byproduct of faces being constructed from vertices what do I mean by that let's say you have um let's do some let's say you have 1 2 3 Four Points in your your uh Rhino window right and I'm going to draw the same points in grasshopper come on oh we have the drawing tool 1 2 3 4 1 2 three beautiful four okay so I have these four points here right and those are vertices right and I can then Define that a mesh should be created a mesh face should be created between points 1 2 3 and four if I were to Define 1 3 2 and four it would create let's let's do a red color here if I were to Define 1 3 2 and four it would create a face like this which is no no go but if I Define it correctly 1 2 3 4 then it gives me a proper mesh face a mesh face should be a triangle or a quad a four-pointed surface right it technically can be an Eng gon meaning a pentagon a hexagon a heptagon octagon and so on it can be that but but the typ topology of a mesh then gets a little bit fuy Walky and we don't want to deal with that so at early stages of your like learning just think of mesh equals a collection of triangles and rectangles representing some sort of a three-dimensional form right so let's create this from these four points first thing that I need to do and these are vertices and this is a phase and this is of course an edge right so the first thing that I need to do is I need to reference in these four points point right click set multiple points 1 2 3 four enter we have our points here oh uh you might at this stage once you have a lot of points it might become a little bit tricky to follow which one came first which one came second and so on on so you actually can number them by the way you can use a Point list tool Point list tool to get the points in here and then for the size this is just the size of the text you can Define you know whatever 10ish a little bit more 12 you know and now you can see exactly you know this is the first one second one third one fourth one you know four points okay so now do what do we do uh wait I need to I'm going to cross the the the wires but in the long run this is going to be a little bit cleaner now to construct this kind of a phas we need to use well we can go to the mesh uh Tab and here under primitive we can choose the first item on the list construct mesh construct mesh which asks us for vertices you know so the points easy and immediately it gives you the phas right uh well a single mesh face and why why does it happen well that's because the faces input is already um filled in with an instruction So the instructions are as follows well you can clearly see it now q and in bracket 0 1 2 3 right I can write it as well uh let's move this down I can write it as well in the notepad or in the panel here Q in Brackets 0 comma 1 comma 2 comma 3 connect you know and then it creates a quad Q means a quad if I were to say t 01 2 without the three because T is triangle and it can only use three points then it's going to create triangle between these three right Q creates a quad 0 1 2 or actually if we do 0 one2 then it's still going to create a triangle honestly but it's going to think that it's a quad so don't do that if you're specifying Q then you know give it four points but what we can do more is if I then add one more point in here then I can clear values here clear values means that we remove the referenced points from here uh set multiple points and then I can do 1 2 3 4 five right and now I have one more Point here to play with and what I can do is I can say well right click multi-line data first of all this should be multi-line data and then I can make another line here and say actually give me one more triangle in Brackets and in between two comma 3 comma 4 like that and see how the shading became a little bit weird that is because this mesh face is defined clockwise while this mesh face is defined counterclockwise so they don't like that you need to choose either clockwise or counterclockwise if I now change this from uh 23 4 to 2 4 3 clockwise right now the shading is fine it's displaying everything correctly so this is another thing that really messes up people is the clockwise versus counterclockwise and for instance now if I were to just move this point up and to the side like so I can then build up a 3D shape from these points right um give me another triangle we're doing clockwise so 0a 4 comma 3 bam I get a triangle here give me another one or actually we can build it up with a quad if actually two triangles better uh 1A 4 comma 0 and then one more triangle uh 2 comma 4A 1 and that's it now we have ourselves a pyramid from you know well not necessarily a pyramid because I can start messing around with these guys right here but you get what I mean right we have a set of points that's one list and then the second list is a set of instructions on how those points should be connected into a mesh and the nice thing is that also a mesh can come with colors but we'll do that later let's not let's not focus on the prettiness just yet okay so that's that's that then when we have a mesh we of course can deconstruct it Decon mesh and we can deconstruct it back into vertices faces but this time also normals so what are those normals if I were to check it gives me five normals and I have five um H actually that's interesting it gives me five normals but those are probably not face normals those are probably vertex normals uh because I have five vertices I also have five faces give me a second if I delete one of the faces it's still five normals okay so it does give me um contrl Z to get back that phase uh so it's not a normal of the surface of the mesh but rather a normal for the point of the mesh so let's check those out Vector display anchoring on the points showing the vectors H showing the vectors much much more strongly amplitude let's go for a 10 let's go for a 100 there we go and those are the normal vectors that it gives us what the hell are we looking at now there's no way oh I'm sorry give me a second thinking that just feels like no it's weird Okay abort Mission abort Mission we don't use normals from here uh because they're yucky and weird unless the mesh is actually uh broken let's take a look the mesh is actually broken uh unify M almost H Okay so us creating the uh us not aligning the mesh properly messed up the normals of the mesh uh not aligning the the the instructions of the mesh properly messed up the alignment of the mesh apologies for that you can always use unify mesh normals uh unify mesh right here uh get the result in there and then the normals start making a little bit more sense apologies for that I forgot that it's not just clockwise or counterclockwise you actually also need to align the you know what's the starting uh verticy here um as well if you want a clean mesh but this UniFi mesh node uh just makes sure that all of the points start from the correct in the correct sequence sorry the instructions start in the correct sequence and th you know it cleans everything up ah anyway back to back to where we were uh this UniFi mesh cleaned it up we get to deconstruct the mesh and we get to see the normals of the vertices so it basically just catches the average um normal of three faces that surround each verticy except for vertex number four because vertex number four is surrounded by four faces and not three but it's still an average direction of all those four directions right so if you want to actually just get the direction of the surface the normal direction of the surface you can always go to analysis and use face normals tool face normals we get a mesh in here we get the centers we get the normals and I'll use the same crl c contrl v um that the vector display and the normals right here and then we get the phase normals of the mesh right and again that is very going to be very useful in the future once you start creating stuff on the meshes and you will need to move that stuff along on the mesh faces right so that's that's it for this portion all right so what else can you do with a mesh right if we go into the Primitive there's of course you know you can just construct a mesh plane mesh sphere and so on um those are pretty simple but I honestly unless you of course need to but I honestly would suggest uh if you need construct Primitives then construct them in Rhino because you have a little bit more control over it and in rhino in the mesh tab mesh tools tab of course you will mesh creation you will have all of the possibilities here and while we're at it I'm going to actually I'm going to internalize data here so that I can delete these points and I'm just going to quickly create one mesh taus like that and one mesh sphere like that and I'm going to make them overlap just like this so you're probably used to meshes or sorry nervs geometry Boolean difference Boolean Union in you know with nerves geometry meses can do that as well but in my experience which might be this is very anecdotal so it might not be true um but simply from from my experience in using meshes grasshoppers uh mesh Boolean mesh difference works much better than rhinos might be a tolerance apologies might be a tolerance thing I'm not sure but it just seems to work much better so the way you you use it is if you reference in mesh one set one mesh bam mesh two these are just empty mesh containers set one mesh bam you know one and the second are now selected now I can hide them in Rhino and then if I go to intersection tab shape and here I have mesh difference mesh Union and so on so for instance mesh difference right from mesh a remove mesh B hide the inputs and that's the output that you have that seems to work quite nicely then we have of course mesh Union the first one and the second one should be connected High the mesh difference and these seem to be connected also connecting also quite cleanly this works only for closed meshes of course meshes that are water tight that don't have any openings and are enclosed geometries because then Rhino can or grasshopper can understand what's inside and what's outside and also it tends to work only with meshes that have a low polygon count right once you get into the millions it doesn't really work that well so then you need to use different kind of approaches that I will teach you later right so that's like mesh Union mesh difference and last one mesh intersection mesh a mesh B and we get the area that intersects between the two show selected oh I have a bunch of hidden stuff here and let's go for white frame View and you can see now as I move the sphere around you know it trims out a portion of the shape so that's neat that's nice okay so if if you want to create some sort of a unique uh unique shape usually you know that that is one way of how how you can do it keep in mind as I said before uh lower resolution Works higher resolution doesn't work uh then so this is one thing that's that's like mesh operations or solid operations with a mesh another thing is I already mentioned this but if you have a network of curves or actually apologies I believe that mesh pipe is only available if you have a plugin and we will learn about plugins in the plugins chapter of this course so for now I skip over it sorry okay well what else okay I I think one more uh one more to to show you I will create under primitive I will create a mesh plane mesh plane which basically asks me for a boundary which is a rectangle right so I can just draw any kind of a rectangle here reference it in as a curve set one curve bam that's my boundary and it asks me okay how many divisions do you want in X and Y direction right so uh for now it's 10 x 10 I believe it's 10 x 10 yeah 10 x 10 is fine I will keep this as a default I get my mesh then remember we talked about that there are vertices so I can extract the vertices of the mesh by simply using the uh deconstruct mesh tool deconstruct mesh which gives me the vertices as points so these are um points it gives me faces but it gives me faces not as uh surfaces but rather as text you know it gives me the instructions and then it gives me colors that are none right now and normals that are vectors right like this so from the construct mesh from these kind of components from which a mesh is built I can only get the point component right I can only get the vertex how do I get edges as lines and how do I get faces as surfaces good question in under analysis you can get mesh edges right here mesh edges which extracts all of the naked edges all of the Interior edges and all of the non- manifold edges let me guide you through it naked edges curve are all edges you can see me now it's highlighted green they go along the perimeter naked edges are basically all edges that are not surrounded by faces right so this Edge is only surrounded by a face on one side and the other side is empty this Edge one side other side is empty this Edge this Edge this Edge this Edge this Edge this Edge right these are naked edges interior edges are faces or edges that are curves that are surrounded by by faces right from both sides so taking this again we have this one is surrounded on both ends this one is surrounded on both sides this one is surrounded on both sides and this one right those are all interior edges and the non- manifold edges are bad always always bad a non- manifold Edge is basically um if I if I were to do I model no I'll draw let's say you have one mesh face right here you have a second mesh face right here and then you have a third mesh face right here going up right so then this Edge right here is sharing or is being surrounded by three three faces this is a non-manifold edge which makes it so that the mesh uh cannot be the front side and back side of the mesh cannot be calculated the volume of the mesh well technically cannot be calculated and also you can't offset the mesh without having it self intersect I can try to explain it right here in Rhino a little bit better if I were to go to my mesh tool uh and I were to go for mesh creation and I just create one little mesh pH here and I will do another one and then I will do one more okay bear with me for a second and I move this up and I it's very crooked just like that and we change to shaded view this is what I drew right this Edge right here is a non-manifold edge right so let me explain now the front faces of my mesh are colored in Gray and the back faces are colored colored in Red so here it's fine and usually you want you know all of the gray to be on one side of the mesh and all of the red to be on the other side of the mesh this phas messes it up because suddenly we have a red color here that connects to the gray color so back pH connects to the front phase if I want to offset and if I flip it by the way then here it's fine but then you know again here it's bad there's no Arrangement where this works right if I were to offset offset this mesh you can see how it's self intersecting no matter what right simply because it cannot you know I I offset it downwards and it makes something like this looks great but then I look at the the the surface here and it's just a show apologies for uh my my my speech but it's just uh it's just bad right so it's all self intersecting and all really really messy so you don't want that to happen so never have non manifold edges easy if you see one delete that face and build rebuild the mesh with new faces attach new faces that don't produce non- manold edges sorry for uh extending here but this is important so I wanted to spend a little bit more extra time but with that being said we have our naked edges we have our interior edges and you can use them in in tandem as well uh you can just wait can we I'm struggling here a bit can we just merge you can just merge interior and naked and now you have you know as a result you have all of the me mesh edges right okay and the last one is under an how to get the faces themselves so under analysis there is this mesh explode the compos a mes into its faces bam and now I have have a separate um mesh per each face that is if you want to get you know like a separate entity here and then you can do like a weird thing where you take all of the faces here one second you take all of the faces here and you deconstruct them wait do you uh sorry sorry you don't deconstruct them you use um edges or actually I'm jumping around you do deconstruct them deconstruct mesh because then you get four points per each phase and then for these points you can actually um four point surface four point surface you can create a surface from four points but for that you would need list item you know because here they come as lists of Four Points so here you would need to 1 2 3 separate them up to. 1 Point 2. 3 point4 Corner a corner b Corner C Corner D and now you have a bunch of surfaces right if I were to bake this these are now Nerfs surfaces so there are ways of how you can convert a mesh back into nervs but usually it's very very heavy and you shouldn't you shouldn't do it um unless you really know what you're doing all right so for now I'm going to uh have this have this deleted so that it's you know you don't get the wrong idea that's one way of how you can get faces if you don't need the meshes themselves if you just need the perimeter you can always do uh phase boundaries tool you can always use phas boundaries like that and it gives you basically a bunch of poly lines right uh separate poly Lin separate rectangles that you can work with Okay so those are mesh components let me group that let me intern internalize is the curve all right uh what else is there of course you can measure a mesh area you can measure a mesh volume actually I kind of want to show you this um I can I I want to show you a a few things um a b a nur's polysurface can be easily converted into a mesh very easily a mesh cannot be easily converted back into a nerves polysurface simply because nerves has much more information than a measure does in the next chapter I'm going to teach you about nerves for now it's just meshes so when you are converting nerves into mesh it's almost uh like a destructive process right because you're getting rid of information and you're rebuilding everything out of triangles and quads if you will and I can showcase that quite easily if I just um I I'll grab this shape right here that that we used I will get it as a b in here set one B actually I internalize why not and then delete it does it choke out okay it's choked out here uh one second internalize that okay now I can delete it okay I'm internalizing too much it's going to freak out uh but that's fine for now okay so this B how do you convert it into a mesh the easiest method is to just simply run it through the mesh component and it automatically meshes it let me hide the B and you can see all of the quads and triangles that it created that it made to create this mesh easy peasy not a lot of control though you're just basically just praying that it's going to have enough resolution a much higher degree of control is to actually use uh mesh B component meesh B with custom settings custom settings or settings custom like that by the way I'm I'm sorry if you don't actually see the edges you should but if you don't see the edges you can always go to display preview mesh edges right here right display preview mesh edges shows you the edges of the mesh shows you those lines there so now the settings the mesh B settings let's move this to the side a bit this right here uh first one being Stitch seams we don't care about that okay I I'll just go for the important ones okay um basically the maximum distance and maximum angle are the two important ones maximum distance is um how close should the mesh be to the original surface if I specify actually only 1 mm for the max distance it's going to be very lenient with you know how it meeses this but if I say 0.001 mm it's going to make a much much higher effort to be precise right so maximum distance is basically how you control the density of the mesh and how you control the Precision of the mesh right that's step one maximum angle it's basically what's what's the maximum angle that you can have between two faces usually you know if like 5 de or two degrees it really depends I'm sorry but it really depends on what kind of a geometry you're dealing with in this case maximum angle I'm choosing 1° right so you can see how dense the mesh just got but if I were to bake this in again I use the insert key and if I were to look at it in the Arctic view you couldn't be able to tell the difference between a mesh and a n's poly surface the resolution of this would be Immaculate right so those are basically the two main um inputs that I use for for meshing a b and that gives me a much much higher level of control than just simply running it through a mesh mesh component there is a third version a third variation I I should say which I will do I think something like this it's called quad remesh it's a new well not new anymore it's uh was created in Rhino 7 for Rhino 7 quad remesh algorithm which basically takes uh it actually asks you to give it a Mes in the first place but we'll just give it a b see if that works yeah it worked out and it does its best to remesh the geometry to be only made out of quads and as as you can see it does a great job at it most of the time it it's pretty good and then here it does have its own settings so we can quad remesh settings we can get those we can connect those and in these settings I would honestly suggest that you first is just start with Target count this is how many faces you want so if I say well try to do it in 50 with 50 faces I mean it tries right so it tries and it does it but it's not not a great uh great output but if you give it like enough let's say 500 faces you know it's starting to get there 5,000 faces that's pretty good right so 5,000 faces uh with insurance that this is going to be a quad mesh you can see that it's um you are sacrificing certain things when you are quad remeshing uh but it is what it is right you can't have it all uh there are guides that you could use to sharpen this up but for for this particular course I will not be uh showing those because time time is of an Essence so those are three ways of how you can convert a b into a mesh I hope that that those will help you actually while we're still here I will do one more thing with this so under analysis you have mesh area and mesh volume so for anything that is closed such as this mesh B you can calculate its volume right so I can go for analysis mesh volume connect that and it gives me a number for for the volume of the shape but more importantly it gives me a centroid what's a centroid it's a point it's a point that is right in the middle of my mesh shape you can also by the way uh calculate a volume of a B in the exactly the same way and it's going to give you the centroid in exactly the same place right a volum metric centroid so sometimes uh for geometry it's quite important to find the central point of the geometry and that is how you do it is you just use mesh volume there are different ways you can get um all of the vertices all of the vertices and technically the average average of the coordinates of all of the vertices is also uh U centroid but that is a vertex average centroid rather than volumetric centroid so those will not match up so I'm not going to show you that instead for now volumetric Android is how to get the center point of any um closed of course shape add to group there we go one second yeah yeah yeah yeah oh mesh inclusion okay that this is going to be an interesting one so for this mesh that we have here let's create um grid of points around this mesh in X and Y and Z a three dimensional grid of points in X Y and Z direction right H it's very easy by the way you just create a point or actually let's reference in the point point Come On Point right click set one point there we go iMed mediately I'll internalize it and we will just use box array box array for this uh there's an array linear array which copies a thing along a line right there's rectangular array that copies a thing along two lines you know so populates a surface with a thing and box array which basically copies a thing in three lines or populat a volume with it so I'm going to use a box array uh which asks me for you know what do I want to array that's my geometry that's my my point it's going to ask me for what's the cell size and cell size is basically it asks me for a box that has X Y and Z size so it's from it it will know the step size in X Y and Z direction right so if I were to create a box um what's the easiest one let's do a domain box yeah let's do a domain box the base doesn't matter at all but XY or actually Let's do let's connect point to the base so that we create the Box in here and here I'm just going to write uh what's the X size the Y size and the Z size so in X let's say it's uh 10 and why let's say it's five and in Z let's say it's also 10 something like that I create a box and then I use it as a cell right so immediately it knows you know as it's copying in X Y and Z Direction this box array it knows exactly by how much should it copy you know what's the step size and I can now control it fully right so that's nice and then for the count I'm I'm just going to do uh 100 by 100 by 100 is 10,000 so let's do that I'm going to create a number slider 100 and I'm just going to use it for all three of these inputs that's creating 10,000 points that might have been a little bit too much let us reduce 50 oh the sound is back e go away okay should be good um so 50 by 50 by 50 that seems okay or actually even less 30X 30 by 30 and then I can take that point and I can move it wherever I want to you know completely engulf the structure or not completely but to intersect with the structure as much as I can like that okay so I have my point I array it into this threedimensional array right of points uh 27,000 wait oh crap 100 by 100 by 100 was not 10,000 100 by 100 is 10,000 and then 100 more that's why it was crashing anyway moving on uh 30 by 30 by 30 uh 207,000 points yeah makes sense uh 27,000 points and then we simply um want to delete all of the points that are outside of this shape right so how do we do that well we have our array of points we have our mesh and for the sake of clarity I'm just going to create a mesh component here and I'll connect our mesh B to this mesh component so that I can just simply drag it out and hide this and continue on the script here it's just a method for for cleaning up the the script making it a little bit more readable okay we have our mesh we have our geometry I need to delete all of the points that are outside of the mesh what's the tool the tool is called mesh inclusion this one right here test a point for mesh inclusion bam we have a point or we have multiple points we have a mes immediately tells us if the point is inside or outside so it gives us true or false statements scroll scroll scroll where was it I know we did it where are you true or false true or false distance remap numbers cap holes larger than there we go that was also true or false statements and we used dispatch right we're going to do exactly the same thing dispatch what's the list the list is going to be our points right so we're dispatching from our points actually I should probably just have it here we're dispatching from our points and the Matrix that we're using or the not the Matrix sorry the filter that we're using is if it's inside or outside the true or false statements generated by mesh inclusion bam now we separate the points into two lists one that are inside one that are outside how do we know which one is which well we we just create a point component and we connect it to list a and we select it and then the green ones are the ones that are in list a they are inside that's the one that we need I will hide literally everything except the final uh node now I have a bunch of points here right and I could create uh what do we do with these points we could do Minecraft right because the step size between the points well in this case the step size is yuy so let's do a proper 6X 6 by 6 step size between these points and then I can just create a box can I do a meshbox I'm not sure if you have uh if you have meshbox available without a plugin install just in case I'll do a simple box this might crash some of your computers I'm sorry uh domain box the points are the bases and the XY Z size is the same thing as here so it's going to be six six oops my bad 6 by six by six congratulations Minecraft insert wait for it to bake out it's going to take a little bit of time Arctic view that's how you box alliz and for this I would never use uh and by the way all of these are separate entities separate boxes that you can simply that was upside down you can just move out and you know you can you can work with them I would never use a NS poly surface for this uh in the you know for the actual geometry but since I don't know if you're if you have meshbox component meshbox this bad boy right here since I don't know um I don't know uh I will not be using it for now okay so that's the second uh iteration of this script let's think okay analysis there's a mesh closest point component that's whatever mhm and utilities we have mesh surface mesh from points callor faces delete faces um I've noticed that some people try to use mesh join this node right here to BU instead of mesh solid Union or whatever it's called mesh Union instead of this one so if you want two meshes to merge into one shape you use mesh Union if you just want two meshes to join into one shape H that's such a bad bad example one second um let's create mesh tools mesh creation sphere ah sure sphere two spheres right mesh right click set multiple po two of them connect to mesh Union connect to mesh join right what's the difference between these two uh oh [Music] internaly data delete okay let me bake out mesh Union move it to uh move it here further away and let me bake out mesh join move it here right the difference between mesh join and mesh Union is if I oh my God uh clipping plane if I clip through this you're going to see it better mesh Union actually unifies the shape into one shell mesh join actually is just able to join the two meshes together into uh one shape but they are not unified right they are still like two different entities and I in Rhino I can even after I've baked it out I can use split disjoint mesh and it splits them back apart while here if I use split disjoint mesh un able to split this mesh there were no disjoint components these have been completely unionized that's the wrong word but I'm sticking to it so mesh Union mesh joint two completely different tools uh make sure that you use the correct one uh also if um for instance one of the meshes is open or even if both of the meshes are open and I clear values set multiple meshes then mesh Union should not oops my bad then mesh Union should not work but it does what the hell okay well that's an update and a half in Rhino 8 that's nice so for simple uh simple openings it still is able to un Union the two meshes together that's cool it used to not work never mind that works okay uh still mesh join mesh Union two very very different uh different objects U uh tools apologies different tools where does this go this can go here okay oh uh what else what else what else what else mhm there are ways of how you can create a mesh automatically from a set of points so if I were to just create a bunch of points here come on imagine you get the landscape from a survey and usually the landscape from a survey has a crap of well actually it has a crap ton of isocurves give me a sec okay usually when you get a bunch of contour lines from the municipality or whatever they come in a DWG format and they come in as Polar lines just like that and uh to be honest usually not that clean um they they don't have you know proper amount of points and they are kind of jagged and they break but that doesn't really really doesn't matter what you can do is you can select this uh cont as long as you have already moved them or they have been moved by the municipality workers or the surveyors to the correct altitude you can get them in here and you can I'm just going to use probably I should do it here curve right click set one curve or set multiple curves apolog apologies it really doesn't matter which one comes first or which one comes last but just generally we we just reference in all of the curves here we get their discontinuities apologies We Gather discontinuities and you can see that it doesn't catch all of the discontinuities so for instance here it's uh like missing the Mark it's not not catching the points there so to force uh points to be caught there you need to adjust the level of the discontinuities and you can see that if one it's curvature one or two is curvature two uh second great than three is curvature infinite I think it's C is for curvature I'm not sure but either way if you just change this for from one right click on the level right click and you use uh C infinite analytic it will always give you all of the points for the discontinuities except here for some reason hello curvature tangency okay analytic sure whatever right it gives you all of the even the slightest curvature gives you you a point so now what do we do with these points well first of all um this is another one of those trust me bro moments because we still haven't reached the data management or data tree sorry data tree uh chapter I can't really um explain it uh to you properly but we need to push all of these points to be in one single list because currently they are separated into separate lists that correspond to separate curves even though they come out as one um um in one output right so what we do to force them into one list is we right click on the points output and we choose to flatten again flatten it gives us the small little arrow looking downwards once the data has been flattened and everything has been moved into one list then we can proceed to create a mesh uh and creating a mesh here is would be pretty tricky you would need to you know Loft here and then you Loft you Loft here but then what do you do when you have a closed curve and an open curve you can't make a loft so you need to start exploding and here it's making a little bit of a mess with the twisting you know you get the drill so instead of that we go for triangulation and we use delone delone deloi Theo mesh this this bad boy right here we get that in here asks us for only two things give me the points give me the plane for where I should kind of fit the mesh onto the plane is horizontal by default XY we don't need to change it the points well we have the points bam that's it makes a mesh for us we have ourselves a landscape there it is if I were to Big this in it's fine you know it it it's kind of accurate it it generates a landscape according to to you know what kind of a the the accuracy of the contour lines that you gave it the edges are usually a little bit messy but that's fine you can always trim those away but the landscape seems to be okay if you want to continue cleaning this up I would strongly suggest using quad remesh like that remesh settings quad remage settings like that and giving it a proper uh quad count so in this case it's set to 1,000 quads which seems to be quite good and now if I bake this one in here this looks much you know much cleaner much nicer I can force it into well actually let's not let's stop here right so that's how you clean up and that's how you quickly construct a landscape from a set of Curves you're welcome should save up a little bit of time for you um of course since this is a mesh there's like to to to make it into uh something that can be used for buling difference and so on operations there are still a few a few steps but the basics are indeed there okay that's it for now that's it with the meshes there's nothing else to uh to specify I think we are kind of done I want to do something like this I think and then place this somewhere somewhere here yeah that that's going to be compact enough I'm now going to spend a little bit of time uh naming all of these and uh then we will continue on with the next chapter which is going to be nervs all right so nervs when it comes down to nerves based geometry well in as I mentioned before in grasshopper it's called BS or surfaces right in Rhino it's called uh poly surfaces or surfaces same thing nerbs it's basically um a type of geometry that is infinite in its resolution what do I mean by that well we learned about meshes and that they are made out of these points you know vertices and those points are assembled into faces you know and thus you get the shape of a mesh which means that if I now really quickly just create any kind of a mesh you know if I zoom into it it has a finite resolution meaning that just looking at it you know from here I can see the jaggedness of it and of course you know you can change the resolution of the mesh so for example if I say it should be 50 by 50 now now it's much smoother but still if I zoom into it I can see you know individual elements so it's like think in Photoshop you have pixels right it's finite in its resolution nervs is not finite nervs is infinite which means that it doesn't matter how close you zoom in it's always going to be perfectly smooth you know a surface is going to be perfectly smooth and I can showcase that by uh creating a sphere or rather I can't really showcase that because if I create a sphere here in Rhino and I zoom into it well it's doing a pretty good job of displaying it honestly but remember our example wait maybe I'll do this instead uh my example with the surface and the two control points by the way F10 to get the control points of the surface and pushing them up like that and how Jagged this is and how messed up it is this is we can also do um extract uh render mesh can use extract render mesh to actually get um the shape that is being being currently displayed which is the render mesh so what the hell why can we extract a render mesh from a nerv's poly surface or ner surface in this case that is because if geometry has infinite resolution then the resources required to show that geometry are also infinite right because you have infinite amount of points that you need to display right and that you need to calculate so what happen is in Rhino and honestly every other software as well is that under the hood the nerves surfaces nerves poly surfaces are being meshed a mesh is Created from them and presented to you visually right so their visual representation is always uh a mesh I think with an exception of the wireframe view where the visual representation is just the boundary curves as well as the isol lines right so and uh as I already showed you uh in previous uh chapters you can control this mesh by just simply selecting the shape going to properties going to custom mesh tick marking that and saying that yo I want to adjust the mesh here and just saying um my density should be one and the maximum Edge to surface distance should be 0.01 mm preview hello preview am I I think we had the same problem before right I think it was the angle so let's go for five why are you not doing anything hello every time I try to show something to you uh it's it's always messy okay smooth and slower preview that's better density that's fine minimum Edge length maximum Edge to surface distance is 0 001 okay give me a second I'll I'll figure this out oh sorry I didn't didn't need a second uh you you just go to adjust and here the maximum angle that was the culprit I was not changing it so here if I changed it to just like one degree you know so between two polygons that are being created the maximum angle between them can be one uh one degree hit preview makes a much much cleaner uh or much much denser mesh where it needs to clearly we hit okay and now the surface is presented to us in a much much cleaner appearance right so that's that's the premise that's the idea uh nerves polysurfaces or nerves surfaces nerves geometry is infinite in resolution and the only way to show it is by meshing it right to Showcase it but all of the calculations when you're evaluating a point on the surface when you're creating stuff along the surface when you're using Boolean operations and so on all of that is made with infinite resolution in mind and the question is well how how can you make infinite resolution calculations in the first place well that's because while here while the mesh is calculated through points and the connectivity between the points the nerves geometry or B or poly surface geometry is calculated through f2x equals sinus x + 15 and then all of that gets clamped in some sort of a range thus you get a curve right a sinus curve and then you have another another function uh f2x sinus y you know in another direction right so we have like two functions together and they're clamped into certain ranges and then you interpolate a c apologies you then can interpolate any point within that range so what I mean by this is you don't really need to understand this it doesn't really matter but it's basically a mathematical formula and the mathematical formula first of all gets really heavy computation wise second of all is infinite because you can insert any number to the X right there's infinite amount of numbers that you can insert to X to evaluated meaning that you know amount of points that you can generate on this surface is also infinite right so that's the idea that's that's the premise um it's all ma mathematics this makes it so that uh the the the geometry manipulation that you can do with nervs is much more accurate and much more uh yeah precise than meshes but also it's much slower and you can't do like simulations for example you need to mesh it to be able to simulate gravity or whatever well gravity is fine but a tensile strain for example anyway moving forward how do you create geometries nervs geometries in um grasshopper well first of all um my suggestion would be to create them in Rhino and then reference them in grasshopper but if you need to uh there are ways so in the surface tab right here you'll find a primitive subtab where you'll be able to create spheres cylinders uh boxes and stuff like that um there are some that are quite useful others that are not so much I don't know if I've ever used cone and cylinder for anything but I sure have used a Center box or a domain box even in this these examples we have already used the domain box uh for for the array right so I guess we will Begin by me showing you know those two and the differences between them so under primitive let's create a domain box let's start with a domain box because that's already familiar there are uh two oh sorry there are three four inputs I can't count there are four inputs first one is the Base plane right so here the Base plane by default is set to be World XY but if I want to I can create one two three points you already know how to create a plane from three points point right click set multiple points one two 3 list item to separate out those points one two 3 right I zoom in to to get multiple outputs and then we uh what is it uh plane three point uh plane plane 3 PT yeah that's the one you can kind of write what you want and it might guess uh and usually it guesses quite well so playing three points point a point B Point C we get ourselves a plane and now if I just move this plane around I'm able to rotate it right properly so X is always driving um the driving of X is always stronger than the driving of Y right so you can see that while the plane is always trying to look at the X uh the point on the X Direction Y is just used to say if the plane is you know if the Y should be in this case going upwards or downwards right so we have our plane if I now connect our freshly made plane into the base bam now our box is being created on the plane right so that that's useful that means we can have um and I I'll show you later but we can have a bunch of planes on top of a surface and we can just add a bunch of boxes flowing along the planes which might end up with a really really nice um aesthetic we'll see we'll see right so now we have our X Y and Z sizes and notice that this is if I hover my mouse this is not a number it's not expecting a number from from you it's expecting a domain and what does that mean well let me draw it for you if you have a plane I should be a bit eh okay you have a plane right and let's just say you have one two 3 4 1 2 3 4 minus one H that's too close does - 2 - 3 - 4 -1 - 2 - 3 - 4 that's good enough and then you want to place a rectangle in this plane position a rectangle in This Plane by while also defining the size of it well you might say then let's do blue maybe and let's say I want a rectangle that is centered in this plane and is 4x4 in size so that means the rectangle would go from minus 2 from uh from minus two it would go until two right so the gap between min-2 and two is four and then it would go from min-2 in y direction until two in also in y direction right so we end up with a square uh let's do maybe also blue but darker Mouse drawings always fun so we end up with a rectangle that is between minus 2 and two min-2 and two we already know what it is well kind of it says here it's a domain right so you define the box and the position of it as a domain so here if I hover my mouse over the x coordinate of it it says - 2 to 2 right so the Box um along the X direction right here this is 2 mm to the left and 2 mm to the right then in y direction is from- 0.5 to.5 so it's half a millimeter here and half a millimeter here right so it's 1 millim in width and 4 millim in length and then in Z Direction it's 0 to 0.25 so it actually starts flush with the surface uh with with the plane sorry and it goes out by quarter of a millimeter right so that's our box so now if I want to construct uh or if I want to drive this box uh if I want to define a proper size of the box that I want I would just create a slider uh a panel SL SL or type in panel and I would uh then Define let's say in the X Direction it should go from minus 5 to five like that bam becomes longer in y direction it should go between uh let's say minus one until 10 like that so Starts Here ends at 10 like so and then in that direction it should go from uh SL SL from minus uh 20 to 20 it should be centered as long as these two numbers match up it's going to be centered right and I end up with well that's too much minus uh 2 to two I end up with a box and I can control the position of the Box any way I want right so that's the first uh first way the domain box then we have our Center box tool right right next to under primitive Center box this to right here so the center box tool is basically the same thing you know it asks you for a base and I can uh I'm just going to internalize this first of all internalize data and I'm just going to copy paste the whole plane creation thing and I'm just going to reuse it I'm going to hide the box that I have just made and in this case I'm going to attach the center box to my to my plane so here we have XY Z but notice that this is actually while while here it's asking you for a domain if I hover my mouse over it domain of the box right here it's actually only asking for the size so what so in this case I don't need to give it a domain I just need to tell it how much you know how big the Box should be so if I say two bam it's from I think it's going to be from minus 2 to two one second double checking just so that I don't lie to yeah so it's basically like uh you need to think about this as radius of the box right so when I give it two it goes automatically from minus 2 to two meaning that the actual size is four right if I give it five here to Y the actual size is 10 because minus 5 to five and in Z if I give it 10 it's - 10 to 10 so it's going to be 20 right so that's how it works and the center box is also quite quite useful uh when you know for a fact that you will be the the box that you will be making should be centered around a specific specific point right so that's another another method another way okay time to hide things delete those uh then while we're at the topic of boxes I think one is quite quite an important um important thing if you have some geometry right and I'm just going to do some weird weird things like one three points I'm just going to draw like a curve thing that is going to be crooked whoop like that and the points are also crooked and I'm going to also just for the sake of argument add a cylinder in here right like a bunch of geometry and the cylinder can be even higher a bunch of geometry right I can reference it in just as geometry so I can reference in the whole damn thing set multiple select all of them I'll immediately internal or rather no I won't internalize so I have this referenced and I can use bounding box to actually construct a box around this geometry really really useful uh tool that I honestly I use it quite a bit so it's right here bounding box you can type it in that is not it bounding box bam content goes in here and it just finds uh the bounding box for every piece of geometry but what if you want a unified box for all all of these geometries all together well you can right click on the bounding box node and select Union box instead so this per object note will change to Union box and now it's always going to generate a box around all of the geometry that I have you know that I'm giving it here and of course the alignment of the box is going to be along the plane and by default the plane is World XY but I can let's borrow that that crooked plane that we have made I can just connect the Crooked plane here right and now it's going to fit the bounding box you know along that Cricut plane honestly typically you just use the World XY plane because you use bounding boxes to stack things to measure things and so on so that's also a quite quite a useful uh internalized data quite a useful tool in my opinion so that's bounding box and that's it with boxes for now right okay uh under Primitives there's box two points box from a rectangle we don't eh whatever uh these are not as as important in my opinion let's go for free form let me explain a few tools here that you can do that you can use you have the fourpoint surface which is exactly what it says if I have 1 two 3 Four Points Point set multiple points I have them set set up here and I will use this four point surface tool bam basically just creates a surface from Four Corners right and it can create a surface from three corners um as long as you give it three corners so I will I need to separate this out of course I can't just do this it's going to freak out um so I need to separate this list item we're going to get used to this this kind of a list item like fetch separate data from the list type of a workflow one two three you know zoom in one two three uh click the plus sign and then you just connect the corners and you can see ABC Once those are connected it makes a triangle once the fourth one is connected it makes a rectangle right that's fourpoint surface easy as that no more no more comments on that uh and internaly data delete okay next we have a surface from points okay this is going to be quite uh quite interesting should we do it now though give me a second just thinking let's first do the simple ones and then we'll do the more complex ones because this is a little bit more uh more nuanced a little bit more complex so surface from points a little bit later and I I will show you one more trick with the landscape wherever it is well we'll figure it out we'll find the landscape yeah uh so we'll continue on with the landscape script uh with the surface form points tool so back to free form uh we have the boundary surface tool which I already showed you but is basically if you have any kind of shape that is closed and flat it is going to um be able to create a boundary surface so if I put in the curve here curve right click set one curve it just creates a surface from a closed uh flat curve the moment I take any of the control points and I move them up is going to freak out but then what you can do is you can remember our projection uh it was with the planes so it was somewhere here uh Vector give me a second plane fit yeah so getting the discontinuities and fitting the plane uh you can do that that this same thing uh here with the curve that is not flat to force a boundary surface so I can always um in this case I know that it needs to be horizontal right so I can do XY plane create an XY plane and use project project an object onto a plane geometry plane now it's projected flat I connect that to my boundary surface you know and and works perfectly fine if I have um let's do 1 2 3 4 five six something like that exploded into five segments so now all of this is exploded and I have it curve set multiple curves so here I have five different line segments and I use boundary surface on those five segments it still manages to make a surface the moment you move either one of these segments even slightly away it breaks because it can't close the shape you know so think of it as hatching you know can it hatch can it fill if it can fill it's going to work right so that's that's that okay uh internalize internalize group push here delete move on so those are boundary surface this is control Point Loft Edge surface um actually Edge surface is quite uh quite a useful little tool here uh perhaps I can should we just keep going down or to the left maybe let's do something like this like that and then here so Edge surface asks me for four curves so what if I Let's do an experiment one curve two three four re really messy right curve type in the curve right click set multiple curves and just get them in here no matter what's the sequence of selecting them list item to separate them out one two three and just connect first one second one hm made a triangle well not really made almost like a loft between the two okay that seems to work quite quite nice third one something weird is starting to happen it's starting to find between the two curves it's starting to find the midpoint right the middle point between the two curves and from it here as well midpoint and from it it's starting to draw the triangle what happens if I give it the fourth one exactly the same thing right it's going to interpolate if there are gaps between the the lines it's going to find the middle points you know of the gaps and it's going to just try to guess that that's what you want to do you know that's you wanted to find a surface that fits between the the four curves right so that it's uh that is its aim right to do so so Edge surface um I mean when nothing else works you can use this to clean things up quite well so keep that in mind internaly group hide move to the side next okay we have Lofts finally so Lofts are something that I use a lot specifically when uh you have a network of Curves and you offset it and you need to Loft it into frames that's super useful when you need to do some free form uh creation that's also quite quite useful and so on so for now I'm just going to make something very very quickly a little bit ex exaggerated wall type of a thing something like that H so it's three curves right curve set multiple one two three oh by the way it needs to be uh in the correct sequence or else The Loft is going to be wonky I'll show you and then we use the Loft tool Loft connect the curves to the curves input and you know it makes us a nice little Loft but if I were to let me clear the values if I were to be a little bit messy set multiple curves if I were to be a bit messy of how I select it so this one this one and then this one right out of sequence enter The Loft will look like this because that comes in first that comes in second so it just goes from here to here and then that comes in third so the way you Loft really matters uh or sorry the sequence of the inputs for the Loft really matters clear uh set multiple one two three a loft will only work with like you can't Loft a closed curve with a open curve that will not work they all need to be open or they all need to be closed for the Loft to work work then under options there are Loft options uh tool or note available there is one and you have a certain certain amount of options that you can choose from so the first one being is it a closed Loft if I were to just toggle clearly you know this is going to be a Boolean you know yes or no closed or not closed if I say e true then closes off the Loft into this more of a pipe looking thing right so the first one and the last curves also get lofted so for now I'm going to keep it open uh should I adjust the seam uh typically you have this set to false if some if a loft is starting to mess up then you can do a toggle you know when it's kind of crooked and so on you can do a toggle for it to try to adjust itself but honestly most of the time I just have it set to false rebuild you never rebuild unless you really know what you're doing because then suddenly The Loft that has been made will not fit to surfaces from which the curves were extracted so it's it won't fit with its neighbors so rebuilding is uh um useful only when they in a vacuum or when you really know what you're doing so in this case we don't touch that refit same thing type type of the Loft you can see Zero is normal one is loose two is tight three is straight five is uniform where is four I don't know so we just create a slider 0o dot dot 0 dot dot five a slider between zero and five connect that to type so this is a normal type Loft I'll show it like so this is loose this is uh tight this is straight so you can see that it just generates separate Lofts it becomes a polysurface as well four does not exist apparently and five is what's five I don't remember uniform loft where the hell did developable oh it doesn't matter so usually you either do normal loose or uh straight you don't really use uh the tight one at least I don't tight or uniform I don't even know what uniform does anyway so in this case we keep it as normal Loft um is that it yeah for lofts that is kind of it we can group this we can hide the preview of this internalize data delete moving on uh there's Network surfaces ruled surfaces extrusions patching piping and so on piping I'll already showed you at early stages it's literally you just give it a curve you give it a radius and you cap it and you get a nice little pipe so that's very simple I will not be repeating this revolution is uh very Niche one second I think patching no patching is done usually in Rhino you don't really do that much patching in grasshopper because it's not accurate enough so if you want to do patch you do it in Rhino pipe okay let's go for one more extrude let's go for extrude extrude points curves and surfaces along a vector right so here I have my Loft and I can connect it to the extrude tool and then it asks me for a direction and that's uh that's kind of an issue right because if I give it a direction of let's say Z with amplitude of let's say that the amplitude is like 50 whatever right the Extrusion looks really funky because it just extrudes upwards right okay so that doesn't work uh which means it should be X right X Direction okay let's give it X and now it looks much better but you'll notice that um the thickness of the Extrusion is not uniform which means that if I uh bake this into Rhino and I run a clipping plane through this just like that and we just run it you can see that um the perpendicular thickness of this like here it's clearly much much thinner than than here and that is because you know the direction needs to change to be perpendicular to the to the surface for us to have uniform uniform thickness of course if a surface is planner then you can just simply extrude because that's the same uh all of the normals are are the same so Extrusion is great when you have flat stuff and you're just extruding it but when you want to um give thickness to a surface right you don't use extrude you rather use offset so under I didn't see it here so it's going to be here then oh no it's not going to be here no do I really need to okay fine offset surface you use this and then we use Control Alt click oh it was under utilities utilities offset surface right here okay um use it here Loft connects to the offset tool right offsite surface tool let's hide it let's hide the Extrusion and then for the distance we will just use the same slider 50 bam oh my God really destroys itself um let's see what happens what happened oh okay okay so the drawback of using an offset is if that's the same thing remember with the pipes and if the pipe radius is larger than the curvature radius of a curve than the pipe self intersects that's exactly same thing happens with the surface right if you offset it too much and it's the can't make the corner it starts intersecting if I move this you will see it better you know so here it's all happy with you and it's all cool and everything works and then at this particular point it starts really you know breaking and this is where it starts overlapping over itself right so of course you know when thickening things there is uh just geometric limitation to how much you can thicken things and another problem is that when we are thickening this you can see that this also generates just a surface and the loft is just a surface as well so this is not a solid extrude this bad boy right here uh let me group this ex extrude gives us a solid great this gives me only the offsetted surface without a solid which we need to um actually you know we need to build up a surface and I'll use this opportunity to do so so how do we do that well we need to get the perimeter of the original surface we need to get the perimeter curves of the offsetted surface and we need to Loft between them we need to create a loft between the two let's do it under analysis there are two ways of how you can get the perimeter there are BP edges and B wireframe edges just like with the mesh edges gives you naked and ior and non- manifold edges I already covered this I will not cover it again B wireframe gives you um all of the edges in one list in this case only the exterior edges [Music] are available or exist so there are no edges inside of our surfaces only around the perimeter so this one would give us a proper you know proper output proper perimeter output but we will not be using it instead we will be using the cleanly B edges tool with uh by extracting the naked edges right so now I will just use a panel to check what do I get from here and what I get is four separate lines and that kind of makes sense because this Loft you know is surrounded by four separate edges but if I want to Loft between the two curves you know between the two perimeters it's much much nicer if both perimeters are simply polar lines you know a single polar line uh per perimeter so what I can do is I can just for the sneaked edges I can use join curve or join curves I guess component right here connect it connect that and now I get a single you know all of these separate segments were joined into a single perimeter curve and the same thing delete that exactly the same thing I will do for the offset surface so I'm just borrowing those like that will this fit well we're going to climb over a little bit into the or I can just sco it over um so so I get the perimeter of um the offset at surface as well right so I have like these two parameters what do I do then well I simply use loft loft and the first perimeter comes in here the second with the shift key the second perimeter comes in here and just produces a loft for me so now what I have here let me just move this to the side a bit a little bit below what I have here is my original Loft the back face I have my offsetted Surface the front face and I have have my loft in between them they're separate though so I need to merge them into one list and then join all of the surfaces into one poly surfaces poly surface in that list so first I will use merge tool the merge tool and I'll just the way I like to use the merge tool is I like to you know take the LOF or sorry bring it to the thing that I want to connect so first comes Loft that's data one then I bring it to offset at surface that's data 2 and then I bring it to my perimeter Loft that's data 3 and now I have all of them in one list and we're already yet again I ask you to trust me bro uh the data tree uh does get messed up from the amount of functions that we're doing so what I need to do is for the result I need to right click flatten we're going to get there I promise I promise data trees are coming it's going to be like two hours of of a tutorial but it's coming so you you just write click you choose flatten and now they exist in one list 100% And then we use B join B join tool that as long as things align perfectly with each other um it's going to be able to join the shape into one group that oops including the B there we go I'll just move it slightly back just just ever so slightly just so that it kind of fits okay and I will hide literally everything except the final BEP this one if I insert this no now all of this has a consistent uh consistent thickness right so it's as if it's it was bent out of a sheet right well a very thick one but now since it's a parametric model you can just change can just change the thickness of the sheet to whatever you want right also please notice that this is our original surface and this is after we have offsetted it uh Rhino or grasshopper in this case tends to create a lot more um ISO curves and you uses up a lot more resources when it's offsetting a piece of geometry you could use offset loose but uh whatever okay so that part is done and it's internalized great so we have this uh we have this done I think all of this should be grouped up into a larger group just for the sake of clarity okay A little bit of water give me a second so now uh we are at this stage where we can start experimenting a little bit and we can start messing around with like different tools a little bit I want to show you the landscape thing first of all of how you know uh in at the mesh course part or mesh chapter we have created [Music] this landscape right here or rather this Delon mesh right right here from the quter lines I will use that so I'm just going to take the curve take the discontinuities and take the Delon mesh like these three nodes curves discontinuities Theon mesh by the way for the curves you can just do whatever I can show you apologies probably those of you who don't have the course files uh can't follow along that well I'm sorry for that uh you can just simply create a surface rebuild it 8 by 8 hit F10 move it around you know move some points around to make some topography happen go into the front view select it Contour use Contour command enter uh click anywhere honestly Bel below the landscape and then holding down the shift key or with the ortho turned on give it a vertical Direction so click again and then uh the distance between cont I specified 10 but it depends on the size of the landscape that you're using so in this case I'm I'm using going to be using 10 right and then just simply delete the um the landscape itself because you know this is an exercise for actually rebuilding it then we select all of these uh contour and we rebuild those to mimic what you get from the municipality so let's say uh 20 the point count should be like 20 and more importantly the degree should be one hit preview see if it's messing up too much if it does uh then increase the point count for me it seems to be okay and voila we have ourselves a little bit of a you know some some contour lines and honestly I I'll just use these uh for for the next iteration so in this case I'm just going to be repeating curve discontinuity the loone image what we've done so far and discontinuity has this little flattening going on that's the trust me bro thing I I'll guide you through it so curve Set uh multiple curves internalize data delete the curves so that we don't need need to think about them in uh Rhino discontinuity level Infinity right click on the level choose C Infinity analytic model gives you more points the low name m oh that's the wrong one the low name mesh uh these points come in as a data tree we don't need it we need them to be in one list right click flatten don't worry about it as per usual uh connect uh points to points and you get yourself you know a rebuilt landscape and wherever it does not have um like anywhere where where to Anchor itself you know it's not able to build certain parts of the landscape um honestly I I I personally sometimes just place a point by myself or add an additional curve in the corners just so that the delone mesh stretches onto the corners but in this case I will not okay so now as we have the delone mesh um previously I showed you how to create you know a clean mesh result from it with quadre mesh uh but in this case I'm going to show you how to actually um extract a portion of this as a a nervs surface and ner surface means you you can do a lot of much more complex things with it so the step one is to actually make a rectangle above it top view rectangle and the rectangle should like all corners of the rectangle in this case uh they should fit on top of the landscape the rectangle can be crooked by the way so you can take certain corners and you can you know fit them as as you please that is fine that is allowed but it does need to be a rectangle though that's important so something like that right I have my rectangle then I go in perspective and I move it up like that I have it here and if I reference in reference it in as a curve so that curve I can then very easily convert it into a Surface by using boundary surface tool like that and then I want to create a grid of points on top of the surface so I'm going to divide surface I'm going to use divide surface tool right boundary surface goes into here and I'm going to say let's say 50 by 50 points something like that 50 by 50 looks like a lot but it's it's actually going to be fine I'll I will not internalize the curve just yet because we I want to show you a few a few things that can go wrong but for now that's that's fine okay we have our mesh we have a bunch of points fly flying above the mesh I'm going to and let's let's visually also see it here in the script so the mesh goes below the points I tend to do that um like the geometry what's above I tend to push in the script as well uh above the geometry that's below maybe it's just me I don't know anyway now we can do project Point project a point onto a collection of shapes great we have a bunch of points and we do have a shape project Point asks me for Point direction point to project or sorry ask me for point to project those are our points that we have here right asks me for a direction and you can see that if I hover my mouse over it it says 0 comma 0 comma minus one minus one meaning in Z Direction it goes down that's the default direction for projection and in our case that is perfect that's you know we want to project the points downwards what is the geometry that it should hit well that's our mesh and we just get all of the points on our mesh that's cool let's hide the mesh let's hide the Divide surface points we get these bad boys right here now we will build a surface from these how do you do that well you go to free form and you choose surface from points this one right here and it asks you for two things it asks you to give it a bunch of points and it asks you in this grid of points how many do you have in the U Direction remember uvw XY Z so in the X Direction uh in at least one of the directions okay uh I have the points but for the U direction if I were to just use the slider you know because this kind of controls how many divisions we do if I just use the slider it's going to freak out and I can show you right if I just connect the slider it's freaking out simply because if if I do like 3x3 you know for this divide surface let me hide everything else if I do 3x3 divisions it's actually 4x4 points remember I already talked about this one two three segments but four points 1 two 3 segments but four points right so it's always always always plus one whatever number this is It's always plus one so the U count is actually not not three it's going to be four so I'm going to plus use addition for the U count I'll take this slider value connect that to a like so but then for B I'm just going to type in SL SL one or panel one or you can use a slider but like number one right connect that and now technically this should work but this is still complaining and the reason why it's complaining uh is because this all of these points they come in as again a data tree not as a single list and I know that you're getting tired of me saying trust me bro but every time before we get into the data trees or should I no it's going to be like half an hour of me just explaining this it needs to be a separate chapter trust me bro right click flatten push all of the points into one list and now surface from points works if I enable the preview of it we get ourselves a really nice clean surface there's a problem though the problem is called the lon mes looks like this and the surface is like way too smooth why is that well that's because the resolution is way too small right we just give it like three by or 4x4 points if I now increase this value here you can see that it fits the surface much much more closely right but if I bake this this is still a nurs a nurs surface which makes it so that once this is baked I can you know duplicate border and I'm going to go fast so sorry about this duplicate border scale this down to zero Loft between the two borders join them up cap make a sphere or make a box doesn't matter like that push it in push it somewhere here Boolean difference with the Box scale the box down or even not not not even that just take the three surfaces here uh extract h apologies I'll do this differently get these edges in here uh one more DP Edge but give me one more here cell CRV join it offset it hello offset okay there we go offset by I don't know this is not in scape so like two or something L between them delete merge all cop planer faces EXT it up so we have ourselves a retaining wall take take the edges that are like a little bit too aggressive push them down take the edges push them down didn't get pushed down take the edges push them down breaks here we don't care just an example right we we have ourselves like a Terrace or an area where we can start designing and build building a thing right something so the reason why I'm showing you all of this is because you can't do that with a mesh properly right nervs enables you to do Boolean operations and enables you to carve into things merge things up and then so on right so that that's why we usually the Landscapes that we do is we convert them into surfaces right so that we can continue working on them okay so that's uh that's it with this I'll just oh yeah uh things that can break if oops well if you just close your Rh know that that's going to break it um if I were to take this curve and take this let's say Corner point and just move it further away this bricks it and what bricks is actually this project point right you can see here uh there's a chunk of points here that miss the landscape that go just keep going and falling through and they become null points points that don't exist anymore and since they are points that don't exist anymore uh surface from points cannot comprehend the grid you know cannot interplate the grid anymore and does cannot make a surface so it all breaks that's why our rectangle that we have made needs to fit in the landscape that we have right it can't go beyond the landscape my voice is going oh no no no no I need to keep recording no okay so that that's the reason internalize internalize well that's already done delete okay that's good poop get that one in here okay let bit of water now let's do some analysis analysis stuff right so there's two two more things that I will show you and then we will we will stop with the nerves and then we will continue first thing is if I were to create some sort of a surface here let let's do the typical thing right let's just take the fourpoint surface tool in Rhino poop poop poop poop clip F10 grab two opposing points move them up saddle typical saddle uh shape right the reason why I use this is because it has both the convex and concave Cur curvature so it's concave here or sorry it's convex along this direction and it's concave along this direction very good for experimenting with curvature and and how it works right and I'll reference it in as a surface keep in mind you can also reference it in as a b you can also reference it in as a geometry remember it oh also as data I guess well data you can't reference data but uh geometry B surface all three of these can hold this particular surface so for this in this case I'll just use a surface set one surface bam something like that and let's do something a little bit um and I'm hiding it uh let's do something a little bit more uh uncontrolled so let's use random populate so let's just fill the surface up with points populate geometry populate geometry populate generic geometry with points great that's what we want so surface connects to Geometry clearly count of points is how many points should it populate the geometry with so let's go for 200 bam we can do more uh for now let's do 200 later will increase then for the seed you know this is obido random population again so you can play with the seed value so like different types of distributions you know like that it's easy and if you have some preexisting points in the collection you can add them in here we don't so we don't care okay so we have our 200 randomly placed points on our shape what can we do with it well we can use those points to analyze the surface at precisely that uh what's the word at precisely that that that uh area or or that position right so there are a few things that you need to do uh because these are points these are this is the surface and you basically need to extract information from the surface uh with the points and the analysis tool which is one second yeah that's fine uh the analysis tool is is is is is is evaluate surface am I blind there it is evaluate surface that's the one that we're going to be using asks us for a surface great asks us for a point great and you can see it's bad it doesn't give us the like it it tries to produce planes for every point but it's like all offset all weird all crooked and so on what's going on well these points don't belong to the surface they're just points that were generated on the surface but they're not connected to the surface what you want are surface UV points so to do that you just simply need an in between node here so the points that you have you want to use another analysis tool called surface closest point B closest point also might work but we'll just use surface closest point here that asks us for a surface we have one asks us for the points we have a bunch and it basically just gives us uh the closest points as well as the UV points right uh let's check the difference if I use the closest points it does that if I give it the UV points it does that UV points are basically points that are located on top of the surface and that are associated with the surface you know within the coordinate system of the surface the points are just points that float in the space right and they don't have a connection so we use surface closest point um to get that information out and then suddenly we can actually you know get all of this information frame normal U Direction V Direction so we we do full analysis of the surface as for as for the distance is concerned it's actually going to be all zeros right because we're generating the points all on top of the surface in the first place so it's all going to be zeros but we since even though the distance is zero at the software level or behind the hood the points are not associated with the surface thus it doesn't matter if you know they're very close or they're a million kilometers away surface closest point that gives us the value that is associated with the surface or the point value right so now we have a bunch of frames right and we can use our let's start by using what we started with so analysis or sorry uh primitive domain box and let's do the base should be the frame which is basically a plane so the boxes will be created on on each plane you will create one box and all of the boxes let's say are going to be the same in size so I'm going to just create a panel and I'm going to say uh minus 10 to 10 something like that for x uh then another panel minus 100 to 100 for y and another panel minus 5 2 5 for Z and now we have a bunch of these you know elongated boxes that are covering the surface and they're overlapping sure that's not great but they are covering the surface uh at a very you know at randomly but since you're extracting the the directions the U Direction and The V direction of the surface they're kind of aligning right because the planes are aligning with the U Direction and The V Direction of the surface and since the surface is rectangular kind of neat so now once this is you know when this is working I can hide the surface itself and I can just keep increasing the popular geometry amount of points until I get something yeah a th000 sure why not I have this box uh thing right here I can insert it drag it over to the side like that take a look at it in the Arctic view actually let's hide the display settings surface edges there we go you know and suddenly it starts becoming a little bit you know kind of nice kind of organic flaky right so so that's that's one way of course it's not controlled at all and it's all very very messy but if you were to unify whole of this um it would honestly become a quite quite a nice CNC milling pattern right so that's uh the surface analysis tool and of course you can get normals and so on and you can I wonder what would happen if I nope that doesn't work or actually what if we give me a second uh if I go to Vector plane plane normal create a plane perpendicular to a vector I have um An Origin which is the point and the Z axis is going to be the normal like that and if I use that plane now yeah that's just weird no now now it's freaking out okay or you can do that no we don't do those um we stick to the tutorial okay so that is evaluation of a surface in a nutshell let's do that internalize data and we can keep keep keep going let me just check if there's things that I am missing of course you can measure the area and the volume of a surface I'm not going to touch upon that as much uh point in B rep point in B reps uh perhaps that is going to be quite quite useful so let me show you um these are still points right the UV Point these are still points and I still have my Surface so what I can do if I want to specifically State you know that there should be just a few areas where the points should be created I can create a bunch of spheres or I'll create just one or two let's do two if it works with two or three it's going to work with a million so let's say two spheres like that right I will reference them in as BS okay they referencing as BS and I basically want to say that these surface closest points that we have only the ones that are inside of the Spheres should stay everything else should be removed right so that of course will require this to be much longer actually I'll break the group for now I'll delete the group and we'll we make one again so these two spheres and Analysis there's there are two tool point in B rep or point in B reps point in B rep means that you will be only checking with a single shape point in B reps will means that you will be checking with multiple shapes if the point is inside or outside of them in this case we have multiple so we use pointing B reps like that asks me for a b rep that's easy ask me for points that's also easy I have those and it gives us the answer of you know false if it's outside and true if it's inside and then I can use call pattern or dispatch remember dispatch still gives you both lists SK pattern removes list B right and only gives you list a um the pattern is you know the answer to is it inside or outside and the list are these points and I can't wait what oh that's [Music] weird that's interesting yeah okay uh that works sorry uh apologies for um not talking so okay UV point is this kind of a tricky thing because it has its own coordinate system that is associated with the surface and because of that doesn't really work so well with point and Bs so what you want to do is when you're creating this pattern the col pattern for the you know to call out the points you're not actually evaluating the UV points if they are inside or outside you're evaluating the regular ones and you can do so with either this PO population of points or you can do so with you know the closest points here it doesn't really matter which ones you can't use UV points though because those work in a different um coordinate system once that is done you will see that the points are appearing in a weird place that is fine that is expected but this call pattern then connects to EV valuate surface like that let me hide it and now under the domain box will be the domain box will be generating boxes only in places where the BS are right are in intersecting with the points so that's kind of neat that that might be that might be useful for you one second yeah something like that okay I'll internalize this as well delete this that's already internalized okay we can now move on like that great okay so those are surfaces then moving on I already showed you cap holes offset surface has been shown uh retrim copy trim divide surface shown well divide surface has been shown surface frames and ISO trim okay let's grab that Loft that we had some somewhere here where was it Loft hello yeah there it is this Loft copy paste drag it over here so I have my three curves and I have my loft here right make sure that the type of the loft is set to zero so that is normal a normal Loft let's say you want to make paneling out of this how do you do it well many ways of course uh one of the ways is is by using ISO trim ISO trim is a way of how you can take a surface that is continuous and divide it up into uh segments into split segments and then work with those segments individually and I'll show you a very very quick and simple example of how to do that um it only works if you give it a single surface or if you start managing the data tree quite quite well but I strongly suggest that at first you know if you're doing this kind of methodology you should use just a sing single surface as an input or you know in this case just a loft a single Loft so here under utilities I'll use ISO trim extract an ISO parametric subset of a surface a mouthful of words but the way it works is quite quite simple actually asks you for a surface we do have that and then asks you for a domain which is a little bit tricky because this is a two-dimensional thing so up until now all of the domains that that we were talking about were onedimensional domains right a single line an ISO surface is a two-dimensional domain which is or a surface is a two-dimensional thing right it has u and v directions which means that this domain actually uh would need to use under MAF domain this uh domain squared thing and I can show you a pretty simple example of it if I were to construct domain squared it basically just asks me for two do domains right and then I can use construct domain for domain U and construct domain for domain V and connect that as my uh 2D domain in here right um don't forget to if you don't want to deal with millimeters you should use the Loft output should be reparameterized remember when you have this oh sorry the surface input should be reparameterized when you have one second I'm I'm thinking how to explain it so everything inside of grasshopper in terms of surfaces is calculated through the units right so it you have certain length along the U Direction some certain length along the V Direction in units so any point that is given on the surface you know for instance if this is the start this point is probably like 100 mm in the U Direction and 85 mm in V Direction on the surface right easy peasy but visually for us it's much easier if we say that this is like 10% of the way you know of of the full length and this is uh like 5% or or 20% of the full width right giving the point and reparameterize does exactly that and converts from unit based system to a proportion based system and that's why we sometimes use it so I can use R parameter is here time to explain things drawing time so maybe somewhere here yeah somewhere here if I have a [Music] surface yep right that surface has a point here that is 0 comma 0 another Point here that is 1 1 comma 0 right in X direction or in U Direction it's 1 you know 100% but in V Direction it's still at 0% then we have this little Point here that is 1 comma 1 and this point here that is zero comma beautiful zero comma 1 right so we have this this kind of a surface and then uh let's do an exercise where we extract this patch from this surface right I just want to extract this this particular patch how do I do that well I need to figure out the domain along this axis between 0o and one right and the domain along this axis so I need to figure out this as well as this r right and in this case it might be U let's say 0 that's such a bad color 0 uh 25 and 0.75 right and here uh 0 uh 4 and 0.6 or something something like that right so there is a domain here that is between 0.4 and 0.6 0.4 to 0.6 and the domain along this direction 0.25 0.75 and then it just understands that okay that's the rectangle that you mean that you need right that's all it needs so here if I give it 0 uh 4 because we still we first deal with the X Direction 0.4 four you can see it being trimmed uh up to 0.6 trimmed down to here then I give it 0.25 here come on give me give me and 0.75 here it gives me exactly that patch right so those dashed lines are you know the lines that would go here like that I I'll I'll give you a little bit better look here and I can now mess around with the sliders to get any patch on the surface in any shape or form that I want okay so that's that's one uh one way of how to use isot trim let me move it to below here and group it I'll show you another way or not another way but that division of the paneling that I was talking about we're going to do it now isot Trim in this case we don't need to reparameterize anything because it's not going to be us who will be putting in the variables it's going to be automated by right grasshopper so under surface um or sorry I I still need the domain right here but now I can do I can do divide domain squared this bad boy right here divide domain squared which basically asks me for um three things and then it gives me the segments I'll show you uh first before I connect those into the isot trim I'll show you the segments in the panel and then connect the panel into the isot trim so basically this is like a window Forest into um the data that's going to be put being put into the I trim and before I do so data here that's how it looks like right for for for this basically in U Direction That's The Domain in V Direction That's The Domain right that's what I was I was talking about all right so now first of all what's the domain well that's actually our Loft because it will take the surface and it will measure it it will you know say that okay I understand the length of this in U direction is from here until here you know in like 5,432 mm and the V Direction measurement is from here to here like 2,000 whatever millimeters right so the domain is easy you just connect the surface into the domain what the hell oh it's not happy with us that we're parsing it through the panel okay that's that's fine that's fine uh we can just connect the segments straight here is going to be happy and you can see that immediately it works and it divides everything into panels simply because the U count and the VC count are already set to be a particular uh like unit or not unit like there's a number there for divisions 10 by 10 right so it gives us 100 panels but if I do let's do something simpler 3x3 3 by3 hide the Loft you can see one two three panels by three panels and here you'll see nine you know nine of these uh two dimensional domains right uh so here the first panel goes from 0 mm to 69 nice millim uh in U Direction and from 0 to 187 in V Direction that's the first one then the second one is going to be this one because the or sorry no no the second one is going to be this one right because it uh in the U Direction it goes exactly the same amount but then in the v Direction it starts from where the last one ended 187 and it will continue until 374 until here and so on right so it builds up this domain and now you can by by just changing the panel uh slider you can increase the amount of panels let's do 10 um we don't need more just for me to explain you know the the logic of this so now all of these surfaces are separate separate entities separate surfaces which means means that we can deal we can work with them and we can extract stuff and we can offset them separately and we can work with them as if they were like separate separate panels for example um what's a good one like technically I could that would be kind of crap I'm I'm sorry for U I haven't prepared uh I I prepared only until the ISO trim and now I want to show you more and that's not what I prepared in my head so I need to think but if we were to just simply get let's say the edges don't really want the edges sorry uh let's just scale it scale the all of these surfaces like that along their Center points so uh to get the center point of a surface you can just use area measurement remember when I showed you the volumetric measurement area measurement does exactly the same thing it gives you an areial centroid area centroid and then for the factor I can just give it 0.995 so 99.5% H maybe a little bit less 0.942 something like that I can hide the original isot trim and now I have my scaled panels right like separated scaled panels um of course offsetting would be a better idea than scaling because um they're kind of messy along the length um like the gaps don't match up along the length and the width you would need to be a little bit more elegant with the or more precise with the script but for now it's fine and then that geometry that we have we can use exactly the same thing as what we've done uh here with the offset surface and I'll show you show it to you one more time just to kind of lock it in so every panel gets offsetted by a distance of I'll just go for 10 that was way too much one that's good enough distance of one and then I will Loft between the edges B Edge there we go B edges of this SC surface and this offsetted surface that will be joined up like that like that and we'll be merged into one list and now we just pray that it's not mess messy it doesn't seem to be messy yep joins up nicely and then we would do the bre join and so on but I'll I'll I'll skip over it so we have ourselves a perimeter right here and we have ourselves the front face or sorry the back face and we have ourselves the front face you know so we are creating a three-dimensional paneling paneling system it's a simple grid but uh you know also it it's very fast uh to make okay so that's that's that about ISO trim hopefully the you know squar domain is not has not scared you too much and I think uh this is where we stop with the you know beginner level introduction uh with the surfaces let me just double check if I'm not missing anything that's fine that's good that's fine that's good and then under intersection of course you can intersect B reps with planes and I already showed you that but also you can do solid um like solid uh what's the word tools like not tools operations so Boolean operations perhaps I should show it here uh if I just have a sphere and I have a cylinder like that something like this sphere and the cylinder that's B one or rather set multiple BS Bam Bam easy uh two BS under intersection shape I have the possibility to do solid Union solid difference solid uh intersection like these three there's also split and so on or trim solid but for now uh let's just use the the typical ones these three Union difference intersection right so solid Union is um simply like Boolean Union let me hide that hide this it's a Boolean Union that merges the two shapes together so um you can see that the sphere connects perfectly now to the cylinder and before it was like so right it was just sticking into the cylinder so solid Union merges things together great for 3D printing then you have solid difference which actually requires us to split this apart list item into a sphere and a cylinder and then you can choose what's what are you carving with what so the first input is what is it that you're carving that's going to be the sphere the second input is what you're carving with with that's going to be the cylinder if I hide this you can see the the sphere you know is being cved by the cylinder and the last one is going to be the solid intersection which also requires me to give it a list item I'm just going to reuse the the one that I have just made I'm going to intersect my sphere with the cylinder and then it gives me this in between shape right I a shape that overlaps where uh the cylinder and the sphere overlap it gives me that so those are the three uh Boolean operations that you can use um last time I tried to I thought um that that it's only going to work with the with the shapes being closed um with the meses it actually worked without the shapes being closed so now I will not make that statement it might actually actually work okay I think that's it honestly I think we have survived we have survived the nervs we can move on move on to the next one the subd portion okay we learned about meses we learned about nerves geometries now it's time to learn about subd and what you can do with them in grasshopper what they're used for so those of you who are not familiar with subd the the logic of of subd geometry in general it's first of all it's a pretty fresh type of geometry that came in well it was at late stages of rhino 6 and then really was kind of coming out on in Rhino 7 right so it's pretty pretty recent and sub is uh it it exists somewhere in between meshes and nervs meshes with their finite geometry that is uh finite resolution geometry that is quite fast and and nerves with their infinite resolution of geometry that is quite slow but unlocks more possibilities for you know evaluation and so on subd is somewhere in in between so it you operate with subd geometry as if you're operating with a mesh meaning you're pushing and pulling on vertices you're working with edges vertices and faces right just like with a mesh but the output that it generates can be very easily translated into n hers okay let me give you a quick little example here in Rhino first of all right if I have if I go to mesh tools and I create a mesh well let's do it the donut thing I create a mesh donut this is oh actually that's fine no let's do less resolution I think by default it's 10 by 10 something like that mesh donut right and then I go to subd tools and I also create a subd donut it's a Taurus but sure I I'll still call it a donut right and then we go to um just standard tools I guess and here we create a nerbs donut Taurus like that clearly subd looks much much more than a nerbs version of the Taurus rather than a mesh version of the Taurus but the moment I press the tab button now it looks much closer to a mesh than the taus uh than the nervs taus right so tab button switches between the smooth preview mode and uh Jagged or or control Point preview node mode how is it called actually flat smooth and flat preview modes right so tab button does that so now let's say I want both of these to be you know converted into an nervs surface so of course nervs is already nervs surface so that's easy I just copy it over then if I were to select a mesh I'll just copy it over first I can type in two nervs delete input objects yes and mesh options don't really matter trim triangulated faces sure you know I hit enter enter and now I have here my nervs poly surface right which is actually pretty bad every polygon was just simp simply uh convert it into a surface right so it was a direct conversion here with the subdus if I select this and I convert it to nerbs delete input objects yes enter that's the geometry that I get from subd right much much closer to aurus and also I believe I can't explode this yeah I can't explode this because this is a single surface right so of course there are limitations U to subd Geometry uh one of the limitations is that sharpening up an edge uh really messes things up so when when you try to actually let's do it this way introduce a crease why not you know when I do something like this to it and I then try to convert it into a nerves actually this might work um we'll see into nerves poly surface nerves yeah okay that's exactly what I thought then of course it's unable to produce a single surface and then it starts dividing things up into patches acting a little bit more similar to how what we observed when we meshed uh when we converted a mesh into a nerv's poly surface right but then the moment that it has um clean topology so when the polygon flow is clean it immediately jumps into creating a clean surface right so it's like a very interesting in my opinion very cool uh in between type of geometry that I really like using recently if you want to learn more about grasshopper um or sorry about subd um in terms of 3D modeling I will put a like a link in either in the video description or somewhere I'll list the link to a set of videos that I have made uh somewhere so just scroll down you'll find them anyway moving on so subd right so the first thing that we want to find is where the hell subd exists right where is it so if I go to uh curve or sorry to surface under the surface tab here we have the subd sub Tab and it's only these elements by the way only these we don't have more but these are enough to um create a pretty pretty cool U pretty interesting or Not Sorry to operate with subd in a pretty interesting way uh simply because most of the stuff most of the tools for manipulating subd comes from actually uh mesh tools you know moving vertices around and and so on so the way I like to um work with subd is first of all I get some sort of a mesh in here so for example um yeah let's do subd from mesh so first let's create a mesh mesh tools mesh creation I'm just going to do something very simple um let's go for a sphere maybe this time because a sphere in the top has triangle so that's going to Showcase that subd also works with triangles a little bit smaller though something like that and I'll reference in this mesh right set one mesh bam now to convert this mesh into subd all you need to do is just literally use subd from mesh tool like that which asks you for a mesh well we have it let me hide it asks me for a mesh asks me for where are the creases if there are any so you can already pre-crease it I would strongly suggest that you don't crease things instead you uh apply different kind of methodology for it but it's up on you it's basically sharpening of the edges if there are any Corners that should be stay sharp and if the geometry should be interpolated or smoed out you always should smooth out the geometry interpolating usually is a bad idea anyway by the end of it you get a subd that you then can convert to nerves am I blind okay oh wait there's no there's no two nerbs tool here in in grasshopper either I'm losing my mind or there's no two NS tool in Grass support which is fine I can just simply insert it here and then run the two nervs tool in Rhino so it's fine also technically you could do a c script or a Pyon script that would do this so you can see that it's mostly building it up quite well except that it's making a little bit of a hiccup here in the top uh simply because the way a mesh sphere is made is through the you know um it has poles it has the North Pole of and the South Pole right so it is unable to solve those but if I were to for for example use a mesh box with XC count set to one y count set to one Z count set to one and let's go for 100 or or let's go for 50 by 50 by 50 a cube right and I use that as my mes set one mes hide then we also get a sphere this is a quad sphere which we can bake out right quad remesh or not quad remesh sorry two nerbs and this one even though you know it's also not a single surface but it is made out of U elements that are uh symmetrical right that uh the same element just stacked eight times right so um topologically this is a cleaner sphere than this just keep that in mind if you need to convert spheres for some reason either way for now I'm going to keep this um this mesh right I'll internaly data and then we can move on to other other stages so this is how you construct a subd and to convert back from subd into a mesh you can just use this mesh from subd Tool right so subd goes in here and then you can give it a density slider so you can see that by by now the density slider is zero uh is two apologies um if I were to use a density slider of zero it would just be subdividing the initial mesh one time so every rectangle would be subdivided into four rectangles hopefully you can see it right 1 2 3 four correspond to this single rectangle right here and then uh subdivision one or sorry 0o and one apparently is the same thing apologies uh 0 and one is the same thing subdivision two then you have 16 uh patches for one rectangle and then three four five and then uh six does not calculate it's kind of preventing you from going for large numbers because it's afraid that you will crash your computer anyway uh so that's that's how you can generate a pretty clean mesh okay so with that out of the way what we can do is now I can show you C few different workflows for uh where subd can be used and where it's useful so let me just group this up I'll convert this to let's say gray for subd subd is going to let's say subd is going to be green color for now it's going to be our default grouping color right so also internalize oh yeah it's already done so let's look at the the tools that we have right the workflow that I like to use is um take a subd that already exist LS in Rhino do something with it in grasshopper and then get it back in in Rhino modified so okay example quick quick little example let's say it's not going to be quick but I I'll try to do do it as fast as possible let's say I go to my subd tools and here I'm just going to create something really fast so I'm going to probably grab like a subd box 2 by 2 by two is fine for the divisions something like that um and let's then manipulate it a little bit so maybe it goes like so uh maybe it's extruded here a little bit these things tilt actually since I'm modeling I'm just going to do that let's see these things are tilting okay um now I'm blanking when I need to actually actually make a design I'm blanking out and I have no idea what I'm designing usually I tend to do like spaces shiy or ship like um elements in this in this case it's going to be like a pistol or something anyway we'll we'll we'll figure it out once we we cross that bridge once we get there right so let's actually extrude here better control shift by the way to manipulate the the geometry uh the sub geometry sub elements of the geometry uh let's go for something like that sure why not and then I'm just going to hit it with a sharpening here so this whole part actually we shouldn't n we shouldn't we should keep this as clean as possible sorry for talking with myself like that could shrink a little bit yeah that's not bad could go back a bit I guess we're doing we're making a car or something a little bit of a nonsymmetrical car but it is what it is um and this uh sure let's extrude it a bit more whatever it it it's something you know a building if if you will a building on a chicken foot so this shape I will just get it into grasshopper as subd subd shape so now by the way I have covered points I have covered curves I have covered BS surfaces meeses and subd so when it comes down to data types we're going to be done after this yay um so I get the subd in here set one subd and the first thing that I want to do to be able to manipulate it is I want to convert it into a mesh and not just any mesh but actually I want to extract the control polygon so I'm not going to use the mesh from subd Tool because it smoothes it out rather I want the sharp version of it so I'm going to go to subd subd control polygon I extract that and thus I get this you know control polygon mesh right so with this mesh I can deconstruct it actually sorry apologies I don't deconstruct it I just go to mesh analysis and I'll just use phase boundaries to get all of the separate uh objects of the mesh all of the SE separate boundaries of the mesh and then for each of the boundaries I'm going to um scale SC them yeah I'm going to I could offset or scale so I'm going to choose to offset them oh sorry I'm going to choose to scale them because it's just simply faster and easier to show so every boundary gets scaled around its polygon center that is another one polygon center with a factor of like I don't know 90 doesn't really matter 0.5 I'm just going to give it a slider and then I'll adjust the slider accordingly you know by by how much I need uh so now we have our boundaries and we have the scaled boundaries and what I want to do is I want to Loft them right I want to create a loft and then from that Loft I want to uh make a mesh again and loft is technically a yucky way of doing this but it's the fastest in terms of amount of nodes required so we're doing that unless we use plugins but we don't so for the boundaries um and the geometry I want to put them in the same uh structure in the same list oops like that is it going to be another trust new Bro type of situation yeah I definitely will CU right now I have 140 uh curves all in one list so Loft will just the bed honestly Loft will not work well it's going to work but it's going to Loft through 140 curves we don't want that actually I can show you I think it won't crash um I'm going to just save here don't do this by the way I'm I'm going to do this for you uh and I'm just going to Loft nah it just doesn't even work Loft could not be constructed okay anyway so that doesn't work because all of the curves are in one list so what I want to do is I want the curves to be separated and grouped up two by two by two you know all all of them should be paired this is going to be weird I'm going to right click on the boundaries and yeah trust me bro type of a situation boundaries output right click graft we used to use flatten flatten puts everything in one list graft separates everything into separate lists so we use graft and now if I were to use Loft again graph is this little arrow that goes up you right click and you choose graph now if I use Loft now it just works I really hated that I can't explain it to you properly right now but it is what it is so now we have these these openings right we have these openings and for these openings I can also you know from from The Loft um I need to convert The Loft back into uh mesh right and I can use I I don't don't remember if you have this I hope you do there's a simple mesh tool let me just check well technically it exists under the mesh tab so you might have it so simple mesh tool actually you know converts everything quite neatly into a mesh but since I'm not uh I don't remember if you have this just in case I'm going to show you um more manual approach because you know if we look at any of these Lofts it's basically made out of one 2 3 four out of four surfaces subsurfaces right that are uh all quads all uh the the all form rectangles right so that means I could just use uh [Music] deconstruct bre ah it's in the top thec construct bre B rep I get the faces and for the faces for each face I get the the the the face boundaries not not face boundaries sorry B edges or I could actually I could just deconstruct B again for each phase right so now when I deconstruct it twice now I get four points for each of the surface and I can use those to um construct a mesh and since construct mesh by default it uses Four Points to construct a single surface of a mesh it's going to make it so basically it's the same um like these three nodes and this node are exactly the same you could you know mentally you could draw an equal sign uh equal sign between them I will do that for you equals right so which one should we use uh let's use this one because I'm 100% sure that this one will work for everyone right so now we have a bunch of separate mesh faces that are just like floating about we need to join them all up so I'm going to first of all flatten the list right um notice this dash line right everywhere where we ever since we graphed it there was a dash line this means that we have multiple lists going through here and it's basically lists of lists of lists I'll explain that in the future I keep promising that um so construct mesh the mesh output we need to flatten that to pull everything back into one single list because then we will be able to mesh join join them all up into one big mesh right so now if I were to look at the mesh join you know this is one single mesh and I can use two nervs command uh sorry to subd uh subd from mesh subd from mesh fine surface Prim uh subd subd from mesh yeah I don't know why it didn't give it to me and now I get this kind of a cute little Behavior I guess but now since this is a parametric model I can change the size of the holes for it right so I can control how how much it opens up which is nice and of course the factor for the size remember when we use the point to read how far away um for instance any of these Center points is from any given point for instance here point right click set one point for instance here or where wherever doesn't matter here I can measure distance between this point and all of the center points here I get the distances and I can um remap those numbers those distance numbers to be uh between 0.1 and 0.9 something like that with the source domain being uh one second need to think oh we just need to know the maximum and minimum distance so by using bounds we can do that literally the same thing as what I was doing when I was explaining the remap numbers note right except that here again everything comes in as uh list of lists we want for the bounce calculation to work we want everything to be in one list so the numbers needs to be flattened like that and then we connect it to source and then the of course the mapped numbers need to go into the factor and now wherever I move this point you know it closes off so I can I can control that which is nice uh so that's a little kind of bonus bonus thing for you okay internalize that okay back in here we have our subd from mesh which you know if I bake out hit tab you know looks looks like that to give it thickness you can before you uh create a subd from mesh you can offset mesh you can use offset mesh tool missed it mesh connects to mesh distance uh you give it distance let's say two or whatever and make sure that uh create solid that this is toggled to True by default it is true so you're fine and then you just connect the offset ad version to the subd from mesh and it just breaks okay no no please uh is it the distance no it's not oo that's interesting so why does it break then um did do we need to unify cleaning up of a mesh usually consists of unify mesh uh tool and another one mesh clean tool so let let's see if the just UniFi mesh will work yeah okay that was enough UniFi mesh just work uh you know Works cleans the up well enough so that we have ourselves a decent offset insert you know we made cheese yay the thickness is too much in in here but you know you you get you get what I mean and then this subd can be two nervs converted to nurs for further uh Boolean Union bullan difference and and so on right because as long as it's nerves and as long as it's closed you can just create some sort of a sphere looking thing Boolean difference from it with the sphere and it just all works perfectly fine right so that's uh a very basic kind of very basic concept of how you can manipulate um a subd and what you can do so you convert it into mesh you do what you want with the mesh and then you convert it back into subd right that's the premise that that's how it works uh internalized data hide all of this we move on one of my favorite tools or two of my favorite tools first one is sub defuse subd fuse tool so for example I let's say have some sort of a nervs geometry let's do two boxes actually let let's go for it box here like that and box here like that nothing special just two boxes let's reference them in bre set multiple BS p bre okay step one we need these BS to become meshes so that they can become subd uh directly translating BS into subd H not the best idea I mean it should technically work if we just do subd from mesh and we connect beup to mesh should work but I think it's going to be very very complainy yeah it's not the best you know they they should be a little bit different slight slightly slightly different so what we do is for these BS we first use quad remesh quad remesh Boop right and actually is that a good idea nah maybe not sorry I'm I'm I'm just thinking actually yeah whatever quad remesh um and and we give it a pretty generous amount of polygons in this case it's too many but oh actually no it's it's too it's too many Let's uh quad remesh settings let's change that to like 500 each not more yeah that seems a little bit better so that's our remeshed uh boxes you can see that they're starting to lose shape a little bit you could use guides for the quad remesh I wonder if that would work um one second if I just give it the wireframe will it lock into the wireframe nah it doesn't okay so we don't use that never mind we don't use that we just use a little bit weird quiet remesh and then we convert them mesh to subd or subd from mesh bam and they get a little bit uh you know smoothed out subd tends to smooth things out unless you introduce creases to it but um that is a little bit more advanced in grasshopper so we skip over it so now with these two subd if you want to merge them together subd don't really have Boolean operations but they do have one thing that might help which is subd fuse if I select that there's subd a and subd b in this case we have two subd here which I'm just going to use list item it can only fuse two things together it can't fuse five right so you would need to fuse two things and then add one more add one more with multiple of these sub diffuses if you have more than two elements subd a goes here subd B goes here and voila it just managed to fuse the two objects together and of course there's U multiple options here there's fuse and then there's inter section so an overlap between the two there there is a minus B so you can bully in difference there is B minus a you can bully in difference the other way great and then there's smoing so how many iterations of smoing should it do uh after the fuse has finished right so this is like zero smoothing iterations it's pretty sharp you know the transition is pretty sharp and this is like 100 smoothing iteration so it's really really smooth if I in insert this and I look at it here and I quad re oh sorry not quad remes two nervs again this is a pretty damn clean uh nervs poly surface that you can use you know that's a nice nice transition here so when it comes down to Shell creation architectural shell creation of this kind of smoo buildings there's nothing better than uh using subd it's a great tool okay that's another one then the last one last bit that I will show you with subd is curves or or uh Network networks of Curves got go there um what should we do I know everyone likes voronoi so I'll I'll show you one quick voronoi example so if um aono is a way of how you can tesate a Surface by giving it a point distribution so let's go to the top view and let's just simply create a rectangle any any size you want maybe this is a little bit too big but doesn't matter really rectangle reference that one in curve set one curve now we populate this rectangle in two Dimensions right so we used to use populate geometry that populates a surface of a geometry since a rectangle does not have a surface we need to use populate 2D and it's not a threedimensional object so we can't use populate 3D populate 2D our rectangle is the region count as how many points uh let's keep it at 100 if I need to I'll adjust it later and we have our Point distribution right Point calculation uh yeah we have our Point Cloud so these points uh then I can go to mesh triangulation voronoi there we go planner vorono diagram for collection of points that's great that's what we want and we just connect this population of points to the points input and we get a very organic shape that all of the students love and it's I don't know it's fine I guess uh it's is just overused so don't use it too much and of course with waro you can also uh Define the the radius of these points so we can you can do you know if it's five nothing touches as you increase it bigger slider there we go as you increase it things start touching and that's basically how voronoi kind of works right so it's a it's a lovely um algorithm that is unfortunately since it's so lovely it has been used to to hell and you can also apply a boundary so we can use the same rectangle as a boundary for the waro and thus we end up with a bunch of cells here right a bunch of waro cells so then the question is how do you make this into some form of a of a network you know how how do you um for example how do you make it into a dome well first of all you need to transfer these cells from here onto a dome but before you do so all of the cells right now are enclosed um polarine curves so if I were to big out you'll see that you know this is um every cell is a curve on its own like that and you don't want it you want it to be a network meaning that all of the curves should not be duplicate because for instance here this this curve is duplicate because this cell and this cell share it right so there's two curves here you don't want that you want them to be single cells so what you do is you explode all of them explode you get all of the segments you force them into one list right click flatten right and then you uh remove duplicates remove duplicate lines with a certain tolerance 0.01 seems to be probably okay we'll see if it's uh not going to work we'll need to increase the tolerance for now I think it's going to work so now all of these if I were to insert if I were to bake this is a single line um actually let me hide this as well that's a single line that's a single line and and so on right that's a very small line oh no uh I can really see a problem a problem happening right there we'll see we'll see so for now we have this waro um pattern and what I can do oops shouldn't have deleted that there we go and now what we can do to actually make a network out of it a three-dimensional network is um you know about pipe so technically I could pipe this right and it looks good as long as you don't zoom in the moment you zoom in you notice that oh crap all of the pipes are actually like separate objects that don't really work together they're just kind of intersecting right so pipes are bad for that they're they're not not good for seamless connections and thankfully alternative to that is multipipe multipipe this this bad boy right here it's under uh surface subd multipipe you can take the lines and you can connect that to Curves hide the pipe for now and see now it makes a very very clean connection and I'm just looking through do it all and it seems to be working just well yep everything works just fine and I'll find a very very small connection I think it was here yeah it was was it yeah it was here and even here it seems to be working quite well now let's increase the radius of them that's the I believe the node size or size points I never remember I think it's not size let's just uh make five like something ridiculously thick and it still seems to be I mean it's starting to mess up a little bit but it seems uh to be doing quite well right so let's reduce it to like three and in most cases except here uh three seems to be quite quite good the further like steps or iterations that I would do is I would actually uh bake this out and then any areas that I need to fix for example you know this is weird I would just take this point move it over here take this point move it over here tab perhaps they could move a little bit closer here something like that yep something like that and you you just straighten it out uh manually and there's of course many areas where you know that that fails but don't be afraid of manual labor is what I'm saying okay then then we have um let's make this a little bit smaller then we have a bunch of different settings here uh settings here that I'm not going to cover as much but uh the I guess the most important one is the amount of segments um or sorry uh yeah amount of segments along this uh this division so if I do like five segments bam you can see that adds five divisions so by doing so you can uh create more uh or not more but like better resolution and I'm like looking at this and it seems like that's the gap size spacing okay so this is the spacing between the edges so what's the resolution basically uh for for the polygons you can get a more uniform distribution when you apply the segments this way uh then we have our uh stret size was it I think um one second yeah yeah okay okay so if if you're decreasing the stretch size you can see that now the middle portion becomes thicker uh thinner and U nodes become thinner and if you increase it Beyond one two Beyond one then it's going to have the opposite effect of these becoming thicker right looks like a balloon uh one is you know everything is kind of e evened out so you can have that that control over it as well okay that's enough with the multipipe that seems to work quite well and quite quite nicely and of course you can apply multipipe to any kind of a any kind of a geometry um if we have just give me give me a second oops let me just move this over here internalize data uh have this grouped okay so for example if I were to let's do our where's where's our B no those are the two faces I'm just going to find one here that's curve curve curve surface okay can we use this yeah I'm just going to borrow this crl C r v the surface tool from where we used to use the surface right uh this saddle like shape uh the surface tool I will convert into a mesh by using quadre mesh uh actually we can just use surface mesh or mesh surface tool as long as it's like a quad surface it's very easy to mesh it you just give it U and VC count so I'm just going to say 25 by 25 easy we get a grid and then from this mesh I can get wires B sorry that's not uh mesh edges mesh edges I merge the naked edges and the interior edges as you can see I'm trying not to repeat too much stuff that I already said and then these edges I can use multipipe to pipe them up uh multipipe like that curves uh let's give it like a three I don't know for the size sure four just so that it's visible better right and we get ourselves a pretty clean insert a pretty clean lce structure which you know this is uh the flat preview tab this is the smooth preview VI okay so that's you know you can basically as long as you have a network of Curves you can use multiply multipipe on that I think that's it uh that's it with the with subd you can extract vertices you can extract edges um and that that's it it's a small one okay so subd is finished let's let's move on okay next chapter let's look into the transforms and different ways of how we can move rotate scale Orient mirror and so on Geometry I'm just going to cover the basics of it and you know a deeper deeper ones you can uh figure out yourselves I guess so the first thing is we need a test subject of sorts and I'm just going to create a sphere here in grasshopper sphere with a radius of let's go for five there we go there's our little sphere and the things that we can do with the sphere we can move it I already showed you move quite a few times sphere connects to the geometry input and for the motion we need to give it a vector so in this case I'm going to move it along the X unit X by 20 right we get to move the sphere by 20 units and you might think well it's not moving it it's copying it well actually it is moving it it's just that we see the previous version of the sphere here right that's also something that students kind of mentally it at least for first day they kind of struggle with it and then they figure it out that all of the iterations you know of previous geometry generation they stay you know so move is you could think of copy but it's not really copy it's like now when you apply move the sphere the fear appears here right what if you want to make a bunch of copies of it well you can move along the x or let's go for y this time along the Y Vector but instead of using a single number you can use series of numbers a list of numbers right and the step size is let's say five and the count is let's say 25 so a list of numbers produces a list of spheres right so that's uh like creating multiple spheres that move of course under array you can you can already see there's a linear array here that we can apply if I just use the geometry of the sphere and in the polar array plane that's interesting oh that's polar array my bad my bad sorry uh array linear array there we go uh geometry goes here Direction X by this time let's say well actually it should be like negative so we can use negative value here and whatever value you plug into the negative node it's going to be minus so it's going to go backwards in X Direction and we will just give it like five bam so the linear array works this way right and of course the count controls the count is the same thing as in series how many uh spheres should U array personally I usually use the move rather than array I don't know why I'm just used to it more both of these are exactly exactly the same okay then we have uh for the array let's let's continue here we have the rectangular array geometry but geometry requires us to give it a cell and a cell for a rectangular array is a rectangle so I can create a rectangle this one create a rectangle on a plane and for the size I will just give it um let's go for 5 by five 5 by five H more 10 by 10 you know so that's the rectangle and it just moves according to the rectangle uh the rectangle size and then we can Define how many there are in XC count and how many there are in y count right so you can array your spheres that way that's the rectangular array then moving on we have our oh actually let's finish up with the array because I already showed you the box array uh quite early on I will not be repeating that but there is the polar array which might be quite interesting so polar array revolves around the central axis and and or rather a central plane and in this case polar array if I just connect the sphere here to the polar array you'll see that it does not really do anything and the reason for that is because the sphere is just simply because the by default the uh the plane around which the array happens is World XY plane and the sphere is built on world XY plane it just kind of rotates around its own circle around its own center point so you can't see it but if we first move move the sphere like that and then we use polar array on the moved geometry well that's a different different kind of a situation here so then we can uh apply the count uh let's see 22 right and you can change the angle in this case the angle comes in as radians but you can right click and you can choose degrees and then you can use like normal people measurements for for the degrees 360 180 and so on right so you can control that okay that's one more thing okay so those are the arrays there's a kaleidoscope but we don't let's not then um one second project I've already shown you project I can show you again project basically takes any kind of a geometry and projects it onto uh any kind of a plane so in this case the plane is World XY but if I were to just you know let me just create one plane uh plane from 3 PT Plane 3 PT ah yeah list item something like that we get ourselves like a crooked plane bam and then if I move one point around you know my my my geometry that sphere it's basically as if it's a shadow gets projected onto the plane right so spheres are fine uh I mean it makes a very weird type of a geometry usually you project like curves and points rather than three-dimensional shapes three dimensional geometries but it still works so we so we keep it uh internalize bam group okay so that's project there's also project along where you can define a direction for projection or onto a plane so you can project it at a weird angle onto onto a plane but we will not be using that because it's a little bit more advanced and you don't really need it that often uh scale if we have a sphere we need a center point for scaling and to get a center point of any closed shape let's do it like that to get a center point of any closed shape you just simply need to get its volumetric centroid to get any center point of a flat shape you just get its area centroid and to get the center point of any polygon you get it uh polygon Center like that in this case it's a closed shape so we get a vol metric centroid get that in here and the factor is percentage so 0.5 is half the size like so and then you know you can play with it of course you can scale it up as well so Factor two makes it bigger so that's scaling there is of course non-uniform scaling scale Nu U same geometry uh the plane is basically for non-uniform scaling you need to Define what's the what's the plane along which you're you're going to be scaling so I'm just going to use a simple XY World XY plane and then I can Define three different scaling factors let's say along the X Direction it needs to scale by five along the Y Direction .5 and along Z Direction it stays as one like that and I just make a weird looking squished banana thing right that's SC non-uniform scaling stretch think of it as stretch okay what else what else what else hm box mapping huh n I'm going to show you a different thing it's going to be cooler it's going to be under morph but for now let's just see array and F effin fine is done ukian transforms move is done rotate is not done okay and mirror is not done so mirroring is pretty straightforward for this I need a separate type of of of geometry uh so I'm just going to make some sort of a box some somewhere off off the XY AIS and you can see that the mirror plane by default is set to y z not XY so that's why this plane right here is vertical if I add a b in here it just mirrors along that plane uh and of course I can then uh take those three points so I can just borrow this plane between three points and use that for mirroring right and now suddenly that plane or or rather the three points that generate that plane uh starts working as a mirror surface right so if I were to move this around wait now it's the Y AIS huh oh it's internalized my bad my bad one second there we go right now I can use this as a mirror so that's cool um mirror is is a nice nice tool to use uh let me just internalize that's already internalized group this up uh then for ukian transforms I'm just going to show you one rotation or rather yeah I'm I'm just going to show you one rotate and one Orient node so Orient is what's what's a good example one second first let's do uh first let's do do do do rotation right uh that's going to be easier so if we have this B here right and I want to rotate it I have all of these possibilities for rotation right uh the one that I'm going to show is going to be rotate 3D this one because this one is the most flexible one so rotate 3D asks me for geometry that's fine I have one asks me for an angle we always right click on the angle and we choose degrees rather than radians because we're not nerds and we create a slider 0 do do 180 do do 360 between 0 and 360 that's our angle and you can see that now it does work it does rotate but it rotates around this particular point right here and that is the center of rotation right the center of rotation by default is set to 0 0 0 point if I want the center of rotation of it to be in the middle of this box I just do a volumetric volumetric centroid so I measure the volume connect that and now the Box can rotate around its original owner I guess uh or whatever you call it let me delete that and then for the axis uh that is currently vertical Z axis but I can very easily just if I convert it to any Vector then I can Define the direction you know around which it rotates so right now it's rotating around the x axis rather than Z so if I look at it here you know that's the axis around which it rotates and so on so rotate is pretty simple pretty straightforward we're blasting through these aren't we okay A little bit of water water I'm getting tired I'll need to take a break after this one Orient okay that's going to be a little bit trickier to show but uh we'll we'll we'll manage we'll manage so for example what would be a cool cool thing to show you let's grab that surface that we keep using was it this one yeah yeah this one surface crl ctrl+ V and then of course drag it over there we go so I'm going to use this surface here and I'm going to use uh under the surface tools utilities I'm going to use surface frames tool surface frames bam and I'm just going to to give it a count of uh 25 by 25 so 450 something frames four oh no six 76 frames okay because it becomes 26 by 26 I forgot anyway uh we get a bunch of planes in here arranged as a grid and then if we want to populate uh elements onto these planes what I can do is I can create any kind of an element let's make something uh let's do subd this time around subd uh cone whatever weird subd cone looking Thing tab sure spiky boy right and I'm placing it currently like I'm trying to be smart about it and place it on world XY plane just so that it's easier for me to to to navigate it but perhaps just for the sake of this example I should move it away from World XY plane just to you know explain to you the origin plane logic so anyway uh what I want is I want this to exist on top of every one of these right every one of these planes uh this cone needs to exist so first of all I reference it in as subd set one subd bam then I will use under transform under morph I will use no that's not more sorry ukian transform orientation Orient and the geometry that I'm going to orient is going to be my subd geometry and the source plane from which I move it needs to be located at the bottom of this shape so what I'm going to do is I'll go for standard and I'll just create one two three points at the bottom of my shape right so 0 0 0 point x Direction y direction I will reference them in set multiple origin x y and I will 3 PT plane three points ah yes list item I keep forgetting list item like that okay and I I just make a plane on the bottom of the surface so now doesn't matter how uh this is rotated as long as the points rotated to together with it the plane will match up right so that's great so then from this plane that's the source plane my target plane is going to be every single plane that we have here under the frames so I just literally connect surface frames to my target for the Orient takes a while but here it is gives me the Orient planes and you can see that it's um Whatchamacallit it's it it goes in it doesn't go out so I need to fix that and the way I fix that is by either flipping over this uh shape here or simply by moving this point from this position to the opposite side of the of the shape and then these will be looking outwards maybe there's too many of them let's do like 15 something like this and just scale this up a little bit make them a bit bigger and there we go we have ourselves a spiky boy insert that you know kind of organic kind of petal shape like so that's that's one thing uh that that's the Orient that's how Orient Works hope this uh is easy to internalize data uh I hope it's easy to follow along okay all of these are internalized I can I think I can delete these yeah perfect now let's do some um a little bit more complex things with the morph uh so in terms of morph I'm going to show you one second one tool yep I'm going to show you one tool with with morph and from it you'll need to build it up yourselves so or rather two tools I guess surface box and box morph uh these two working in tandem so for example um I create a surface any kind of a surface doesn't matter uh rebuild it I rebuild it with uh 4x4 points with degree of 3x3 hit F10 and I will just simply move up uh all of the points except the corner ones and thus I create this Dome shape right easy we have this Dome shape I will reference it in as a surface set one surface there we go hide it and then for it uh under morph I will create a surface box on it so it asks me for a surface and it will ask me for a domain we already did this if I go back in here isot trim also asked us for a domain and we use divide domain squared to get a grid of domains um as you can see things are starting to repeat themselves which is nice so I will use divide domain squared for the surface as well you count we count let's go for 15 by 15 something like that and for the height of the boxes so these have thickness right so for the height of the boxes I will use like I don't know I start with 50 and I adjust 50 is probably going to be too much actually not that bad uh just slightly less 44 okay so we have ourselves a bunch of Twisted boxes that are following our shell right very nice now we need to insert geometry into those boxes so a way of how I kind of want to tackle this is by just here creating some sort of a rectangle uh let's say 50 by 50 just the size of the rectangle de matter it's all going to be proportion based right 50 by 50 and from the I'm going to create a tile that is going to be added into every single one of these boxes so I'm going to say offset this should I offset now let's make something a little bit different let's just do like a weird thing with like a weird trapezoid pyramid thing so if I just make a planner surface out of this delete and I extrude it oops up a little bit and I move this or copy this up and I scale this down a bit and copy this again and scale this down a bit you know I end up with this pattern I guess bullan Union something very simple you know and something very very quick and maybe this one can be a little bit taller sure I guess right so something super super simple and then I said weird and then I end up doing three boxes but I'm tired that's my excuse uh B right click set multip set one B actually because I used bullan Union to join them up and now I want to convert or not convert but to get this into every single one of these how how do well if you use morph box morph that's the answer so you need to first of all you define the geometry right that's my tile then you need to give it a reference box and that is going to be a bounding box you know a box into which this fits perfectly touching the corners of the Box just in case Union box there we go and we convert uh we connect that to the reference and then for the Target we will use all of those Twisted boxes here bam give it a second and we end up with this and I think this is the first time where I'm going to actually use I'm disabling the preview of everything where I'm actually going to use a custom preview just to be able to show it to you in uh Arctic view properly so I'm going to use custom preview node right here which automatically draws it in pink it is what it is and then we go for the Arctic View and we can see our little Waffle structure here actually actually work and it's kind of clean on the outside it's nice on the inside if I take this and I just rotate it 180° then it's clean on the outside and it's uh waffly on the inside right so that that's that's how it works I'll delete the custom preview just so that it's not in the way for now okay so that that's the premise you know you have your surface boxes and you populate them with any kind of geometry um since box morph accepts geometry rather than b or a mesh this can be a mesh uh this can be a subd this can be a nerves poly surface uh so whatever right so that's that's how you apply box morph in this little example here okay um yep those are the two that I wanted to show and then for utilities these are way too no no no no no I guess grouping and ungrouping is kind of useful but um okay I I can show you so is there like a reason now at this stage of your learning there's no reason for you to use group on group so we will not do that we will say that this in terms of trans Transformations or translation that's all you need uh that's all you need for now right so on to the next chapter okay let's talk about text this time it's actually pretty interesting because you use text and grasshopper or manipulate the text and grasshopper quite a bit and it's I guess at early stages you don't really manipulate it that much but basically for every drawing that you get from the municipality and so on and you know any kind of data that you that gets imported um usually there's CAD text that you need to work with so I'll begin by uh showing you a distinction between what a t text entity is and text is right if here in Rhino I just simply write write a text which sure Maple R question question mark you know maple tree and I'll just draw a circle here doesn't really matter what so this is this might be one type of a data that would come in from any kind of cat drawing where the r is undefined and you would be measuring the r and typing it in but you can kind of automate it with a little system and I'll use that as an opportunity to actually show you about how you operate with text so the first thing is how do you get this into grass oper well there are two containers for text one is called text like this hexagon the other one is called text entity like this text entity which one is which well the text if I right click on it you can see there's no Set uh input objects right you can only set it the text and I can write cat here commit changes and then if I look at it it says cat right so this is something that you can only set up in grasshopper so to get it uh get some text from Rhino you need to use text entity node which is located right here you right click on it you set one text entity you select your object right now we have your your referenced text entity right here that says Maple R question question uh question mark question mark So what's a text entity well first of all it does have words in it right and characters and letters and so on for sure it does but also it has much more information it has the font information the text size information alignment information and then so on right so it has a bunch of data what you care about is mostly just the text right the text itself so so what you want to do is you want to extract this Maple R question question mark from this the way you do it is you go to the Rhino tab you go to the annotations Tab and here you'll find a text entity uh object or note which you take and you connect your text entity to the text entity input right here then the output that you get well there are a few uh first one is or second one first one doesn't matter the second one is a plane so it shows you where does the text start from that's sometimes useful uh but more importantly you get the text output here which is raw text which we like so what can you do with this raw text well first of all if uh we go to our Vector nope to our set text sub tab all of the operations with the text are available here and the main ones are these four honestly and those are the ones that I will be show showcasing so the first one is characters you can split it into separate characters like that and the result if I look at it bam we get our you know every SE separate character gets placed into its own little list uh you can also use text split tool that takes this text and splits it with a specific symbol Right add a specific symbol so in this case I'll use the space bar right so I'll just write dash dash panel space bar it looks like the panel is empty it's not because it has a space bar in it and then if I look at the result it's going to be two lines Maple and R equals question question mark then what I can do with this is I can call index remove certain item from the list and I can remove index one just like that and I'm left with just Maple right of course it won't update here because we're only operating with the text but that's fine we we're learning learning things right then um to this Maple I want to add the radius the r of the circle right so how do I do that well I first need to get the circle in here uh curve curve set one curve bam then I want to get the actually is there like a radius tool no no there's not okay fine we get the Center Point area centroid of the curve we get the let's say a start Point uh sorry end point either start or the end point of the curve it really doesn't matter because in a circle the start and the end are exactly the same point so it doesn't matter which one you you choose and we will just measure the distance between them let's say start point and the centroid we get the distance and that's some sort of a value 38.4 655 95 um this is too much uh too many digits after the comma I only want two digits after the comma you know for the Precision so the way I personally like to do it is I like to multiply this by uh th oh sorry 100 multiply this by 100 so that I get 3846 right right then I convert this into an integer number which integer can only be full numbers meaning there's no more digits after the comma and then I divide it by 100 you know it looks clunky here because I'm using panels but it's actually uh pretty pretty decent and then what I get is 38 4.47 right so initially what we're doing is we're just choosing how many digits after the comma we want if I convert uh if I change this to uh let's say maximum is a th000 and change this to a th000 then we're going to have three digits after the comma 100 gives us two and 10 gives us one right okay so now we have our radius number that's cool I want to also get that R equals before this radius number so I'm just going to create a panel and I'm going to write R equals that's it right this text right here okay and now I want to join them up text join it's under here text join oh yeah and I forgot I need to get them into one list so merge R equals and 38 looks like that text to join joining if if I keep this empty then it's not going to add anything in between them and if I look at the result I have my R equals 38.4 okay great I have my maple and I have my r equal 38.4 7 so now I can merge this into one list and I can join text join again you need to flatten this sorry uh you need to right click flatten for for them to actually be in one list the moment I saw the dashed line here I know that it's this merge is the bed and we need to right click flatten for it to actually work then if I look at the result here it's going to be okay it's upside down what the hell okay fine we need need to flatten here and here instead of here so you flatten the inputs not the output and then it's going to say mapler equals 38.4 7 um so the joining uh symbol should be the space bar panel space bar connect that one in here and now we get our nice little space so that's you know some some text operations there I of course there's a much much faster way and you know easier uh of how to do this but it's uh this is very pedagogically because I show you like everything step by step um out of all of these there's also text length option oops which when you have a lot of texts that are very similar it's very useful to filter out the ones that you need so if I look at that text length this case will give me amount of characters that um there are I can also get the text link by breaking the characters are measuring the list length right here that's going to be 10 as well so basically that's a shortcut for this okay so now when I have my maple R equals 38.4 7 how do I place this uh where you know in in this position well I use text tag 3D not just regular text tag I use text tag 3D which asks me for a location the location is going to be the plane the original plane for our of our text entity like that the text to display will be a our Maple R 38.4 7 and the size color and justification I mean technically you could uh you could get the text size uh font size and color but instead of doing that I will just create my own so size let's say 15 that's a little bit too much 11 color whatever and justification um it a bottom left but it should actually be top top left right top left okay and now if I hide this ah it's also here bam hide that now I get my maple with the correct radius and if I scale this you know the radius updates so to get this in I just bake it default okay and I have myself my you know parametric way of how I can uh I can overwrite the existing existing text in this case you know it's oversimplified system but in most cases I mean that that's that's how you do it that that's how you how you work with it so for now I'm just going to keep it as it is and that kind of concludes the text part it's honestly not that difficult it's just it just builds up when you need to you know separate out precisely the element number number five in the text line or stuff like that but um I I I believe with list item you know separating this into characters and then using list item to get uh item number four or item index 4 which is the letter e at this point you should be able to kind of extrapolate on that and understand that how that works next chapter okay custom previews system representation of geometries that you create in grasshopper and are shown in your rhino viewport but are not baked that's an important distinction right so how can you showcase things not in a you know in this way in this color right specifically when you're looking at it in the Arctic view doesn't look that great so for this example or for this portion of the course I will be using the same geometry that we have created in our transforms chapter uh the last one that was the Box morph right so this Dome shape right here and the easiest method of how to actually create a shading system for this Dome or this is actually not a single Dome it's an array of elements right shaped like a dome you can just use custom preview node custom preview this bad boy right here which is located under display tab under preview there's the custom preview node and if you just simply connect it like so then automatically it's being shaded in this pink hot pink color or bubble pink I don't remember yeah I I don't remember what was the name of the color but you know pinkish color if I go to Arctic view you can clearly see it right now there's two pieces of geometry overlapping each other because box morph has not been hidden I'm going to hide it and now you can see this this uh Pink shiny color in the Arctic viewport right if I then um want to control the color of it just the color I would use a tool called Swatch color swatch which basically does not give us I can connect it to material input here it does not give us any control over the shininess or reflectivity or anything like that of the material but it gives us full control over the color so if I click on the color here I can then find you know any color that I that I want I can also control the alpha value which is the transparency with the Swatch material right so I can make it a little bit more transparent here so that's the color swatch a more advanced version of this oh by the way one more thing if I hide the custom preview right here H that's interesting okay sure if I hide custom preview it Heights it used to be it used to still show up and you would need to right click and untick the render portion but for some reason it's kind of hiding which is weird uh I don't know so hide in custom preview hides the actual geometry now in Rhino 8 which is fine uh we just get used to it it's okay so never mind if I want to enhance this material I wouldn't use a color swatch I would actually create under preview I would create a material here bam and the color swatch would go into the diffuse input like so and the material con would connect to the material here so what's the difference well now I have the possibility to change the spec specular color the emission the transparency and the shine through the use of the create material node so the specular if I hover my mouse over it you can see you know color the specular highlight right now it's set to White if I use my color swatch connect that to speckler and I change it to something that is not white in the Arctic view I guess it does that does not show up I guess we would need to change it to rate trace for it to show up let's see if it shows in the rendered View no also doesn't care okay let's jump for R Trace see if that helps I'm about to give up I think it does it's hard to say hard to say I personally use um VR for rendering purposes so the specular color I don't you know I I I don't mess with um generally speaking I create um View materials instead emission color um that is set to Black if I set it to White then suddenly this produces starts producing light right again if I go for rrac well now you can't really see anything but uh that geometry is indeed producing light in retraced mode right that's emission transparency that is definitely not a color uh that is a percentage so 0.5 would be 50% transparent open op and so on right once you're very close to zero uh per transparency it starts behaving weird so be careful with that you know you want to be either transparent or non completely non-transparent you shouldn't be very close to being transparent and the last one is shine um you can if you hover your mouse you can see what kind of inputs you can have zero is done shine one is low shine 100 is Max shine so if I just create a slider saying 100 connect that to shine now my uh object is all shiny I will just really quickly check if the specular will react to it now red really nothing R raced okay still absolutely zero reaction from the specular I guess well there's something here I don't know let's let's not play with it too much but you get the idea right you you can construct any kind of a material with different types of shininess attached to it okay let's go one step further let's apply a different material for every different tile for that I will be using a tool called gradient under preview no it's not I'm lying under color that is going I'm lying again where the hell okay gradient is that going to be under input yeah okay that was under params input gradient is located there um this basically generates a set of colors right so how can we generate a range of colors for this entity well I can say that well 0 one okay I can say that I just want a range like to to create a range of colors that would um coincide with the amount of elements that we have so the first thing that I do is I measure the list length list length because I I need to know how many elements I have and I have get 225 and that becomes my upper limit bam like that so basically um element zero number Z is going to be gray green element uh number 225 is going to be red and then for the parameter I will just create series of numbers and I'm going to count them 225 times so imagine this it's basically going to um since this is at zero green is at zero red is at 200 uh 5 25 225 is going to just go first element green second element you know which is number one also kind of green element number 120 somewhere in the middle yellow and and so on right so this basically generates a bunch of colors for each element individually and if I connect that to the diffuse color I can you know can see the pretty colors right and of course you know since it's counting like so this is element one element Two element three element Four Element five you know the rainbow kind of appears here by the way if you don't like the colors you can right click on them hit presets and you can find you know a color theme that that works for you you can also push and pull on these on these little sliders to adjust the color distribution okay so that's one thing another thing that I would like to show you is once you get those colors you can actually shuffle them around and the tool that does that is called Jitter Jitter it takes a list and it shuffles it you know inside it just literally Jitters the list so the values that you get get randomized and you can specify by how much do they get randomized so my uh my Jitter value if that is 0.5 that's going to steer towards a certain um angle I guess and the the bigger the number the more random it is the smaller the number the closer it is is going to be to the original right so you can kind of have it randomized which is kind of nice okay so that's uh that's one way another way is you can control the gradient let me group this up you can control the gradient by simply measuring hotpots uh what are hotpots uh by measuring the distances between attractor points and these elements so let me show you an example let's say I have these two two points here one here in the top actually both in the top just floating about in space like that this one's here a little bit closer these two points and I have a bunch of elements right so what I can do is I can first of will reference in the points right click set multiple so now the these two are referenced then and for these elements I can say okay give me the volume uh centroid of these elements and it's going to give me the the center points for each of these guys by the way notice that this takes almost 100 milliseconds which is pretty long so what I can do is I can uh convert them into a mesh I believe that was stupid that takes 1.4 seconds never mind we don't do that uh we're okay okay with 100 milliseconds uh so basically from these two points I will find the closest point uh for these centroids or either from each of these centroids I will find the closest point out of these two points so I'll just measure uh closest point I'll use the closest point tool so from the centroids I try to to to search for the closest point in the cloud I will draw a line just so that it's kind of easier for you to see what kind of a measurements it's making from here to here see let me turn on the the color display so that it's a little bit less yeah there we go so it's making these measurements and it finds which ones are closer right um so so those measurements that I get are here those distances are here and I can remap them remap these distances from uh the biggest and smallest one so I need bounds as what we always do we need to find the smallest and the largest distance and we need to create the uh domain from them like so and I remap them into a Target domain which is going to be by default 0 to one which is great so now my remapped numbers are always going to be between zero and one so now what I can do is I can create a gradient again create a gradient and I can say my lower limit is zero that's good my upper limit is one that's good because all of these numbers are between zero and one my parameters are uh these these mapped numbers and then according to you know if if it's close it's going to be green if it's far away it's going to be red right right so we color it that way and I'll just use custom preview again custom preview node hide this one and use this one for the geometry the Box morph geometry and connect the gradient to my material bam voila now I have hotpots right let me change the preset to something like this and maybe make it a little bit more tolerant there we go and now this measures you know how close things are getting to it in this case these two points and colors it you can of course color a slope this way I have like tutorials for that as well um on the the the YouTube channel you can just roof slope grass oper and you'll find it and you can color a bunch of different things things this way right so that's the that's the custom custom preview in in in a nutshell let's see if there's anything else that I want to show you I already showed you the vector display node multiple times when I was talking about the vector Point list node uh also showed you when I was talking about points nothing here nothing here we did the text tag 3d nothing here and you can construct a color from red green blue like from three numbers but that's very simplistic okay I think that's kind of it honestly uh internalize data here okay that's an easy chapter let's move on so there is one thing that I skipped over and now we're coming back to it because now we have enough knowledge to actually work with it and it's called fields we had points we had vectors and and the vector U tab uh we had planes and we also have Fields so here um if I were to actually if I were to describe what a field is it's basically a data type that was introduced in grasshopper 0.9 I believe and it's a data type that deals with forces in space right so imagine it it it's basically you you have a space that is filled with forces going at a different directions think of wind for example and then if you say I want to know the exactly the the force at this particular point in in space um this right there in this particular point in space and it's going to say well the wind Force for example let's say wind or magnetic force doesn't matter at this point in space is going to the left and it's at a strength of five or something like that and then you say okay what about this point in space and it goes well this point in space is actually going to the right it's the strength of three you know so those are Fields it's basically a space filled with forces and you only can see them when you evaluate that space at a given point or a grid of points if you will we'll do that as well so here under Fields we're going to actually we're going to look at most of these and the easiest way to to create a field is actually to create some point charges some point that introduce a charge introduce a force in the field so I'm just going to place one oh let's go for one point why not YOLO one point right just this this little guy right here right and I'm just going to reference it in as a point right click set one point there we go and then in the field tab I'm going to apply a Point charge for it Point charge requires me to give it a point we we' got that notice how the icon immediately changes can I make it bigger no I can't okay so the icon iMed immediately changes so it's a force that is pushing out from the point that's what the icon shows then the charge since it's a positive it is indeed pushing out if I had a negative charge minus one it would be pushing in see it's changing uh um and then you can you know you can mess around with it for now I'm going to keep the charge set to one for this particular point then Decay is how fast does the power the strength of this pushing fall off the further we are away from the point and bounce is when do we stop calculating right how far does does does it reach how far does the calculation Reach In this case we're doing it Unbound okay so that generates a field as you can clearly see there's nothing that we can really see that's because a field just like a vector needs to be evaluated so how do we evaluate it well let's start with 2D stuff right let's just simply create a rectangle do we do random let's do random let's create a rectangle uh reference it in as a curve set one curve populate 2D that's going to be our region and for now I'm going to keep the count set to the default value of 100 right we have all of these points and I will use these 100 points to evaluate this particular field um actually I'll show you here evaluate field right here evaluate a field at a point bam we've got the field here we've got a point here or points here and what we get from that is a 10 and a strength right a tensor and a strength so this is a very going to be a very weak field because the charge is one and it's decaying very fast but I believe if we just look at the tensors which are by the way tensors are vectors U for the sake of argument just put an equal sign in your head for it tensor equals Vector so if I do Vector display right here I anchor or sorry I the VOR that I show is here and I anchor it to my 100 points like so you can see that it generates a bunch of vectors that are pushing away and let let's do a little bit of amplitude shance for the vectors let's increase the amplitude to like well 500 is going to be an Overkill five or is it wait is it so small okay 500 I think I did a very big rectangle yeah yeah I did a very big rectangle let's make it smaller there we go and now let's shrink it a little bit apologies the rectangle was way too big so now you can clearly see that you know this point is pushing all of these uh other points away so it's it's generating U sorry it's generating uh this kind of a push effect okay what if we want to have two points right bam and I just instead of one clear values clear values I give it set multiple points I give it two points well that seems weird there's like one vector that is looking to the left and all other are kind of reacting to this and this one you know only this point is reacting to this Vector so that clearly something is wrong with it wait my voice is gone clearly something is wrong and the thing that is wrong is that two points actually generate two Fields if I look at it with a panel it's two Fields here so what I want to do I want to merge them into one and I can do this by using the merge Fields tool right here bam that merges like that and now I have have two vectors interacting with each other and the interesting bit of course happens when they meet right there you know how does the um Direction Change let me increase the count for this so I'm going to say 200 points bam let's go for more 500 points and you can clearly see like a direction of them pushing one uh one another away and it's like a magnetic IC field it does have that kind of a behavior right so merge Fields when you use more than one point or more than one of anything here because you can also do for example here we have these two points so I can draw a poly line through them which literally is just going to create a single line segment right like so and then I can use line segment uh sorry not line segment field line charge node here and use that and then this this becomes a line charge that that affects the the grid right so then you can have like two line charges here and and so on so maybe I I will I will do so uh let's say one here one there why not and this one is a little bit push then these two lines uh so I can disconnect that and just grab a curve comp component right click set multiple curves connect those as lines right so you know stuff gets kind of squeezed in here that's fine and then for uh the points we can just literally connect them to the field and holding the shift key connect that to the merge Fields as well so suddenly the points have an influence the lines have an influence everything has an influence over uh the field so we can construct a pretty pretty intense uh you know pretty intense structure this way in terms of you know the directionality so visualization of it via vectors is great and all and of course you can then uh use the vectors for different things so for example you could use the the vector to just create a line so instead of vector display I can do line sdl uh start Direction length to construct a line right and I can use the the the the vector well the tensor in this case for the start sorry apologies uh Direction uh tensor is actually Direction the start is the points from which they should start like so and then I can control the length with you know this number slider that I had here for the amplitude right so now I have a bunch of sticks then I can then extrude up and and so on right to to construct some geometry I will not be doing that in for for this particular uh portion of the of the course so we're we're stuck with the with the arrows all right so that's like a two-dimensional U field and and how you how you operate it we start with that then continuing on if you were to work with a three-dimensional thing you know a threedimensional geometry that absolutely can happen or rather you absolutely can do that so let me just really quickly uh internalize data here internalized data here hide these guys and let's create some fancy three-dimensional like weird stuff why not a quick little oh forgot one internalize for forgot this one so for example if I were to let's do a completely parametric model so first let's create a box in which everything is going to be calculated um let's do a Center box center box and I'll say it should be a cube of 100 by 100 by 100 that that that once we have this box here then we need to populate it with a bunch of points just like we did with the rectangle right so I'm going to use this in this case populate 3D because box is three dimensional right populate 3D like that and I'm just simply going to um grab the box and put it in the region right so it gives me 100 points for now I'm going to keep it as 100 but then keep in mind I will be adding a slider to this later on so that's done with the points now we need to create some charges in here for for the Box H we could populate 3D again but I I think maybe for you it would be more nice to to learn how to create a point at any given place in the box so I'm going to be using point charges rather than uh line charges um if I let's hide the popular 3D for now and just look at the box if I type in evaluate box tool evaluate box it basically gives me UV and W parameters for box evaluation and if I just connected here it gives me the center point of the Box because UV and W are all set to be 0.5 so if I were to just create a slider of 0.5 here here and here just got contrl c contrl v copy pasting connected now I can control a position of a point inside of a box with this slider you can see me you know moving it along the U Direction moving it along V Direction and moving it along W Direction so what I can do is now I can create or I can get a point anywhere proportionally on this box and I'll do so with two points for now evaluate box again and just give it different numbers right something like this okay so now as we have these two points I will give them point charges for both of them so holding down the shift key I'll give them both the same charge of one if I want to give two points that come in here two different charges I would need to create a uh in the panel I would need to create two numbers one and five for example and I would need to give it a or re remove the multi-line data option from the panel right now these are two charges uh first point has charge of five second Point has a charge of one I don't want to do that so I'm going to keep it as one for both the Decay goes beyond just simply goes to two that's fine and then the field um is generated here rather two fields are generated right don't forget to merge the fields together so that the points actually influence one another like that and now as we have our pop ation of points and we have our field right here I can actually you know evaluate the field but instead of doing that this time around I'm going to use the field line tool because I want to show it to you field line field goes in here points go in here and it just shows me how would a point travel within that this kind of a field and let me just increase the populate 3D uh count how many points there are to uh something closer to like 600 and you can clearly see that the two points that are pushing uh the the field away and if I move um let's actually see them there we go if I move one of these these guys over to here and the other one over to here I'm just positioning them into the opposite sides you can see you know them really literally just kind of hit each other like that right so we produce some pretty interesting uh field line uh results of course these are just random points populated in space so not really architectural but um could be used for some interesting patterns um with that being said you can of course um increase the amount of steps right now it's set to 1,000 steps if you do 2,000 steps you know the curves just grow further uh so we can control the you know how far they grow and you can also um change the accuracy if the calculation of this takes too long uh you can of course also use the box to introduce the point charge pound so that anything that goes beyond the Box gets trimmed away or rather the forces become zero does the field line stops moving stops growing beyond the boundaries of the box I have removed the bounds in this case so those are uh point charges for the valuate Box let's actually uh group this up hide it call it a day and then make a copy of this whole thing delete the group and delete the evaluate box let's make some and delete the point charges as well but keep the populate 3D as well as the field line and the merge Fields tool a different way of how you can just create a bunch of points in the box is by using the same technique populate 3D populate 3D with a very low count three for example and don't forget to also change the seed uh 666 whatever I CH change the seed so that the randomness of this and randomness of this don't overlap right and then I just add the center box into the region and we populate these three points and now we can we could use Point charge again but in this case I'm going to use the spin Force charge and that's going to be the last thing that we do spin Force charge asks us for actually it asks us for a plane which is interesting if we just give it points it's going to force the points to be horizontal uh in in in their spin which is absolutely fine uh later we can uh we can change the the the planes for them make them a little bit fancier but for now that's okay then uh the strength radius well we can increase the radius of it of these guys to like 50 or so bam that's basically the radius of this pin and let's just just connect it I just want to see how it looks like voila we get ourselves this kind of a spin Force right there's clearly something that we can do with this as well um with that being said I I believe that it's it would be for for a spin force uh let's uh group this and save this but for a spin Force copy paste I actually like to be very uh me methodic iCal or very precise with the position of the planes where uh that are being used for the spin spinny boys uh to be oriented along right so what what are the planes uh so instead of using a random populate 3D I'm actually going to for this Center box here I'm going to be creating little rectangles like so and I'm just going to do like three of them one two three for now they can just be okay I even missed them completely they can be just here that's fine three rectangles and I'll reference them in here as curves and the nice thing about flat rectangles is that if I were to just say is planner you know test curve for for planarity if I use this node right here the output that it gives me is not just the answer that they are indeed flat that they are planner but also it gives me there planes that I can use as planes for the spin spinning Force things right and now I can start breaking them apart but before we do so let's look at the fields right now it's just a just a mess right because everything is also spinning in the same direction right so it's not um there's no counter Force everything is just going clockwise or counterclockwise I'm not sure seems like it's going counterclockwise so but if I rotate one of these you can see the influence that this has rotate another rotate the third one like that and now we're starting to get somewhere it's starting to become quite a bit more interesting we're starting to build up a structure here well not not a structure that's that's far-fetched isn't it but something something interesting uh something with with which we can start designing look at that funky little spiral there okay so now let's reduce uh and this is it this is how you operate with fields and how you can generate you know insane amounts of complexity really quickly let's reduce the complexity to something like 250 and to make this structural you can actually make this structural by the way all you would need to do I I will show you one more trick or one more step for this I would take these curves I would divide them up divide these curves actually I would probably divide them sorry I wonder if reu if you have rebuilt curve let me check well it says that you should have it n let let's do a simpler method so I will divide um divide length for the curves and I'll divide them every um 10 units in length right so I get these these these points right and then with these points I can then do um proximity check so I basically can say that every point should find at least two or three uh neighbors a tool that does that is called proximity 3D and it's located under I believe that was mesh mesh triangulation nope yes proximity 3D this bad boy right here bam we grab the points we connect them in here and you can see that right now it seems like the points only see other points that were on the curve and that's due to the data tree next chapter data trees by the way that's due to the data trees and that you know this is a separate list this is a separate list this is a sep separately so they can't see anything else so to force them to see something else we can right click and flatten bam and now we're starting to get a little bit of a structure in here right neat huh so now with this structure kind of working um I can check the links I need to flatten this again by the way check the links I have 13,600 of them and I can remove all of the duplicates because if this point is able to connect to this point that means this point is able to connect to this point so there's like two lines there so if I remove duplicates remove duplicate lines bam now we're left with 8,000 of them rather than 13 I believe yeah 13,600 much better and with 8,000 of them left I believe um YOLO um multipipe will work let you see actually let's save first save that and internalize something internalize that there we go save it again and now we do this because this is going to be heavy I Know It come on oh 4 seconds didn't crash uh still calculating oh there we go that works quite well it is a little bit spiky in certain places though ah it does break unfortunately we were so close to Glory so close yet so far unfortunate maybe we can reduce the spikiness actually I I wonder I wonder why just give me a second oh it's because of how many um lines connect at a very sharp angle okay gotcha so we can't use multipipe instead I will use a mesh pipe tool you might not um You probably will not have it [Music] but okay so uh don't do it just see how I do it I guess um because unfortunately you don't have it and we are not there yet with the um creation of of of uh plugins or not creation but downloading of plugins so if I connect curves uh are there parameters oh there are too many parameters here okay I'm just all over the place I I'm tired and I want to go home and let's stop multipipe reaches its limit with this it's unable to to fix it which is absolutely fine that's okay I believe if we were to say that the group proximity is actually set to uh three rather than five that should be better now it's still it's still very yucky very messy so can't expect that to to to work so you would need to just use a regular mesh pipe or to use a cocoon um cocoon shape actually one thing that I could show you before we end here in in this uh this chapter if I bake this in into Rhino um I probably should have selected and do delete those if we bake these in into Rhino I believe that we can use shrink wrap for this structure to make it sound so as long as you have Rhino 8 uh shrink wrap oh it doesn't want the these guys to be shrink wrapped okay never mind then I probably should just give up you would need to mesh pipe it and then shrink crap it for it to be a 3D printable structure there are multiple ways of how you can do it but uh we're probably I would guess at like a 6 hour mark something like that with the video I'm really not sure for how long I have been recording so we should stop and we just move on to the next chapter that's how you get a bunch of curves that look structure that are actually structural and that would hold themselves up that's it next chapter we move on it's time it's time to talk about data trees the nastiest and hardest to understand thing in whole grasshopper if you grasp data trees and data tree structures and how to operate with data trees then you're basically able to do anything you want in grasshopper but it takes a while and the concept of a data tree is quite simple really it it's u a list of lists potentially of lists of lists of lists right a data tree can be not just a list of lists but those lists can have other lists inside of them and so on right and operating with that becomes quite tricky so I guess we begin by me kind of showing you the use cases or rather not the use cases but the most basic data tree that we could create if I go here and first I'll I'll do a synthetic example right I'm just going to create a panel and I'm going to make a list my favorite cat dog Mouse horse chicken I'm going to make another panel a b c um D only four letters five animals four letters I'm going to make another list 1 2 3 right click on the first one multiline data second one multi-line data third one multi-line data these are three separate lists exactly the same as what for example series generates the series node generates right these lists as you can see have indices numbers uh where the item is located in the list and also the list themselves have their address think of it as yeah the address of the list so since these exist in a vacuum you know by themselves all of their addresses are 0 0 0 for some reason the address of this list is 0 comma 0 that makes no sense why um are these zeros and this is zero well not comma but you know the weird icon here I forgot forget the name um zero so why are there two zeros here well that's because some of the nodes when you use them add an additional zero to the address ask me why I don't know I really don't know uh but you do that and that messes things up because uh not remember how I from time to time I would flatten things um when I use merge I'm trying to find an example of that well actually let's just try to merge these two lists merge oops wrong let's try to merge these two lists into one list first comes 1 2 3 and then comes these 1 2 3 4 5 and so on and then we look at the merge output bam it didn't merge into one list it actually merged into two even though this is zero and this is like 0 comma 0 which is literally the same but they don't merge and this drives me crazy because they should right so when I did right click flatten I eliminate that that information that z0 uh information I just push everything into one list on purpose right so I'll come back to the flatten in just a second but that that's why I did it right so that trust me bro moment that was why I you know why I was doing it because things wouldn't merge into one list and I couldn't operate with everything I couldn't join for example all of the geometry into one piece of geometry because was still in separate lists anyway moving back here one way of how you can actually eliminate the z0 this problem is by right clicking on the output of series and choosing to simplify simplify the data in this parameter by removing all redundant path indices I guess no path elements redundant this zero is redundant if you're not sure what redundant means Google that word quite a useful word redundant I click on simplify are you kidding me I was really okay do I simplify this then okay it doesn't work so this is not redundant then how is this not redundant okay I just flattened this whatever uh flattening kills it I'm not sure why simplify didn't work and I did the whole speech and so on I'll find another example where I can actually show you simplify at work simplify should have removed that additional Zero from the address it didn't so what I did it is I used flatten flatten all data in this parameter into a single list and that just killed the the address uh the simplified the address automatically so that works for some reason simplify didn't okay God damn it we move on um I guess I can I can keep this in here just as an example let me group this up but let me yink back the one two three um this uh list right here so for now let's make a data tree so if I use merge on this tree guys merge that's not going to be a data tree that's going to be us making just a longer list and I can show you how that looks like ma'am CAD do mouse horse uh chicken ABC D1 2 3 right just takes uh D1 reads the whole thing then attaches uh D2 then attaches D3 right and just creates a single list you can see only one address a single list that you know just has all of this to actually uh work with these three lists and let me delete that to work with these three lists as a data tree we need to use a command that's or tool that's called an wine and wine flatten and combine a collection of data streams into a data tree I should say right and even here it says Branch zero Branch one branch two and so on so I connect this list to be my Branch zero this list to be my Branch one and this list to be my Branch two and it's um it tends to flatten by default which is great basically anything that comes into Branch zero it will make sure that you know you're running running the flatten tool preemptively just to make sure that all of it comes in as one list because it's going to mess things up if you don't right we have our intwine and if I look at the result of it you will see that that I have my cat dog Mouse horse chicken list with this address right here 0 0 ABCD list with 01 address right here one 123 list with 02 address right here right so I have these three lists in one output and you can see that the line has changed from a double line right here a thicken line into a dash line that means multiple lists are going through this line a data tree a of how I can also display the data tree for you is by going to param tab utilities and choosing param viewer right here and we're going to get to the interesting bit in just a second um maybe something like that and then the prime viewer if I just connect my result to it is going to say well there is a data tree with three branches each branch corresponding to the you know three lists that we have connected 0 0 01 and 02 if I double click and by the way it also says here N5 meaning that there is five elements in the first Branch four elements in the second branch and three elements in the third branch exactly as expected if I double click on this it actually shows me the data tree the data structure right with these three branches located here right branching out and here are those addresses right here are those uh these rings are basically those addresses right and at since at this ring nothing branches out further right nothing really happens the branch just keeps keeps going continuing that means that this uh these points they do literally nothing they don't matter and if I double click on this again and I see the address the same thing is here right 0 00 0 those don't matter those don't do anything only 0 one and two really matter so what I could do please work this time if I right click and I choose to simplify oh thank God if I choose to simplify the result it removes those uh zeros right and we're then only left with the address at of zero one and two Branch zero Branch one branch two double click that now this is how it looks like only one of these Rings right and there's five elements here two element oh sorry five elements here the animals four elements here the letters and three elements here the numbers if I right click on this and I untick the simplify you can see that then you know the additional complexity here that is not needed that's the Redundant zeros okay so that's um ju just keep in mind that sometimes grass oper tends to generate crap that you need to just use simplify to get rid of uh when dealing with data trees so that's the first thing and sometimes you don't even need the data tree then you flatten it into one list oh I can show you what happens data with three branches and 543 right click flatten data with one bran branches data with one branch and 12 everything pushed into one list right forced into one list with one element or rather with one branch so that's the flatten okay what does Gra have to do if we have uh flatten we have simplify we have graft and we have reverse I guess first I can show you what reverse does if I click on reverse every list inside inside of every Branch the data gets reversed back you know so so we now start with chicken then it's horse Mouse dog cat dcba 321 if I un reverse it now it's normal cat dog Mouse horse chicken ABCD 23 right so that's that's the logic of reversing and then we have our graft so this is the last one sometimes especially when you're dealing with some specific geometry and I'll show you uh an example of that um quite soon but when you're dealing with specific geometry and you want to isolate it and you want to work with it individually like separately um you want to separate that geometry into one list right into its own list sorry into its own data Branch um I will show you first a much simpler example of this if I just have this list which is uh text right and I look at it because you can't do anything with the panel you can't graft the panel so I'm looking at it and here and actually I'm also sorry sorry sorry I'm also going to look at it through the data um structure oops that's wrong through the data structure um data how is it called the Pam viewer I think yeah through the Pam viewer data with one branch yeah that's the single list five items in the list double click on that that's our list perfect now I right click on this and I choose to graft it bam five items or five elements right five branches with one element in each list so what it does what graph does is basically a reverse flatten while flatten takes any kind of a comp complex data structure and just goes okay which one is the first you're going to be the first item in the list you're going to be the second item in the list and just builds a single list from any kind of complex data structure so simplifies it to hell what this does it takes any kind of a list or any kind of a data structure for that matter and takes every individual element in that list and goes okay you are your own data Branch now you are your own list of one element now now you are your own list of one element you are your own list of one element right that's what it does and with a single list the data tree looks like this right just branches out also I can simplify it right again because there's a bunch of zeros that are unnecessary so if I simplify bam the zeros are gone and you know the data tray looks like this easy hopefully then here to show showcase it here if I right click because here we have like we already have a data structure sorry data Tre structure with these one two three elements if and this is data with three branches if I right click and I choose to graft it there's 12 branches now with some fancy addresses as well because remember it's all it's still simplified I need some space here something like that yeah that's going to be fine so it's still simplified right so now there's like two numbers for the address and you can see that it's 0 0 0 1 0 2 03 0 4 and then it's okay so once it counted five then it jumps to 1 0 1 1 1 2 1 3 it count at four and then it jumps to to zero to one to two it counts three it's just exactly the same thing as here 5 4 3 right and then you can see also here that it's always one element in each data Branch if I double click this then this is our data tree right so this chunk right here clearly you have like three main branches right for the list one list two list three but then they produce you produce sub branches because you're taking every element in the list and you're saying now you're your own Branch you're your own Branch so you're making smaller branches so this is a more complex data tree right which has um okay there we go which has exactly the same amount of elements but now they have been placed into separate branches okay enough Theory because I guess without really showing it in practice you know doesn't really doesn't really help so let's go for for some practical stuff example number one we have let's say a rectangle something like that reference it in as a curve set one curve I immediately internalize I'm not going to change anything about it and we make a surface out of it by the way you can just use surface tool as long as it's a rectangle and it's flat surface node that will just make a surface through it boundary uh surface uh would also work right but anyway it's a surface then we use divide divide surface this is the simplest one that I can show you and I'm just going to reduce the count so in U Direction the divisions are going to be three so it's going to be producing four points and in V Direction let's say it's going to be five so it's going to be producing six points so four and six points let's check them out in a panel now let's go for the param viewer this time around param viewer okay huh data with four branches these points are not in the single list they are in separate lists actually right oh and ew what the hell why does it have so right click simplify okay I don't know I don't know why it keeps adding those damn zeros that that's bane of my existence if uh someone from McNeil is watching this course at probably like hour number nine please answer me in the comments if you answer properly I will pin your comment and I will apologize if there is no answer then this is a bad tool bad design and this shouldn't exist okay rant over moving on so 0 1 2 3 those are the indices or addresses of the branches right and now if I simplify it it's quite straightforward every single one of these four branches has six points in it right this is branch number one this is branch number two branch number three branch number four think about it as columns and rows there are columns and in each column there are points right so let me uh draw that for you um sure let's do one 2 3 4 one two 3 four five six okay change this to red and we have these points here right one to uh rather we have according what the close sketch attributes could not be set we don't know why though okay cancel that please don't crash save us scary scary moment I'm going to let let let it save oh it's a little bit crashy anyway so for every uh row we have five or six sorry we have six points right so in every row we have those six points which I'm trying to draw but it doesn't doesn't work and all of these you know 1 two 3 3 four five 6 1 2 3 4 five 6 1 2 three four come on four five six uh I'm I'm rushing I'm I'm rushing I'm lightning fast okay and all of these if I were to draw the indices or write the indices of them this would be zero this would be also zero also zero also zero right and if I were to look at it with a panel zero index zero index zero index zero index so those zeros are these points right here and I can actually fetch them for you to to show it in the Rhino uh viewport with list item list item list by default the index that it it's fetching Forest extracting Forest is indeed zero so the items that are currently highlighted the hello the green ones are the points you know at at index zero and I can even show it to you better if I I guess if I hide the surface no I'll show the curve uh so I can show that that better like so and I can also if I also hide the curve I can do a polyline through them actually I can't okay okay okay this is going to be also a learning experience a little bit uh since there is still a data tree here after I fet them they're still in in separate branches right so the data tree is exactly the same right for the list item if I connect it here it's still four branches but now it's one element in each branch and what that does to any kind of a mathematics or or any kind of a function that I'm trying to do with it is that it won't work the points don't see each other because they're in separate lists right so they don't exist to each other so if I do a poly line it's just going to complain and going to say insufficient points for a poly line right and it says that because well it goes to this list and it goes yo you're just giving me one point I can't do anything it goes then to the second list goes again one point what do you mean I can't do anything and and so on right it can't draw a line at one point so what do we do you already know I'll give you a hint trust me bro exactly right click flatten they're now pushed all into one list the F uh the item from the first list for sorry the item from the first Branch was P pushed to the top of the list then item from the second br Branch came then item from the third branch came and so on and everything just collapses into one list and now polar line goes oh okay okay Four Points no problem say no more I've got you bro and it just draws the line here if I were to so that's list item with index uh when I use index zero if I use index one for example then it just goes through the next you know next row of elements next row of Point index one right and catches those so the question is or actually I should didn't delete that one the question is if if we are able to draw a polar line there uh give me a second I need to clean this up a little bit get a little bit of of room in here so that is not too cramped so that is going to be its own example I'm just going to place it here real quick and then we we will continue on okay you go here we continue on uh maybe like so something like that um then the next question is okay what would happen if I were to flatten uh this output here right how would it read how would would it draw right because here it's like uh let me show you here it's like 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 0 1 2 3 4 5 if I flatten all of this this becomes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 right so technically if I were to flatten this the polar line through these points would make a zigzag right and that's exactly what it's going to do so if I let's go to our set tree and instead of using flatten here because I want to keep this logic here available for you to see I'm going to actually use a node that does the flattening for me and the node is going to be called flatten somewhere here no it has to be right yeah yeah there we go flatten tree flatten tree node ignore the path um okay it's basically what kind of you know name for the list would you like to give once you flatten the tree keep it as default uh you honestly almost never need to to change the path but after we have flattened the tree that's exactly by the way as right clicking and choosing flatten here exactly the same thing and I draw a polar line through it let me hide this polar line though so that it's not in the way bam that is exactly well okay it it was inverted but besides the you know so this was the zero uh besides that it draws the polar line um exactly as I as I said it would right as this zigzag so that's the logic that's the logic of um data trees and operations with them uh you might think okay so so what what what what do I do with it you know what's the reason there is a next next example I'm just kind of thinking about where to start with the next example the reason for it okay let's let's do a quick paneling thing for me to explain it to you so this gets grouped up [Music] somehow um sure a little bit bigger group but that's fine this gets grouped up and let's make why is this oh okay it's still here like that is this internalized yes it is that's great so let's make uh some sort of a paneling uh some sort of a paneling structure for that I want to make a loft I guess but we did uh regular Loft before let's do a loft from circles so just draw one Circle another one a little bit thicker boy another one a little bit thinner one more and I think one more yeah why not five circles something like that going to be looking like a bong Loft ew don't like it um how do we make it nice I think by tilting the the big one oh that's too much of a tilt if we tilt the big one actually let's start lofting here so let's just reference in the curves and then we will learn how to make it nice that's another nice thing about uh lofting in grasshopper is that then you can just adjust the curves and you get you know the nice Loft that you want so I just reference in all of these Curves in here and then I just use a loft through them and now I'm just going to be um adjusting those curves so that they they look nice I think the for the Loft options I kind of want to oops I kind of want to use Loft options I want to use a different type of a loft that would be uh instead of a normal right click on this choose loose yeah yeah that that's that's that's nicer loose Loft tends to be a little bit more a little bit more elegant when it comes down to this kind of stuff um I'm just going to minimize the size of these bottle sure uh it's it's going to be a bottle and then this maybe can be rotated and moved away in a weird way maybe we scale it a bit here and we scale this a bit more here so that there's like a nice crease here something like that why not yeah whatever a a bottle looking facade thing um for for this example that's going to be fine uh internalize that delete the curves don't need the curves anymore so this Loft right I will divide it up into segments into elements and I will use um let's let's get a refresher let's use ISO trim for this ISO trim which asks us for surface we do have it we have a loft and asks us for the domain so for that I would need to use divide domain squared divide domain wait is that squared nope my bad divide domain it needs to be squared it needs to be a two-dimensional thing or else you're just going to be out of luck divide domain squared The Loft is our domain the segments go into the iso trim and for the U count and the VC count we can uh can mess around so we can say okay I'm thinking thinking thinking how much um let's go for like 15 x 15 don't need more something like that okay we have all of these 225 surfaces right and now for these 225 surfaces I want to uh create like a I want to operate with them separately and I want to get their edges right I want to offset oh actually I can I can draw so for every surface I want to extract their edges I want to offset them inwards and I want to make a loft between them like that this is going to be I'm trying to make it as simple of an example as possible beautiful drawing by the way uh wait I need to sign this there we go uh the date uh 20 24 you're welcome nft so that offset to to do it I actually need to just um for for every surface right I need to get B edges B edges and you will notice what what happens when when we do that be up edges and if I look at it here this is actually like something that happens under the hood and you need to be very mindful of it of it happening so you constantly check what kind of data tree do you have um here if I check with the param Vier one branch 225 elements in the branch great if I check with the panel easy one list you know in that Branch a bunch of surfaces great that that's one what I want to see after I extract the edges it really thinks that okay you definitely don't want to place all of the edges in one list why would you you want for every surface you want to place those edges that belong to that surface into their own list that makes sense right so now after I get the B edges and I extract the naked edges which is the perimeter it gives me 225 branches let's look at the data tree it's going to be gnarly like that right so for this is like every surface and inside of every Branch there is four elements Edge one edge2 H3 H4 right those are the four elements if I look at it in the uh with a panel curve well it doesn't matter what kind of curve but curve curve curve curve curve curve curve curve curve curve curve right four Curves in each one of these again with the addresses though really messy right click simplify ah nice right click you know even here it's nicer I will keep talking about it until it's it's not a thing anymore or until I understand the use for it um okay so with these curves here now I am able to actually join them into a like a closed loop right so if I join curves bam they are now joined into a closed a single closed curve easy so now what I end up having is this uh same 225 branches because of the 2 25 uh I'm going to get there 225 uh surfaces but but now it's only one element in each branch because four elements were joined into one right so now it's Clos curve okay we move on the address right click simplify no go away okay 225 right so now after this I can I I'm going to make a on purpose I'm going to make an error so that you can see and uh before I do so I will reduce this to like five instead of uh 15 by 15 uh so it's only 25 branches because if if I make it um yeah if if if I were to make it with with u 15 x 15 it would just crash my computer the next thing that I'm going to do but here I'm going to say well actually now we're done right we have one element in each branch we can just right click and flatten this we can just push everything into one list we don't need to really think about it in the future right cuz now all I have here are separate curves right like all of these let me hide this actually the isot trim is messing us up so these if I were to actually even bake this in these are like separate parameters here that are just in one list right just chilling in in in one list after we uh flatten this simplify by the way does nothing at this point uh if if you're flat ing it okay we we we have them in one list but now remember my beautiful drawing I want to offset it sure that's going to work I can offset I think we need to use offset loose though offset curve loose curve to offset that those are going to be our curves it's going to be a little bit yucky uh distance to offset by that's going to be uh negative a negative distance of I don't know like 10 I have no idea how big this this thing is you also uh so just just guess you can guess in in do an informed guess by checking the grid by the way that's one unit right so 10 is going to be way too much not that bad not that bad honestly but you can see that the offset in this case is uh really Walky so I might not use the offset I might use something else um one last ditched effort is nah nah n it's it's too messy this is a beginner level course I'm not not going to start solving this instead we just scale it's not going to be as nice but at least it's going to work with less amount of nodes okay so geometry the curves are the geometry that we scale the center point is curve Center or uh sorry polygon polygon Center polygon Center this bad boy right here ooh cannot convert input curve to Polar line that's fine if it can't do that that's okay we can just simply um okay there are two ways of how we can do it we can either get an area of these surfaces you know because these surfaces are basically the same thing so if we just extract the centroid those are the center points so that's one way another way is for these curves that that we have here we could technically explode them get the vertices of of the exploded curves and then average them out average out the vertices and we would get e what the hell one second recursive explosion why are there five vertices one second I think the start and end points are duplicated so we remove duplicate points and then we use the average yeah now the arithmetic mean is much closer to the actual centroid but as you can see it treats it as if this geometry is flat while it indeed Isn't So this method works this method from isot trim from surface area centroid much better which is get that that becomes our Center Point for scaling and you can see how clean the scale is I love it so for the factor uh somewhere between zero and uh 0.1 dot dot um 0.5 dot dot 0999 or 0.99 that's fine enter connect that to the factor increase it just something that looks nice something like that great we have ourselves uh little bit of a chain kind of situation and you can see the scaling is uh crappy because since you know for instance this element is stretched it's of course going to scale uh more in the horizontal than in the vertical offset tends to keep it clean but Ah that's too much work okay so after scaling we now have our jum here which is also all in one list and now we have a little bit of a problem how the hell do I Loft between these curves and these curves if I just merge these two things like so that ain't going to work right that's just going to be a long ass list oh actually not even my God not even a longest list because the addresses are not matching up anymore so I need to simplify this for this to work it doesn't flatten this okay then it does anyway the point is merch will not work because what we want for this to work is we want pairs of Curves right we want the outer one and the inner one to be in their own list and then they get lofted and then it moves on to to the next list of two curves they get lofted you know for every panel in this case this is a this doesn't work so the reason why it this doesn't work is because we're operating with everything as if it's a single list right we can't in this case everything needs to be separated out and that's where I made the mistake here it actually we actually shouldn't do this but but but but actually I can I can show you if I unflatten this what the hell what's going on and that is where most of the grasshopper crashes happen hope you're with me so far let me get some water and I'll explain delicious so notice how this is a dash line by the way the amount of curves that are generated is literally a square root or a squared number of amount of segments that we have or amount of surfaces that we have so it's 25 * 25 625 right how do I know I know this because that's that's how data tree mismatch behaves uh data with 25 branches 25 elements in each branch 25 * 25 right why well there's a dash line coming in here meaning that the curves that come in are coming in as separate like every curve for each branch like that closed curve closed curve closed curve you know so um every every segment is its own little Branch but the center points that come in they come in as one list right so what happens scale node takes the first curve and it goes like okay I need to scale this first curve by uh 94% by 68% by whatever amount of percent right I need to scale it down by 92% okay what's the center point give me show me the center point and what it gets instead of getting one Center Point it gets 25 of them a whole list of them and it goes no no problem okay so this curve the curve closed curve at zero index the first curve gets scaled around this point then it scale gets scaled around this point then around this point around this point and it gets scaled 25 times and then it's like yay I'm done okay next next one okay I have my second closed curve right from here I need to scale it again 92% and again I scale it along 25 different points and it just does so for 25 curves it scales them by 25 points thus 25 * 25 or by the end of it you get a data with 25 branches each branch for every curve that you have here it keeps the data tree structure but then the problem is that you know it gives you 25 Curves in each branch because of 25 Center points H fix how how fix problem fix how fix by right clicking the centroid here and forcing it also into a data tree its own data tree right and notice how you know even though it's it's all Walky and all messed up with the uh with the addresses here it's like uh cleaned up 0 1 2 3 4 here it's 00000000 1 02 um somewhere under the hood scale actually cleans it up for you and and actually you know manages to match these guys up because clearly it works right and clearly then you can see it's 25 branches one element in each branch everything works out so even though it's doing a crappy job here it's actually cleaning it up and then pushing a messed up address here again with a bunch of zeros so I will simplify it here so that it does not you know we're helping the scale by by simplifying the data okay so now these match up and it goes okay for the first curve I will use the first or you know I will use this element for the second curve I'll use this element third curve this element fourth curve this element and so on right so that that that's how it operates that's how it works I should probably keep at least one of these or I'll I'll keep actually both of these for you but I will of course make them make them smaller so that they they fit a little bit better something like that maybe okay so that's for now kind of working and if I were to check the merge now right here it says data with 25 branches two items in each branch because we take the original curve the outside perimeter we take the scaled curve the inside of the perimeter and we merge them into one list so basically what it does it [Music] takes it takes item in the IND one from here it takes item index one from here from the scale it pushes them into one list item index sorry apologies again it takes item index Zero from here item index Zero from here pushes them into one list item index one item index one pushes them into the second list and so on right so you end up with 25 lists of two elements in each list with uh closed curve closed curve right the big boy the small boy Big Boy small boy big boy small boy time to Loft easy just works just like that right easy peasy then it's time to this these Lofts need to be uh joined up into one B right into one boundary representation currently they are still in separate branches and now if I use B join they will not join right because they're in separate branches the BS that I get will still be open BS no bueno so what I do is I use um I I I right click on the Loft and I choose flatten and then BS are indeed you know the Lofts come in as one list like so and they are joined into one B here one poly surface and then you can offset the poly surface or do whatever you want with it I wonder if we can do offset surface that's just offset surface I wonder if that's going to work nope um should I show you how to offset a b it's kind of gnarly well we have plenty of time right I can show you okay this is going to be the last thing about the data trees um of course oh sorry uh of course there are multiple things that you can do with a data tree and uh I will be kind of talking about some of them but I need you to understand the the logic the the the logic behind them right and and how how they work once you know the logic then you can start operating with with them right so that's that's the first thing um do we no we shouldn't because if I give it thickness then the time is ticking and it's not a part of data trees apologies we move on we move on okay so with this done I can increase by the way the number slider back to like 10 or so and we get a pretty nice nice grid structure and also if you want to you can take the naked edges uh or sorry you can take the scaled uh surface you know the the the scaled inner edges you can um deconstruct them or explode them explode the scaled geometry into segments so we have these separate segments here and you can use Edge surface I it needs them to be separated but that's fine if I look at them with a panel you'll see that the segments are actually you know again back to separate elements and there are literally always four curves you know for for every every polar line became four curves so I can use list item to easily just get okay give me curve one curve two curve three curve four Bam Bam Bam Bam and then I get my uh my inner surface that I can custom preview with a Swatch it comes in as data tree we don't really care but uh and that's going to be white sure why not and then this B custom preview with a Swatch and it's going to be not white but rather uh some beautiful blue color oh very beautiful beautiful blue color hide all of those you know congratulations you have done some sort of weird fetish thing fetish looking thing okay so that's that's done uh right click internalized already that's great everything works let's move on to more conceptual things because just creating um a script that would showcase that with geometry would be way too much and would take up too much time so here [Music] under uh let's see clean tree um we will be using that but not yet I will be showcasing that in one of the um one of the F further chapters for now we skip over it flatten tree showed it graph tree literally the same thing as right clicking and choosing to graft um prune tree remove small branches so if you we have a list can I just borrow that I'm just borrowing our cat dog Mouse list here if we have this tree bam which is not grafted and we look at it right okay I can say with prun tree tool I can say actually the maximum size of a branch that I want to allow is four elements in size it just got rid of the you can see now there's no list with item uh sorry no list with address zero if I say that actually now the minimum is four then it gets rid of the the number list here right it only keeps the uh the animals and the alphabet so that's what PR and tree does moving on I I have a hunch that I will need this end wine so I'm I'm taking it contrl C uh we'll move to here hello oh we move here we continue from here uh ooh ooh trim tree trim tree very useful okay okay this this bad boy here uh right click uh graph this so now remember uh when this is grafted how it looks like uh pram viewer all of this separate branches right problem problem problem U well not a problem but like very complex very complex data Tre three main branches because three main lists and then every item in the the list becomes a smaller Branch so it has like a depth at which it's uh it's constructed right it's it's constructed with with a depth uh we can trim the tree and and um just imagine this you need it you need to do it for every element you know you need them to be grafted because you're doing something with uh offsetting lofting and so on and you need all of them to be kind of separate and so on and at the end of it all what you want is you want to end up back with three lists right so you can't just unra this you know not not graft it you want to end up with three list so what are your options well you could say um actually let me do one thing so if I just say text scribble a bunch of stuff happens happens in between and you can't not grab have have it grafted beautiful I should be a university teacher with these kind of explanations Okay so this right this happens and you have this this uh text right that that you know a mess of a data tree and what you want to end up with is three branches trim tree is your friend if I just read what it does reduce the complexity of a tree by merging the outermost branches it's going to take all of these points here and going going to merge them back to the main branch going to take all of these points mer them back all of these points merge them back so it's like an ungrafted type of a thing but only in one step so you're back to a data tree that has three uh three branches and that is like cat dog Mouse thing cat dog Mouse horse chicken thing right uh so so back to three lists trim tree very useful for because you can't flatten right if you just flatten it well first of all it complains but then if if you flatten the output here it just gives you a single list and there is no way of how you can go back to those three lists flatten is like All or Nothing type of a thing while trim tree just goes back one step or if you give it depth of two it goes back two steps and and so on I assume you get the idea of the depth but uh trim tree is quite useful right now it's complaining because it says yo there's one list what do you want me to trim uh but if I unflatten this then it's yeah it it does its job so that's that that's trim tree very very useful tool uh then what we can do is uh well there's unflatten but that unflatten is very annoying because you need a guide and we don't deal with those that's too too much and tne I already showed you o flip Matrix is kind of cool um can I show you it in geometry geometry wise yes I can o finally an example with geometry uh one curve second curve a little bit annoying but sure is that the Oro yeah that's the Oro snap okay uh curve component right click set multiple y get those both in there divide curve guess what it does you know you have two curves and it needs to make points on it on them clearly it makes a data tree peram data tree two branches 11 points in each branch easy each branch for each curve at this point you're probably already anticipating right what's going to happen I want to connect index one or index zero with index zero index one with index one I want to connect these points together what do I do how think I'll will simplify it just for you it's not for me it's for you simplify I want this point to connect with this point I can even show you even easier list item index zero po line hello wait oh yeah U index zero and then flatten and then polar line oh come on Annoying flip there we go uh when you flip it the points that are generated also flip their their um like the start and the end of the curve flips so now this is 0 Z and this is0 Z rather than it being here anyway I want this line but also I want it to be everywhere so what do I do do I just keep you know index one now and so on no of course not I want some logic in there and for that I'm going to use a tool that's called flip Matrix flip Matrix located right here flip Matrix actually will be almost the last tool I might show you the PA maap per as the last tool but we're getting there so flip Matrix okay when you have this kind of a data tree with two branches and 11 items in each branch what it's going to do is going to take item zero item zero and it's going to put it in one branch it's going to take item one item one and it's going to put it in the second Branch item three or item two item two Third Branch item three item three fourth Branch item four item four fifth branch and so on right so it's going going to flip the logic and instead of data with two branches and 11 items in each branch it's going to become 11 branches with two items in each branch so it matches up the indices right so flip Matrix if I use it like so now it becomes 11 items or sorry 11 branches with two items in each branch meaning two points and I can just simply use polar line on it and it just works like that so that's what flip Matrix does it takes the indices and it just flips them over okay internalized data we're so close path mapper okay so under here path mapper is basically flip Matrix only works when you have a simple data tree when there's only list of lists l s right because it needs to you know what were the branches become the indices and what where the indices become the branches but the moment you have a more complex data structure such as this I'm getting that as again the grafted cat dog Mouse uh list thing example this bad boy right here everything's in their own little list and I can also show you one second uh thinking thinking thinking real hard right now uh param viewer there we go that that logic uh this uh flip Matrix will not work here well technically it could I think but no no no is going to all paths may only differ at a single Focus or low Focus right so here uh it goes like no no no there's too many too many paths I don't know what to flip this is where this bad boy comes in this is welcome to the advanced advanced World want to see a bad swear word but I won't um if you double click this basically you can Define any kind of address and you can see how that address should be changed right to to you know in what way so for example I could uh connect this uh data tree that we have here right click and I can say uh create uh flatten mapping right and then what it does it says okay that means the address of A and B becomes just zero you know whatever address there is just push it in zero and that would actually work with the syntax I think everything would just be pushed yeah everything just gets pushed into one uh um line right but that's not what we want what I want is also I need to remember I I think index in brackets I I think that's the syntax uh so we have the big Branch address the small Branch address and the index right um if I check it here that's a this number is a this number is B and this is one if this had more numbers then it would be c d e and and so on and what I can do now is I can say actually ab1 should be re redone where it's I uh that weird thing do comma thing forgetting i b and then a is actually the index right so I reshuffle it according to how I want the data to flow hit okay now I have this is going to be trippy a data tree that says cat A1 why does it say so well it takes cat it takes a and it takes one and it puts it in one uh in the first Branch then it takes dog B2 dog B2 puts it in the second branch and that's because I'm I'm reading the index as my main um as my main branching thing and then everything else just follows follows along then it takes uh I I would assume Mouse C3 Mouse C3 goes into the third branch then we have on the fourth Branch we have horse D and there's nothing here right so it can't do the uh the third item and then the fourth branch is just chicken because it doesn't have anything here It's Tricky isn't it so this one is a little bit more advanced I I strongly suggest that you first learn about the flip Matrix and you know how to use that how to you know use graph flatten and simplify and so on and once you get accustomed to it then start exploring there specifically when you will see that flip Matrix is not working and you actually have a longer address and you only need to flip over the end part of the data tree right the furthermost branches of the data tree then the syntax of the flipping flippening would be ABI becomes a i b right that would be the syntax so everything kind of stays uh the start of it stays exactly the same and I can show you here honestly like that wait why does it do that um a stayed the same right so the main branches stayed the same and then indices became so it take took 000000 then it took okay yeah so it literally acts as a trim tree right now okay never mind that's a shittier example I'm going to keep the the original one but hopefully at least some of you get the point this is like non-mandatory to to learn right now I will even change the color of it to something like gray but in the future you should definitely kind of put put focus on this this path mapper tool okay uh what else that's kind of it honestly that's it with the data trees oh explod tree I guess that that's that's a useful one so the F fun one is that you can just use bang bang type type in bang and it just suggest explode tree so of course uh for any data tree you can just use uh explode and then it's going to give you you know the first branch which is in this case a cat second branch which is a dog and so on if you explode the adjusted data tree right here you know the first branch is cat A1 then second Branch dog B2 Third Branch fourth Branch fifth branch and then once you take the five branches then stops complaining right because suddenly you're exploding the whole data tree quite a useful thing um I'll kind of keep it for you to check like like something like this woo we're done we're done with the data tree structures 1 hour 177 minutes uh after some Some Cuts it's going to be closer to an hour for yeah as expected an hour that's fine let's move on move on to the next chapter okay let's do some Physics simulation it's it's going to be better it's going to be faster and F more fun than data trees um there is a builtin plugin add-on I guess uh to grasshopper that can simulate physics made by Daniel P ER it's a pretty powerful tool if we go here and we just find uh that's yeah the kangaroo 2 tab all of that deals with physics simulation and most of the stuff that you do here in kangaroo is done with meshes so we will be working with meeses I will show you just a one single example just to get you start it and also I'll show you where you can download uh example files for those of you who are interested in this this kind of a workflow this kind of a stuff so I guess uh for Architects uh tensile yeah I guess like tens and fabrics are most useful so we'll start with that or we will do that so first of all we need to define the shape of our Fabric and the way I like to work with it so that my uh geometry is quite quite clean is by constructing um patch patchwor from which I will be building up my my tent so I go to the top view and I will just do a quick one I will first draw a skeleton for basically the distribution of my uh shape yeah sure something like that distribution of my shape in in the plan view why not this is going to be a very simple one as well um actually let's make it a little bit more fun let's do something like a herring bone type of a thing uh so that that's my like a skeleton I'll lock it right then from this skeleton I will draw uh 1 2 3 four five six six patches uh more seven8 nine 10 10 patches and what I mean by patches is these rectangular shapes that I use to thicken up the skeleton and I make sure that my patches produce a grid something like that see how they all match up corner to corner they must match up corner to corner for them to work um well okay here we needed to do give me a second ah yeah yeah something like that that's going to work and then here yeah when I'm when I'm talking I I just stopped thinking okay something like that and then here it does this and then it can do that and then finally that's this okay should have made a simpler shape anyway we have this uh these dispatches that build up a form and I'm going to get them in uh grasshopper as curves right click set multiple curves and I'll make them into surfaces uh boundary surface okay as I mentioned kangaro deals with meshes not surfaces so we need to do a little bit of meshing here and what I'll use on this is mesh surface tool mesh surface ew uh boundary surfaces suck uh that doesn't work at all okay we just use surface instead of boundary surface and we just pray that works much better okay never mind don't use boundary surface just use surface uh component just a regular one the black hexagon one and it converts a curve into a surface much better um at least a rectangular curve then for U count and VC count uh I will use the same number so for now I'm just going to use like eight or something like that eight and eight here and that that should be good enough so that's our mesh actually it's not one mesh it's 10 meshes we need them to be joined up into one mesh a way of how I can do it is by using the mesh join tool but the problem with it is that it remembers the seams it remembers where the mesh is joined up and I don't want that I want them to be eliminated um and technically I could do a line vertices uh command that eliminates all of the duplicate points and unify you don't need to do this by the way you uh just look unify mesh uh normals or unify mesh tool that uh makes sure that the mesh is the whole mesh is looking in the correct direction and then then then it's going to work but the tool that does all of this is called combine and clean and that is indeed a kangaroo 2 tool that's available under mesh combine and clean I connected here ew okay uh combining clean does the trick but it we still need to use unify mesh unfortunately for it to actually work because some uh some of these rectangles were drawn clockwise others were drawn counterclockwise so it didn't like it anyway combin and clean and unify mesh now we have a result of a clean mesh that is ready to be simulated I want this to be a tensile structure you know uh like a Anton G's hanging chain models or fry Autos experiments with with tents and well he experimented with so bubbles mostly but it's sure in that in that theme right so I want this to be affected by gravity at first to dip down or up doesn't matter um and I want it to be locked you know in in certain places so that it doesn't fly away okay kangaroo is a Sim simulation based engine uh simulation engine um that deals with physics and under main here you have the main main star of the show called solver this node right here and KR by the way is one of the tools with which I work backwards uh so I first put down the solver and then I um service or I input enough stuff into it so that it works let's look at the stuff that we should input into it first one being I I'll go as I said backwards so bottom up first one being is it on that is going to be a toggle Boolean toggle if it's false it's off if it's true it's on for now I'm going to keep it as false tolerance and threshold we don't touch those We Touch those once we understand grasshopper much better for now we we anticipate that the creator of kangaroo knew what the defaults default values should be reset that's a button every time a simulation finishes and you want it to run again you press the reset button it starts again goal objects what kind of goals should be reached during the simulation all of the goals are available here in kangaroo goals for points or sorry points are here where are they uh okay goals for me goals for lines goals for Collision goals to keep for instance all of the points centrical or co co circular uh goes for angles and goes for six uh degrees of freedom elements that's much more structural uh engineering type kind of thing rigid bodys anyway you will have multiple goals such as gravity uh such as pinning of points down so that they don't move and so on and the goals should come in here as either a single list or a single data tree I prefer if they come in here as a single data tree I will be using an wine to get them in there now let's construct the goals that we need goal number one that will connect to Branch zero is going to be show me the geometry after the simulation has finished and and during the simulation show show goal is located right here under main there's the show option that connects to Branch zero this is immediately going to turn red because yo I don't have anything to show you you haven't connected anything to this the geometry that is going to be shown is going to be the mesh we connected now the solver is happy again it goes okay here we go mesh if I run this I can run this by the way now if I turn this on and hit reset it goes sure easy goal here's the geometry I have fulfilled my goal the simulation has converged if you reset sure here's the geometry I'm showing it to you goal fulfilled easy that's goal number one goal number two apply gravity to the geometry and for that I will hide the original M just so that it's not you know in in the way and now we're only seeing the simulated mesh right apply gravity okay under goal's mesh there should be vertex loads this bad boy right here apply equal vertical vertical is important loads to all vertices or points of the mesh great as asks me for two things mesh and how strong it should be you can see that the strength is set to be minus 0.1 meaning it's going to push downwards if it's positive it's going to push upwards so for now I give it a mesh you know that's the same mesh I connect that to my first branch and it just goes okay I'm running if I reset it goes yeah yeah I'm I'm doing it so what the hell is happening well if I reset it again you can see that at the first frame the geometry is there and then it's not well that's because the geometry is falling and it's falling fast why is it falling well you're applying load to it you know a force to it to fall there's nothing catching it so it just keeps falling so we need to catch it we need to somehow lock it in place that's where the third goal comes in and make sure to stop the solver by the way it's going to crash eventually if you just let it fall to Infinity uh third solver or sorry third goal third goal is anchoring you want to nail down the structure so that or the mesh so that it gets anchored you want to Anchor points of the mesh so I'm going to go for goals uh mesh no that's not going to be mesh sorry goals goals goals goals uh [Music] goal's Point yeah anchors these bad boys right here you want anchor goal asks you to give it points for anchoring H I need to somehow select the points here how do I do that well by drawing more on this so first of all I'll I'll uh internalize data for these curves so that I can just delete them and they're not in the way I'm also going to unlock and delete the spine I don't need that as well but what I do need is I need to somehow grab these points and log them grab these points and log them you know I I want a way of how I can select the points that I lock easiest way to do it as long considering that our patches are flat on the ground is by drawing a closed curve around the points that I want to lock in place I'll draw it uh three more times so that you kind of understand what I'm doing these are regions that I'm drawing that will be um these are regions that I'm drawing that will be used to uh check if a point is inside of a curve or or or a region or if it's outside of the region and the ones that are inside of the region will be selected that's the script that's the idea for the script right so I get these four regions in here as curves Cur curve right click set multiple curves internalize oh actually for now let's just have it set then I need to somehow get all of the points of this mesh deconstruct mesh the construct mesh get the points in here we get a vertices right also uh another way is like uh naked vertices component this one right here naked vertices that also gives you the naked points and it's also part of kangaroo 2 naked points right so you could use this you could use the construct mesh whichever you want in this case maybe um for the sake of teaching you as many tools as possible about grasshopper I'm going to use naked vertices we have our naked points right here we have our curves right here I will ask in curve point in in curve actually is there like in curves multiple yes point in Curves in either one of the curves right multiple poin in curves naked points those are the points so only the perimeter points are naked in this case curves those are the curves gives me a relationship either inside outside or uh coincident so what what I want to ask with the relationship by the way outside is zero right one is coincident meaning on the curve two is inside so I'll ask it is the relationship equal equal to number uh zero and that is going to give me a true or false statements for equality and then I can just simply call pattern use call pattern for the naked points with the equality and then I get everything except what I need so it's going to be inequality there we go flipped logic right and I get my list and those are going to be our anchors you know let me show you again the highlighted ones are now the curves inside of the curves that we get those are our anchors and we connect our anchors as our third goal in this script like so reset run well they sure anchor there's a problem though it's a wavy problem let me stop this the problem is called uh infinitely stretchy material that will be our fourth goal and actually our last goal we need to somehow introduce stiffness to this material or else it just kind of gets affected by gravity and just stretches forever you know being held by these points so I zoom into the antwine I and expand it I have one more input and now I will use uh goals mesh Edge lengths tool so the edges the lines of the mesh will try to keep a certain length I connect the mesh to the input here the length Factor will be set to one so basically the mesh edges will try to keep their original length and the strength of it will be also set to one uh you technically can balance this strengths of different inputs but in this case we whatever and actually for just for the sake of wiring I will disconnect the anchors I'll reconnect them to input 03 and Edge lengths to 02 it doesn't matter just visually the lines don't cross so it's nicer I reset run this voila hanging chain model that's done uh let's hide a bunch of stuff so that it's not in the way um now for this to work as a dome we actually want the vertex lows to be up so I'll I'm going to give it a strength of 0.2 so that's a positive value and now it goes up and you can even see the curvature and the way it behaves you know it's it's all behaving well to a certain degree in a natural way I can't say it's actually very accurate simply because the way we meshed it is not that accurate but it's getting there it's it's close to a uh proper W right let's stop the simulation and let's increase the u and v count from uh 8 to something closer to oh by the way when you change it it's going to freak out don't worry about it edit uh maximum let's go for maximum is 15 and actually let's run the slider to something like 12 reset run you can see that the wall increases is much higher like grows much higher and that is simply due to the fact that it's um it has more lines that can stretch so the vertex loads I would suggest that to decrease in in their power something like 0.1 to to kind of counterbalance the increase in resolution so the output now to only get a mesh because the output now is kind of dirty it it has a lot of of geometries you can see it comes out as separate um a data tree with four sep separate branches what a coincidence we input a data tree with four separate branches question which branch is the one that we need well let me give you a hint it's the first one the show Branch so I will just bang explore the tree one two 3 four four branches and the first item in or first branch is going to be our mesh that we care about hide everything else except the mesh actually custom preview the mesh might look nice keep it pink looks great look at it beautiful what a beautiful little mesh we've got there so this is uh if it was upside down it was tension only based structure a structure that is purely tension based since it's upside down it's compression only based structure so suddenly Philip blocks block research group all of that stuff that that you see that is you know walls that don't need any mortar to hold themselves up this is one of them you can construct this with correct tiling of course and tessellation I mean of course but you can construct it um without any glue without any mortar just by stacking bricks together because this is compression only based structure very nice so that's kangru that's simulation in kangru clearly you can do a lot of things actually this is going to be the first time that I show you uh oh yeah internalize internalize bam this is going to be the first time that I show you an actual website um if you just Google kangaroo example files uh here under GitHub Daniel perer kangaroo examples you will find find and they're 7 years old but that's fine you'll find all of the different examples for different uh definitions in kanguru some of them will require you to download plugins but the next chapter is going to be about plugins so don't worry but for example uh tensil structures right that's what we were learning right now uh or actually Tel structures I guess is not that interesting anymore uh let's go for folding folding origami origami 2 I assume two is better than one uh click on that and here on the right hand side you'll find download raw file click on that that downloads origami 2 uh the grass oper file uh then in the folder come on come on give me give me in the folder uh your download folder you'll find it and what you can do is you can just drag and drop it in bam and this gives you a full kind of example of the origami structure where is it who knows no one knows uh probably need to reset yes click the reset button uh the solver the explanation or lag thereof I guess but but the script is there and then if I run the folding simulation it falls a beautiful Flappy origami thing right so it's there's plenty of these examples if you want to learn further go through the examples try to understand you know the planner eyes the show the famous show deconstruct mesh get the vertices make them anchors or in this case plastic anchors and so on right I I'm not going to go in depth here um but that that's how you work with with example files for kangaro 2 okay okay next chapter plugins let's go okay so now we are done with the base grasshopper course or the base tutorials uh training for you know the vanilla grasshopper one thing that I mentioned at the start of this course was that grasshopper actually is the strength of it is all of the add-ons that are created by the community by the developers and so on that can be added into grasshopper and you can see you know that uh I I'll remind you that here I have more tabs than what you see on your screens right they have the human honeybee dragonfly vray animon horster and so on Sandbox all of these tabs they add in additional functionality for example ladybug adds in the possibility of calculating solar exposure right for your models they add additional functionality through additional nodes so once you get a hang of grasshopper in itself then you start looking into okay what kind of extended functionality can we get and the first thing that you need to know I guess is how do you get these add-ons where do you find them how do you install them two ways I'll show you both right now way number one and we will use it to actually install a thing um I guess I can close it for now here in the command line I can type in package manager package manager and this package manager basically contains all of the more official I guess add-ons that you can download uh directly through Rhino right all of these ones and of course I will not be going through them because that would be another 10 hours or so of a video instead I will show you one in the package manager that I find to be very important and very very useful if you search for weaver bird Weaver as in weave bird as in the floppy thing that sometimes you see in the sky weaver bird select it and here you just hit install I already have it installed so I don't want to do that but here you hit install once it's done you hit okay and I think it's going to ask you to restart Rhino as well it should at least so what you should do is you should save your grasshopper file save your rhino file restart it and and then Vier bird will be not just installed but also loaded in grasshopper plugins load in during the actual loading of rhino right they load in together with Rhino so you need to restart Rhino for them to work so once you have that uh that done and then you go back to grasshopper enter then what you will see is this WB tab right here verbert tab which means that the grasshopper plug-in for ver bird has been installed I will cover this in just a second because this enables you to do a lot of really nice things with um with meshes but for now you know we're about all about installing the plugin so um I'm I'm going to skip over it it's going to be in the future chapter so that's installing through the package manager very straightforward a little bit trickier thing but still in my opin and once you get the sense of it it's it's quite easy is going to food for rhino.com www.f food number4 rhino.com let's let me do this for you why do I have Rhino 7 not open close that um so does a weird thing oh come on no no there we go I will just I'll put it here as a note for you so that you don't forget foto.com that's where the uh add-ons live I think including VD as well but uh it's a little bit trickier to install so if you can get it through the package manager you get it through the package manager if you can't you go to foo.com and you search for what you need so for example actually let's install all the plugins that I will be show showing you and we start with a plugin called Anon a NE animon hit search oh apologies I forgot you actually need to create an account with them very simple email password sends you probably sends you a conf information email accept that you've got yourself an account log in you're good to go uh food for Rhino does not spam you does not sell you uh send you any marketing emails so it's fine to use whatever email you have anyway once you have uh logged in and then you search for animon you can uh just find it here animon click on it and this is like a website or not a page page for this particular plugin it explains how it works it explains if you click on more you know what kind of components it has which components were released when and blah blah blah if you scroll down then here also you can see all of the complaints you know in the comments because people only write comments when they have something to complain about or if they have a question to be honest but uh here uh under downloads you can find a bunch of different versions for animon so rule of them for any plug-in that you download load is bigger number bigger version number equals better plug-in so here uh you can see that at the top we have the oldest version oops at the top we have the oldest version we have uh newer well older newer and the newest 0.4 right that's the one that we download iton 0.4 hit the download bam you just get this GHA file right in this case it's uh single file that's fine that's the really doesn't matter if it's one or 50 files but you get this GHA file GHA is grass oper assembly it's basically a bunch of nodes if I right click on this file if you're in Windows if you're in on a Mac it doesn't matter but if you're on Windows if you right click this file you go to properties make sure that under security this file came from another computer and might be blocked to help protect this computer you unblock it you trust this file or else it's it will not work properly in grasshopper hit apply hit okay you have your animon uh plug-in downloaded for now just keep it in the downloads folder that's fine right let's get some more let's get uh bow bird bow bird bow or bird um search for that there's only one suggestion get that one in here oh this one comes with pictures so you can even see what it does uh B bird plugin is used to uh create um waffle structures for laser cutting for me it's uh such a nice tool I mean I I use it all the time when I need to prepare something for laser cutting so that's why I'm going to be showing it to you only one version but you can see there is like a uh for Rhino 8 for Rhino 7 for Rhino 6 so in this case we're using Rhino 8 I'll hit click on install it uh and this is like different right it's it's not the same as what we saw in u the previous one where we had to download it this is actually install which you know open Rhino 8 sure wait for it there we go and since it is available to us whilea the package manager it instead of downloading it it just opens up the package manager for us so I can select it hit install you know the drill we already did this with weer bird seems like birds are available via the package manager so you install it this way right you don't need to download it then the last one uh that I'm going to show you is called cocon we go back in here search cocon uh I think it's one C uh c o c n no uh double c c o c c o n oh come on Co Okay Google grasshopper seriously one second it used to be very uh very very available okay I guess here um I am going to also put this in because it seems like it's a little bit of a trickier way of how to find it it's not available over fut forino which is weird it should be but even with that that that's fine um let me go back in here scribble and just by simply copying this link you should be able to get cocon okay the logic is exactly the same you uh scroll scroll scroll you find an file you hit download downloads a zip file for you let's let's look at it so if a zip file is downloaded both in mac and in Rhino you need to unzip it if you don't unzip it it will not work right click extract extract here that's fine right gives you a folder now we can delete the zip file we don't need it anymore gives you a folder we look inside one GHA file and four just grass oper definitions if you see the blue files the blue files the blue icons are example files if you see a green icon that's the plug-in file right click on the plugin file don't forget go to properties oh and this one is not blocked so we're good right sometimes grasshopper plugins come with dlll files as well dll files should also be like they are also part of the plugin and should be copied together with the plugin either way now I'm going to uh take this green file and I'm just going to crl X cut or contrl C doesn't matter contrl V it into the downloads folder so that I have my animon and uh cocon files both or plug-in files both in the same folder just easier for me to see what the hell am I doing right which ones am I going to be copying and now the installation part you need to take these two guys you go to your grasshopper uh window you go to file go to file special folders components folder come on special folders components folder which will open up a special kind of folder in your on on your hard disk which for some reason hello I misclicked yes I misclicked which in your case is most likely going to be either empty or will only have like a bb bird uh plugin you know data here these are all of the plugins that I use that I have or add-ons that I have and then what you do is you just take your download downloaded files the anim1 GHA cun GHA and drag and drag and drop them over to the libraries folder right I will not do that because I already well actually I could it just asks me to replace them right and I just instead of replacing I'll just click skip but anyway once once you have them in your grasshopper libraries folder or in other words file special for components folder you restart grasshopper restart Rhino and then they will be here you will see VB bird you will see bow bird you will see anona and you will see cocoon which is not which does not have its own little tab it's actually under mesh there's this cocoon subtab here and I think that is that's honestly it don't forget to unblock things right click properties unblock if something doesn't work um you can't unblock multiple files at once so if you have multiple files you need to unblock them one by one you use package manager you use food for Io and sometimes in case of cocon you use just a random website you know uh that that you found on the internet to download a shady plugin from it okay that's it with installation now let's actually look at them so the first plugin that I or add-on that I want to start with is cocon because it's itching itching for me remember when we did that kind of a weird field structure where was it hello Fields Fields Fields data trees Fields there we go Fields remove duplicate lines this one when we add this this one right here I I really really want to make a three-dimensional shape of it so that it can be 3D printed that's what we're going to do so uh for this to work I will need to use cocon the the way cocon works is it takes a selection of points or lines along um I I'll get there give me a second I'll get there it takes a selection of point point or lines in a 3D space and it wraps it around with a mesh by creating this kind of almost a field uh effect around it it it's a wrapping algorithm so technically with cocon you can have any kind of a messy data as long as it has points and you can create a three-dimensional object from it it's much easier to say uh to show than to than to say so in this case uh what we can do is we can create a H metabol charge from a group of curves or rather let me show you first a simple example uh then we will do the nice one so simple example would be point point two points reference them in right easy peasy in cocon give it a point charge like that so we use Point charge tool in cocon give them a radius um well I'm looking at the grid uh five 10 15 20 30 around 30 in radius and give them a charge strength of one I tend to always give it one so now we have this point charge component for marching cubes algorithm don't worry about the algorithm actually I love the marching cues algorithm I have a whole thing on my on the YouTube channel about it but what whatever we have our Point charge component then what we can do is we can click on or we can use cocon W geometry with marging cubes bam and we connect the point charge component as our charges just like this right and then what we need to specify is a number between 0o and one preferably between 0.2 and 0. uh 9 something like that uh for the iso valume and I will show you what that means if I create a slider oops that is not a slider if I create a slider and I just use 0.5 oh yeah and the cell size uh that we need to define the resolution beforehand I'm sorry uh the cell size it's basically how accurate is the calculation so for now what's the radius 30 I'll say the cell size is like one that should be fine and then execute toggle true bam we get these two meeses right once we set it to True uh seems like the meshes the resolution of the meshes is a little bit too dense so I'm going to reduce it to cell size of two so larger cell size means the the the voxel grest is larger and the interpolation of the mesh is less dense so that's the radius 30 and the ISO value is 0.5 which means that currently if I were to look at it this should be let's just grab this point move it to uh M enter zero enter come on there we go oh no it already shows what it does no disconnect later I'll show you later but uh with radius of 30 and ISO value of 0.5 it should be around 15 it's really not is it no it won't be 15 I'm I'm being stupid no no because the iso value is actually for the voxels so it's uh it's a little bit different but either way if it's one it shrinks to zero if it's zero it shrinks to infinity or it grows to Infinity so as I said it needs to be somewhere between um 0.2 and 0.8 0.5 is a good place to start and then you kind shrink it accordingly and I already showed you this but if you move the points together since they are creating a Field Effect you know they they make this kind of nice peanut looking shape the topology is atrocious but then for this mesh you can use quadri mesh for example and I'm not even going to give it any more settings and the quad remage gives you a pretty decent result you know as the output it's pretty heavy though so keep that in mind okay so that's that's the most basic way of how you can use it it's basically for merging of like different geometries into one shape and you can see um you always get an offset uh of those geometries kind of for free or even if you don't want to internalize data there now let's do the same thing for these lines right all of these lines so cocon again I will use curve charge for this or sorry uh curve charge actually is the same thing as Point charge right except for lines so I'm not going to use that I'm going to try using curve group charge I never used it before so that first time let's try curve group charge connect the curves into here maybe less 8,000 nah it's going to be fine right 8,000 let's go didn't crash give it a radius uh the radius should be I'm going to give it like a 10 or 11 11 for the radius and charge strengths I will just say everything has equal charge strength of one like that we have 8,000 curv charges then I run the cocon algorithm with this with the iso value of 0.5 the cell size uh that this is important if I choose too small of a number it's just going to crash so for now I'm going to use a number that is just barely smaller than the radius so the radius is 11 I'm going to say the cell size is like 10 okay uh now we save we save our files and we toggle execute this is going to be heavy that and toggle true and then we pray that this does not uh crash because it's a lot so what it's doing it's basically taking all of these elements what this is calculating I can kind of explain it I have time to explain it it's taking all of those elements all of those lines and the points in the lines and so on and it's basically generating a mesh from it and um it's using a marching cubes algorithm to do so so basically there are 13 different variations 13 different ways of maybe this is better of how a polygon could be added into any kind of a Vox ized space and is just choosing the correct ones to wrap a geometry around with new polygons and that's why the topology looks the way it does you can clearly see the divisions right the way it's divided up into X YZ grid that's because it needs that XYZ grid to actually choose what kind of polygon should be added right so going back here 18 seconds not too bad the resolution is horrible absolutely horrible but we're getting somewhere right we're getting to somewhere so for now I'm going to uh stop the calculation that was 18 seconds so if I drop this by half and I drop this by half that means it's going to be around 2 minutes to calculate so I'm going to do that and then we will continue uh we will continue from there so give me give me a second okay there we go I have noticed that point charges work much faster than curves for this particular geometry or for you know this this kind of a set of curves so instead of using a group curve charge or whatever it's called mesh cocon curve group charge instead of using that I just simply use Point charge uh so the way I do this is I have all of these lines I divide them up into points 10 points per for each line I actually divide by distance would be by length would be better but in this case whatever I get my uh that the count of points is 10 so there's 10 points on each line and I basically just say oh just wrap each point around with a you know isosphere and these are the values that I use radius of five ISO value of almost 0.5 a little bit lower and the cell size of four just slightly below the the radius you always want to be with your cell size you always want to be smaller than the radius but not by too much or else um it's going to get really heavy really fast right and the output that I get is let's see a custom preview it's this don't be scared by the way it looks like that let's actually bake it out so that I can show you uh other comments okay uh sometimes it's going to tell you by the way baking is only possible when no other comments are running and that means that in Rhino you are running some sort of a command command so just hit escape and Rhino and then baking will indeed work if I move this here over here oh there's more than one mesh that's being created that's fine we can um only get the big boy and from here I will just go for Arctic View and just look at it and it's all bumpy or all lumpy and so on but finally we're creating some sort of a structure that can be 3D printed clearly there are multiple ways of how to do this you know multipipe clean up the curves more have more control over it this is just one of them and just by itself cocoon is not that great you know it's not aesthetically pleasing but once you add in viewer bird into the mix the next plugin that I'm going to show you add-on that I'm going to show you then it's starts becoming real cool real fast so let's automate before we move on to Vier bird let's automate the the the the getting only the largest mesh from here right because if I were to check right now the list we're getting multiple meshes and only one has a decent number of faces everything else is just kind of garbage right so how do how do we get rid of garbage well we say deconstruct mesh or actually is there a faster way I know I know I'll show you that in the vi bird plugin because that's going to be quite nice in the Vier bird plugin so next chapter right chapter whatever 25 I don't know uh Vib bird Vier bird is used to manipulate meshes and to subdivide them to extract like material from not Material like uh sub objects from them such as curves lines uh sorry edges vertices faces or po polylines around faces it's used to smooth uh the meshes it's used to offset the meshes to give them thickness so with view viewer bird you can do all sorts of stuff also it has this picture frame that I'll show you as as well um very very powerful uh plugin very powerful tool that I use quite a bit especially for smoothing of things so here I have my lump of whatever weird weird lump of things here I have my mesh I want to extract the biggest one I need to check which one is the biggest one in VB bird I can go to extract and I can say well give me all of the vertices VI Birds vertices component give me those bam oh that's such a big one uh okay actually uh I'm used to it looking like this uh draw icons draw full names I'm used to looking like this so when I see it like that it's just wow okay but either way I plug that in and it gives me all of the points for all them every mesh right and clearly you know about the data structures if I look at the param viewer nope Prime viewer you know for every mesh it creates a separate data Branch right and it puts the points in that data Branch lists of lists right so I want to know which branch is the biggest one I will use list length tool list length basically I just get the points and I measure how many of them are in each of the link lists and I get numbers for them right I want the big one I want the big one uh to to get it somehow uh out of all of these right now the numbers don't see each other so they can't be compared to each other so I need to push this into one list right click s uh flatten now they are in one list and I can use a tool that I haven't shown you before but now I am showing it to you which is called sort s o r t sort list keys to sort are the numbers you know what what is it that you want to sort the numbers and as I sort the list now I get the smallest number in the top and the largest number in the bottom okay so what I need to somehow get the mesh not the number in this list because fetching it is qu quite easy right list item minus one index but uh how how do I uh how do I now get the meshes from these numbers well see this values a input optional list of values to sort synchronously so if I have a list of meses and a corresponding list of amount of vertices that they have if I sort the number number of vertices you know into into the new list from the smallest number to the highest I can together with it sort the meshes that the vertices came from right uh in tandem so like that measures going here and they get sorted the same way as how the numbers get sorted so now I get the biggest mesh at the bottom of the list and the smallest mesh at the top of the list kind of yucky to get the bottom uh mesh from the list I could use list item index minus one but that you know that requires me to write this panel and I'm lazy I don't want to I want the index to be zero I want the biggest mesh to be in the top of the list because then fetching it is much nicer so what do I do well I right click on values a and I choose reverse it just reverses the order of the list once I reverse it now the biggest mesh is in the top of the list I use list item to fetch it and now I have myself only the biggest mesh with all of the trash removed okay let's uh actually disconnect the custom preview it's a little bit in the way what now what now oh by the way this is like I I need to be very pedagogical about this this is oops oops oops this is cocon bear with me cocon add to group change that to some cocoon color that's going to be the that's going to be the cocon color and this is going to be Vier bird okay so now as I have this large mesh I don't need the curves anymore as I have this large mesh I want to do some operations with it I want it to be a little bit nicer because right now it's a little bit y okay first thing that I want to do is I want to get rid of those bumps as much as possible right I want it to be less bumpy the way you do it is by using smooth mesh smooth mesh tool there is this smooth mesh here also Vib bird has v Bird's uh laian smoothing tool here both are kind of kind of similar so I'm going to show both of them if I connect uh my list item to the laan smoing like so and I give it a level of sub subdivisions I increase the level of subdivisions to two actually I I shouldn't right oh give me a second smooth is fixed that's fine or smooth thin the final one shot thinning with the original mesh I don't like that uh it does not give me a lot of uh control over how much it's uh being smoothed that one as well blur mesh fine V bird smoothing is not that great let's use smooth mesh apologies for jumping around but let's use smooth mesh if you do not uh if you cannot find where smooth mesh is then check mesh utilities smoo mesh if you still cannot find it then it might be a part of um let's try foot foro mesh edit uh pum doesn't seem like it's part of mesh edit puffer fish could it be puffer fish pufferfish by the way is another really good plugin uh re really nice for mesh man ation so you can check that that one out as well um but that I will not be giving you a tutorial on that because it's just way too that's way too much uh way way too long but uh sorry for not stopping the recording I just want to keep keep going here uh just give me one quick second to take a look uh doesn't seem like it's part of the puffer fish as well okay so I I will just boldly assume that mesh smooth mesh is part of the just general grasshopper uh tool right uh help nothing there okay so I just connect my mesh into the mesh smooth right already is doing a little bit of the reduction of bumps I will give it uh some more iterations for smoothing so it it only goes one one now I will give it like five iterations to smoth you know the big bump is staying but everything else is being removed maybe a bit more like eight iterations and also I could limit the amount of u i can limit how how many uh I'm going to get there how many how many uh how much the points can move maximum during the smoothing process but in this case I'm not going to do that this seems to be a little bit nicer let's look at the smooth version of it seems to be a bit nicer the problem that we now have is that this is quite um low resolution still so what you want to do is you want to subdivide it remember subd geometry subdivision you take a cube and when you subdivide it infinite amount of times it becomes uh it becomes uh sphere uh same thing here the tool that or not the tool the approach that subd uses is actually also present in viewer bird but viewer bird retains the mesh right so under subd here you see all of the different ways of how you can subdivide geometry I'll show you only one which is Catal Clark subdivision the most typical one catl Clark asks you for three things I will first show you catl Clark on a separate uh piece of geometry just so that you can see better I'll just go to mesh tools bam uh mesh creation I'll just create a single mesh face first of all something like that simple mesh phas easy mesh right click set one mesh get that one in there and you can see that now after smoothing or sorry after subdivision this single mesh face becomes four mesh faces the way it works it takes the uh middle point of the edge takes the middle point of the edge divides it like so takes middle point of the edge takes middle point of the edge divides it like so that's level one level two is it takes the those four polygons that we had and um from level one and it subdivides them further level three subdivides it further we end up with an ellipsoid right so this is how it works and notice how it's always smoothing during the subdivision I will not get too deep into that particular algorithm but it's basically averaging out the position of the vertices if I were to change the look of the mesh to something like this hide that now we can clearly see let's jump back to level one right level zero is this this is still a quad right and then it divides it up into four quads that are very distorted still level two divides it further into uh 16 quads and level three 16 * 4 64 quads right and now you you get your potato chip looking thing right so that's Catal Clark subdivision for a triangle it works a similar way uh set one mesh a triangle becomes three quads let me flip this a triangle becomes three quads those three quads become 12 quads yeah and those 12 quads become 408 quads right level four will not work uh or level five for that matter will not work it uh there's a limit a hard limit to how much you can subdivide that's imposed just so that you don't destroy your computer right so let me actually uh show selected let me get both of them in here uh set multiple meshes internalize data delete okay that's Catal Clark in a nutshell so here we will use the same thing um because Cal Clark as it subdevice it gives you more resolution it also smoothes things further so we will use that uh this is going to be a little bit r with the thin thinness of things but most of it should be uh quite nice so let's look into here in particular right Catal Clark subdivision I'll connect that to my custom preview for now I will give it level 0 dot do0 dot dot uh three so in between Z and three for now level is zero and for the mesh I just connect the mesh here right so right now this is not doing anything why is this orange subd level oh yeah that because this is zero it's not doing anything because level is zero if I change this to level one every triangle becomes 1 2 3 quads right 1 two 3 quads 1 2 3 quads so we we get this kind of a nice pattern here and this becomes a little bit smoother a little bit nicer before after before after level two even smoother even nicer of course there's a limit to how much you can smooth it but uh for now we will keep it at level two because level three is too scary level three will uh I think even now it's like above a million yeah 1.6 million polygon so level three will betimes four so so above 5 million polygons anyway that's our shape right now uh let's look at it uh in rhino forget about quad remeshing by the way this kind of a shape um that's too much now you get uh there are some spiky boys here and there uh that didn't manage to connect simply because the the radius was too much uh too too little sorry the radius the point charge uh radius was too little so they didn't manage to make a connection you know in some cases but in most cases it's kind of a nice structure right you could do some Shenanigans with u let me hide this you could do some Shenanigans with um come on clipping plane mesh reduce and then subdivide it further and so on and play that game but in in this case uh we we we stop because uh I'm tired that's mostly why but you can see that this uh sections quite nicely and if it sections nicely that means it 3D prints nicely if it 3D prints nicely that means it can be manufactured and it can be scaled uh scaled up to a larger uh larger thing right so when you think about the scale of this I I tend to think about this as a you know human is here right and it's some sort of a weird looking ass Pavilion for I know bats or something anyway uh this is just an experimentation of course you add the reasoning and you add the logic to the things that you do and the why you do it um either beforehand or on the way as as you're working um read up on the thinking handen method uh very very useful thing to kind of have in the back of your heads um because there are two ways of how to do do things anyway but not a theory course we stop with a theory just training training course so this is how you mesh things and this is how um the most useful things about the viewer bird plug-in um I want to show you a few more things with Vier bird so for now I'm just going to group this up that's our Vier bird and then I am going to just go through this real quick uh delete that actually go back to shaded okay uh let me just quickly my my favorite you know curve different curve make this bulge out a bit more drop it in here Loft surface reference in the surface so any surface honestly I set multiple or set one this is just one surface um internalize and delete it okay we have our surface here then I will use mesh uh mesh surface tool to just divide it up 10 by 10 easy we get we get some sort of a mesh right um it's a little bit yucky the way it looks but it is what it is it should should be fine then under transform a few things that are quite quite useful here are uh viewer birs mesh window and viewer Birds picture frame these two NOS right here picture frame mesh window so I guess uh the first thing is the picture frame that we use we give it a mesh bam and it gives us the the the framing automatically and you can see that uh it's it doesn't act as an offset it acts actually as a scale so that that's a little bit U rough but if I think if I change the inser type instead of percent to parallelogram so you can see Zero it set to zero here but the parallelogram it needs to be set to one so I can right click parallelogram then it's much more more of an offset right and then suddenly the distance that I use of five uh let's try. 25 that's too too too little 1.5 there we go so so now it it actually acts as an offset uh tends to die much often or break much much often so sometimes you do need to actually use the the the the actual uh whatam call it percent rather than par par parallelogram then we have our mesh polar lines for the mesh window bam distance I'll use the same distance 2.8 insert type right click as well parallelogram these need to match up right then suddenly we have our frames we have our Windows right and for our frames I can thicken them up by either using mesh offset or I can use here uh V Birds mesh thck connect the mesh here give it a distance of I don't know actually this is pretty decent but what is it uh five okay so 2.5 as well you can see that it insets inwards that's fine if you give it a negative number is going to offset outwards like that uh then offset type or actually I do want it to offset outwards so I will uh negative I'll use a negative for the distance like that and now it goes outwards offset type uh distance on diagonals I think that's that's the most reasonable one for for this particular application if you don't like the type you just play around with the these three to get the ones that you you know find what you want okay other two don't even work so we use this so now this is thickened up right and I can just uh use this to and convert it into a nervous polysurface if I want to or I can work with it as a mesh continue working with it as a mesh um if I were to Big it big this out you will see that the the shading is weird right it's like there's no sharp edges and that's because it does not Rhino does not understand how to shade this if you want flat shading on this kind of a geometry what you need to do is you need to use unweld unweld mesh tool and you need to give it an angle of I I always do degrees of something less than I would say like 30° 30 I think that's going to do it yeah you can see now now it un welds all of these edges while these stay welded so if you want these to also not be smooth then your angle I guess should be just zero right or 360 I I never remember let's see Zero yeah zero works then it just makes everything sharp and welds everything right so you get your frame and then of course you also have your your windows you know that are currently without any thickness you would need to add thickness to them for them to work but that's that's how you work with uh the thickening the picture frame of the mesh uh so that's a useful one internalized already that's good then we have whatever don't need different types of subdivision use Catal Clark um for for now don't use smooth uh not enough control much better to use smooth mesh gives you more inputs you can extract the outer boundaries pH polar lines is literally as the same thing as boundary uh where is it phas face boundaries phe boundaries tool let's drag it in here face boundaries tool as well as uh face polar lines tool are exactly the same thing then we have mesh edges so it gives you all of the edges in one uh output rather than separating it into naked and uh interior edges then we have um The Naked boundary so you can get the only the naked edges here and vertices component that we already used to check uh which of the meshes is the biggest one gets you all of the points of the mesh oh I guess the Dual graph is kind of cool so the way it works is do we have anything that that would be nice to show one second so for example I'm I'm just going to show you a quick quick little example quick little example here come on give me give me give me uh sphere another [Music] sphere and the third sphere like that Boolean Union Boolean difference or actually this one as well can be Boolean Union why not Boolean Union so we have these three spheres we go get them in here as a b and then I will create a mesh that I don't want it to be a quad mesh I want it to be a triangular mesh because dual graph shows up better in a as in a mes that's made out of triangles so I'm going to you use try remesh try remesh tool it's like quad remesh only for triangles I get a sphere in here or spheres in here and I just remes them into this this triangular mesh easy peasy I will not even go through any of these settings because this just works but ju just so that you kind of understand properly um you can keep the sharpness of the intersections you can um Define the length of the desired length of the triangles so for example if I say well actually the triangle length should be 100 then it's going to give me a much lower resolution if it's 50 it's better 20 even better right and then iteration so how many times should it run this to get to the end result so the more iteration the more accurate it gets and I get that triangulation I do get the dual graph just like this one for free with try remes but let's just ignore it and let's just say we don't have it it's just a triangular mesh that we have uh then what I can do for the triangulation I can just connect the mesh into it right and then for every triangle uh let me show it to you this way I think this will be the best like that and then that and this goes kind of white uh hopefully you can kind of see it unfortunately that they all intersect quite heavily but notice that for every triangle that we have a center point is very important so what it does I can draw I can draw one triangle two triangles three triangles four five triangles six triangles seven okay good enough right I have I have this um as an input and then what dual mesh does it takes the center points one triangle two 3 four five six one here for some reason and then it connects them right and then it will just keep keep going out there so we end up with uh pentagons or hexagons depending on the topology of of the mesh right that's that's the um purpose of dual graph is that that's what it does so if you're tired of triangles and quads use dual graph and then you're going to get hexagons heptagons pentagons and so on um unfortunately the Dual graph never gives you a mesh it always gives you curves so then you need to somehow make geometry out of them and these curves are they are indeed polar lines right they are closed polar line curves but they're not necessarily flat and uh since they are not necessarily flat it becomes quite tricky of how to actually make them into a mesh and like there are different ways one way is to use viir mesh from lines tool right here which asks you to give it lines these are polar lines these it asks you for Lines line uh lines polar lines lines poly lines not good you want the polar lines to be exploded into separate line segments of course when you have so many polar lines and you explode them you create a data tree right all of them are pushed into a separate data tree and then you connect those segments into lines shit's the bad immediately uh Edge count is too low vber was unable to produce a valid result because of this really what the hell just give me a second [Music] I I'm checking the how you know the smallest uh value in the in the list so basically well that's that's five curves what do you mean that's not enough it's being stupid okay so this is not working that's fine I will not then uh teach you the tool that is not working instead I will show you a different way so here here we have our vertices after we explore them right and what I'm going to do is I will just average the vertices to get the Middle Point here and I will merge remember uh the average of the C coordinates of a point cloud is the middle point of said Point Cloud I'll connect the vertices and the AR arithmetic mean so the middle point of each of the hexagons you can see I have those now I'll connect those uh I'll check yeah seems that the data tree is not not uh freaking out and then I'll use Theon imish Theon IM Theon imish something like that and it kind of does it quite well for the plane I could use uh plane fit plane fit Tool uh to to try and fit a plane through those points and then use that this might help for the loan image to create a m right and then I can I can I can I can H but just literally just creates a triangulation again so that kind of sucks unfortunate okay uh but anyway that that's how you can close it off and then you have a bunch of separate mesh entities insert oh there's some invalid objects that's fine uh B in valid objects and stop asking it's crashing there we go uh I get these in here and these are like separate hexagons that are mesh hexagons so that works uh that works quite well uh you would need to clean them up and so on but uh combin and clean should do the trick okay so that's how you create a mesh from it right a proper proper mesh paneling from it then in terms of creating a nervs polysurface or anything like that it's basically you would just need to um draw a set of triangles from the Middle Point to each Edge right and then join them up into separate BS that's the same procedure um you could planarize it but that that would make it a little bit not nasty I can show you planarization actually that that's I think that's pretty cool uh we take all of this what we have so far uh actually we don't need the average or the merge we need to fit the plane through the vertices though so uh let me hide that so we have our vertices our points for each of the hexagons and we fit a plane through them and the planes are just kind of floating about don't worry about it but uh they are fit fitted right we have our planes so what we do is then we take those vertices and we project Point uh that's on the geometry no project plane project an object onto a plane great we take these uh vertices and we project them onto the their average plane we get the geometry we create a poly line we make sure that it's closed toggle yes we have our polar lines and then we do boundary or actually surface will that work yeah just surface works and now we have our surfaces here that are all flat of course you have to sacrifice things to flatten things right suddenly uh they don't match up you know that the seams don't match up but that's actually how it is in the real world as well you know you you have your a mounting seam or whatever it's called that eats up the error you know for in this case for planarization or for for the curvature uh so that's a simple planner rizing algorithm the real ones are a little bit trickier and a little bit smarter than that so that's another one uh third one is my favorite multipipe bam that's it Note size uh let's increase it uh what is it right now 0.5 two multipipe nice isn't it uh once once you get the sense of how you operate with Grasshopper you can do pretty cool like 3D print looks like a weird doesn't matter uh you get sorry for some reason I lost track of what I was thinking uh you get multiple directions of how you can manufacture things how we can make things and how we can design things right uh you just need to understand the tools and the principles of how those tools are used and in which cases which tool should be used and that comes with uh just time U expertise comes with time of course internalize data group all of that up change the color for white for example all good that's viewer bird in a nutshell we are done with Vier bird group that one up color white as well okay a few more left to show and then we will be done so next chapter next chapter I still have two things to teach you animon and then bow bird okay let's begin with animon it's a loop type type of an add-on a loop meaning something that repeats itself grasshopper by itself is very linear in how it works there are of course Loops coded into these uh these nodes that are used from time to time but most of the workf flow is from left to right and the data that flows from left to right never repeats or never goes back uh never feeds back into the left you know gets changed and goes back into the right again right so you never produce a loop for stuff like growth for example stuff that is growing and building upon the previous iteration for anything that is iterative you need Loops so that is where animon comes in I guess this seems like a nice nice spot for it basically if I uh where where are you an hello I just saw it there it is basically out of all of these nodes that animon has you really kind of care about just two Loop start Loop end and I'll explain what they do in right now actually Loop start Loop end right and we look at these noes just through the their inputs and their outputs we learn about these noes from that so first of all uh what's the amount of repetitions that you want the loop to to do how many times do you want the data to kind of get looped spin in between these two nodes well I can just give it a number for now we can do an arbitrary number of three three repetitions a trigger which is basically a button you know uh you have a looped iterative system and you grow it or whatever you know it does its thing and then you want to do it again you need to reset it that's the button the but the button triggers it and lastly what's the data that you want to Loop so I can just do cat no let's not do a cat let's do a number number five and connect that as my data now I have three outputs from the loop start this one just simply says connect this to Loop end this one says connect this to Loop start if I have remember yep there we go so we just connect them this is basically a feedback loop or feedback line for you know data from here to be connected back into Data here when the loop I'm moving my mouse Circle in a circular fashion by the way I'm not sure if it's being picked up by the recording basically when the data moves then here we have counters count counter this basically tells us at which which uh repetition are we currently at panel the repetition currently is null it is what it is it's null because the loop is not running so it you know it since nothing is happening it does not have anything to show you in the counter once the loop actually begins then it will show you and actually you can make the loop begin very easily data we just can connect it straight to data like so hit the restart button and now you can see it really quickly jumped from zero to three uh keep an eye on the panel 1 two 3 restart 1 2 3 restart see that the number jumps right it just counts up to three I can increase this to 500 so that you can see better right it's looping the information 500 times now back to three oh one of the important things is even though I connect three here since it already did the 460 Loops those stay so if you want to stay with three Loops you need to reset it question what kind of data is being looped well number five so the way it works is basically five goes through here uh let's talk about repetition zero right first repetition five goes through here exits here this is still five connects to here and that's it repetition zero is done repetition one means five goes through here connects to here then Loops back into Loop start goes through here back to here back to Loop pend right that's repetition one repetition two same thing only two times and so on right you get the idea how is this useful well 5 + 1 you know first it's five at repetition zero + 1 is six goes to Loop end Loops back then uh once it's looped back now it's not five anymore it's six goes to here now it's seven Loops back now it's seven here goes to here now it's eight after Edition Loops back and so on right soop you can add keep adding things to a number for example a very very simple example but an example nonetheless so this is the most basic uh way of how you can construct a loop you know just just add the number let's construct something a little bit more um a little bit more tricky it's going to be a little bit of a harder definition but I think uh we will manage so let's do L system growth meaning a branching type of a branching type of a behavior and for that I kind of want to let's do a threedimensional one might as well right why not so let's draw ourselves uh in the top view a y shape something like this then let's make planner surface out of it make it into a planner Sur surface and extrude that shapee up give it thickness now control shift select the end the ends of the shape all three of them holding control shift or command shift if you are a Mac User extract surface we have successfully extracted three surface from this poly surface right now we need to um GA those in so first of all b a a single B set one B for the shape then Surface three surfaces that you have extracted so right click set multiple surfaces and choose the one that is like a you know you have like two branches and one uh trunk so the the one that is the trunk should be the first one and the branches are that doesn't matter which which one is the second one but the trunk needs to be the first one that you select and then you select the other two enter now you have your surfaces and you have your B rep great let's uh internalize data internalize data delete these guys and let's work with them so for now surfaces ignore them you don't need them let's make make this into a lightweight shape so for this B I'm just going to cap it I'm going to make it solid so cap holes and I'm also going to mesh it because meshes are much faster and that's it now it's ready then for these surfaces that I have I want these surfaces to be planes because what we're going to do is we're going to take this shape by its or origin point which is here this this area right here this surface right here and we're going to move it and rotate it onto these two branches in doing so we will be creating two more Aggregates right and so on it's it's going to keep growing so for that we will use Orient uh Orient plane or Orient object I don't remember it's enter transform morph nope transform ukian Orient this this one right here right um asks us for geometry which we would like to orient that's going to be our mesh as asks us for the source plane and the target plane okay we have our uh three surfaces here we need to make them into planes is planner test whether a surface is planner this node right here gives you the planes of the surfaces and then using List It I can separate them into 1 2 3 source is the first one target is the second one and the third one you will notice that the I mean it works but the target clearly needs to be rotated uh or flipped right because right now it's it's it's weird right so these planes or the actually the root could be flipped and that will work so let's just flip the root plane to flip a plane you can go to the vector tab plane and you can just find you know whatever works whatever you think might work in our case do you have this flip plane tool I'm not sure if you do I will assume that you do not have this flip plane tool because it has a different color and I assume it's a part of some sort of a um plugin even though it doesn't say anything here no uh I I I'll just do it manually so for the root plane I will just deconstruct plane deconstruct the root plane rotate the plane or is there like rotate plane around an axis no it's only around the Z axis okay so we use rotate 3D rotate 3D that's fine rotate 3D asks us for what do we want to rotate that's the plane ask us for asks us for the angle we changed it right click change it to degrees and we give it SL SL 180 like that ask ask asks us for the center point as well as the axis the axis that we can use is either uh X or Y it doesn't really matter I'm going to use x and now this uh rotated geometry I'm going to connect as my source like that and now it works right for now it's two dimensional that's fine we'll we'll we'll fix it a little bit later but it is branching out that's what we want well now when we have this transform technically we could uh then take this geometry and I think we could apply one second come on I'm just going to try real quickly yeah we could take this geometry that we got the two um the the two branches that we've got here and it remembers the trans transform right it remembers how the geometry was transformed so we could technically keep doing it uh keep using the same transformation right if the origin is here then add two more uh to the branches right so it remembers this this orientation transform the only problem is that if I use the transform tool which takes the geometry and uses the transform then the first element that we've got will get the first transform that we used and the second element that we got we'll get the second element that we used right because it matches up the list with with the geometry list with the transform list so what you want is you want to um separate out the geometries into separate data branches so that they get both of the transforms applied to them so right click graft and then voila you've got it going right problem now to continue doing it I would need to uh graph this transform you know and and and keep keep doing the transform Loops this is where you start looping things so we build it we build the loop let's delete the transform for now Loop start Loop start Loop end connect the two together for now repeat like four times that's fine trigger button or actually for now repeat zero times we don't want it to be repeated trigger the button data to Loop okay what's the data so I will just say that the data is our original mesh and all of this thing that we've done here with the planes and so on is for us to uh let's not grafted for us to get these transforms for us to um get the transforms of the original mesh right so there's going to be a little bit of data manipulation as well so for now uh the data is actually our starting element bam like that it goes here so it comes out as a first as a mes then it's going to be a list of measures then one second thinking then we use transform of course then we just transform for this geometry and we apply the transform that we got from here because the transform is just static thing it you know it figures out where the geometry is and it's going to move it offset it from the origin of that geometry right um so we get the two branches and we can connect those to the data output here then we have a problem and the problem is called um it does work I I'll I'll I'll kind of hide everything except the except the loop end I guess right the problem is that we had this mesh here then it became or we generated the two meshes from it these two bad boys here right and then those got transferred into the loop end then go go back in here to Loop start and during the next iteration th those two um original elements will be will continue being transformed right and then Loop end gets these guys well if I were to grab them just like we did uh with the transforms that that's going to uh get get us all of the branches right so so now um these two became these four and these four are fed into the loop end which feeds into Loop start so in the next iteration you know we only get the this eight and and so on right so iteration three iteration 10 whatever right but uh we always only see the final result we don't see the previous results saved so that's that's an issue that's an issue that we need to fix also the data tree is just horrible so there are two things that we need to fix let's fix the data tree first um here let me simplify because I can't see anything 01 what if we just sorry sorry for for taking so long um because here they are becoming separated which kind of makes sense but we don't really need them to be separated so I can just flatten this I think and then they become four no need to simplify them then we just have a list of elements at you know iteration number one and then iteration number three still a list of elements okay okay so we're we're getting rid of the data tree Al together that works uh so first thing that you need to do is flatten this uh we still have a problem of it not saving any data so how do we how do we actually save data well you need to do and this is on Purpose By the way uh you need to add one more thing that you will Loop and that is going to be your Save State technically you could also like a shortcut for it or actually let me show you a shortcut because it's less uh it's more intuitive it's more intuitive uh you already are probably just the hell is going on with the transforms and so on so we I don't want to feed you even more intermediate level uh information so for now the way you save things is by for the loop end right clicking it and choosing uh record data I think that's going to work let's see that records right right click record data one okay that gives us four that's good two that should give us eight that gives us eight excellent three and now it's recording and we can grow our forest that is flat but that's fine right so let's make it pretty oh yeah and it's nice because every generation is now saved as well great Uh custom preview Swatch really hard to see though Arctic yeah I guess I guess you can kind of see it right so that that's our L system now let's have fun with it right here we rotated the origin by 180° around but that does not prevent us and actually let's do less uh only three iterations for this right something like this that does not prevent us from rotating the Target Planes the branch planes so for instance for list item plus one for one of the Target Planes I can also do the same thing or actually for for for these I can do a much simpler one rotate plane rotate plane tool plane right click degrees for the angle 90° bam connect that here the plane just got rotated 90° and that gets connected to the Target don't forget to connect uh the second one because now the second one was disconnected don't forget to connect that one as well with the shift key to the Target reset and now why is there like a ground thing going on one second I'm just going to do this it should be good enough so now uh you can see that one of the branches is moving outwards oh yeah and I should also um the original mesh should also be shown so just using the shift key I can connect it like that ignore the relay if you double click on the line uh just double click on on on any Line This relay gets created and it's uh quite useful for just making sure the wires are going in the correct direction for now use it for that um and also you can connect from relay to multiple objects as well anyway so that's our rotated plane and now if I were to take this and I were to change the rotation of it let's say 55° press play my Branch rotates you know accordingly and all of the branches actually keep rotating accordingly so now if I were to increase this to like five you can see I get a completely different character for for the tree cool huh and now we can play with this so I can change this to 30° I assume 30° will will be kind of nice eh quite uh quite organic um so 30° is whatever uh let's do five degrees only 5 degrees uh at every generation yeah that always produces a spiraling thing let's look at it uh let's hide the plane that's a little bit in the way neat huh welcome to the world of aggregation so you can't really do that without Loops so that's that's an Anon for you right all right we I think we're done with animon we can move on to the next one one second I'm just going to group it up and make it uh I haven't used purple in a while make it purple and uh contrl c contrl v animon add to group okay next up B bird okay so when it comes down to B bird is purely used for manufacturing purposes right well at least that's how I use it Barber tab is located of course if you have installed it is located here it does have some nice polarine Boolean operations where you can use bullan difference with between different po lines uh which is nice it has a nice uh text that can be laser cut uh in a nice way so it has a nice font to it that's laser cutable uh but most importantly it has this BB layer right our BB sections B bird sections there's also curve on Surface these all tools but I will be in those for now I will be mostly focusing on the BB waffle because if you know this then you will understand how all other three of these work so we will be using BB waffle for this I will just give you a very simple example uh let's go for mesh tools mesh creation and let's just make a donut here something like that uh actually uh vertical edges uh 20 around Ed around faces 20 yeah that's nicer okay so that's our mesh the mesh that you input needs to be Clos a closed mesh because it needs to calculate proper slices through it closed slices through it I will internalize data and I will hide the mesh right or not height sorry delete the mes there we go so now um Barbo waffle uh structure asks you for the count first of all uh honestly if you just click on this little balloon here it says what it needs to start start producing and it only needs the thickness so that's the thickness of your material let's say we're cutting it out of 3 mm plywood I have no idea how big this is though uh I mean how big the the object itself uh is uh I should probably okay one second oh what the hell did I do no no no no no oh no no no go back standard uh I'll just distance it from here to here how long 400 mm yeah that's fair enough so 3 mm thickness for the material then for the XC count and Y count I will give it like uh 20 slices each something like that and that's it the Gen generates a Ser series of sections through your material that can be laser cut there is this plain uh Tool uh which basically describes the direction of the sections I tend to just keep it set to World XY as it is right now um if you're cutting something and you want the the overlap the way the the the sections go into each other to be oh actually I should probably first nah you understand what waffle structure is you know it's series of cuts with u that that connect to each other like so right so that that that's what it does so if you want that to go deeper then you create an offset here you type in in millimeters how much deeper if you want to project uh the slices to be ready to be laser cut you just toggle true and now they're laid out and ready to be cut then the minimal distance between projected slices is set to 1 millim um clearly you know along this direction it's not but it's it's fine it's fine and of course you would need to do some more grass operation adance to actually give it some um numbering and so on so for the U slices at least you would I would suggest that you just measure the pole polygon Center polygon Center and then in the around this you would use a text Tool location would be the center point the text to display why are these grafted right click flatten you don't want them to be grafted right click flatten uh then for the text itself I would just say um give me the item index of this slices and add a u to them how do you do that well you can use uh item index tool item index both list and item go go into item index and then you get a counter basically you know 0o is z one is one and so on it's basically just counting which one is which right and giving you a list for that and if I just connect that to to text and then what and for the size if I give it like I don't know like 4 mm let's give it more then this becomes item zero item one item two item three four five and and so on right you you get the idea but then I need to also tell it that it's the U Direction so for for these items I will also uh create a letter U you right and then I will H let me check one thing if it's going to work or not if these items are then grafted into separate data branches will the letter U be attached to every item in the branch so if I just text join and I just merge these two merge the U and the numbers does it work what do we get absolutely not not even close Okay so we need to do a little bit of a harder harder thing you needs to be u letter U needs to be repeated x amount of times and X being amount of slices that we have which is quite easy to do actually repeat data data to repeat is our letter U and the length of repetition is the length of the list list length nope wrong one list length there we go connect slices you to the list length the output is 32 I wanted to see what a coincidence but I won't anyway oh yeah because it's a donut so you get like two of them which is weird uh anyway the list length is 32 that's fine we connect that to the length and now we get 32 use in the list right and if I graft that list as well and I merg it now we have 32 use in separate data branches 32 numbers in separate data branches and they are merged into one uh data tree and if we use text join then what we get is probably something very nasty yeah okay it doesn't work um but we will make it work so reason for it not working is the addresses as per usual you can see you know the numbers uh the data tree of the numbers which is this only has two digits for the address the data tree of the letters has three numbers right click simplify right click simplify now it's uh the letters have one number for the address the numbers have one number for the address text join works perfectly we connect that to our text here oh yeah and we flatten it because the location is unflattened right so we just flatten the output of text joint and now it says u0 U1 U2 u3 blah blah blah right these kind of overlaps you fix manually after you bake out your drawings into Rhino you just move them you know wherever you want to the correct position okay so that's uh the BB text right to clean it up because you want the text to be for the slices v as well usually I just just uh group this contrl c contrl v make a copy uh that's going to be nasty okay polar line connects to slices V oh yeah those need to also be flattened list length this connects from there but connects to slices V what else list and item from list item connect to slip and there we go and now we we have ourselves some numbering data oh yeah and it's not U here it's actually v v V5 V6 and so on right V2 right here V2 U2 honestly that's it I mean uh there are different ways of how you can slice things you can have radial slices instead of a waffle structure but most of the time you honestly just do a waffle structure that's it are we done I think we're done wait no there clearly something something is wrong clearly I have forgotten I should probably have forgotten like 50 different things um my brain is fried anyway uh I I guess we're done I'll go drink some coffee and then I'll do an outro and if I remember any anything during my coffee drinking time then I will say it in the outro but see you in the outro I remember I remember one small thing that I also want to want to note um or rather two small things first one being data dams so when you're doing some sort of a very very heavy calculation or very heavy script and there is a clearly a portion of the script that is super heavy for example remember when we did the the Cocoon thing and this took takes like a minute right so maybe yeah I I will add it in here as to show you a data dam is basically cat data Dam nope data dam is an object that does not let data through meaning that if you calculate something and the data di is between point charge and cocon cocon calculate at something right um and then you can change whatever you want on the left hand side of the definition without cocon recalculating all the time it only recalculates when you push the play button uh the way it works is here on the left hand side I have cat or some data and imagine that this panel takes a long time to calculate right so okay once I'm ready I press play and it calculates the output here you know in this case it just shows cat but imagine right and then I go well I actually I meant dog right and I'm kind of working on it and you can see that this is still cat it's not recalculating anything and now the data Dam there's a play button here that appeared uh actually dog dog dog that's what I meant dog dog and it's still cat and once I really kind of nail down the parameters then I press play and then it transfers and you know the rest of the definition calculates that's a very valuable like data dam is very valuable for that of course if you zoom in you can have multiple inputs and outputs for the data Dam and one button that releases all of them or pushes all of them through very powerful tool for optimization another really nice tool that I could show I guess with this let me grab that b b bird B BB script another great tool is this part and this part are very very much the same right they are very very similar in in in their logic kind of weird to just kind of keep repeating the same thing so what you can do is you can let me just delete the left uh the bottom hand side and for here I can cluster it so what I mean by that is first of all I need it I need this uh to to put all of the um variables that I want to be able to change on the left hand side so I want to be able to change the text and I'll just create a text component here as well just in case like that and I want to be able to change which slices I use so I will use uh uh that slices are curves so curve component and oh by the way a quick little trick for you control shift disconnect and drag it drag this in to curve drags in all of the curves all together very useful and then connect that to slices you okay so curves will need to be I will need to be able to change and then this slider right here for the size of the text that also right so I have three of these then the output are going to be curves right so I'm just going to create a curve component once this setup is done then I can select all of the nodes in between right including the text and the curve node not including the output curve node only these two so do a mental print screen here I click the scroll wheel and I choose at 12:00 not group but cluster bam makes a note for me out of these so when you see a small definition a small grass oper script it might not be that small right and output is curves this cluster I can right click and I can change its name to uh make text yeah just make text whatever make text right and this cluster operates there we go there it is and I can can change the size of the text I can change the text itself to it counts um by itself the amount of slices that it needs and it can be very easily copy pasted here and it can use the the V curves if you want to adjust a uh cluster you can just double click on it and your nodes are here it's like accessing a block or accessing a family in Revit right so you you mess around with it and once you're done you just save and close or discard and close so I'll just save and close and that's that that that that's how it works so that is going to be clustering that's going to be data dams not dams dams okay now we're done now we're done it's always good to drink some coffee and remember all of the things that you forgot to teach so this is our final script that we have available time for an outro all right so after this training session or course you should be you should understand the you should have enough foundations for your further grasshopper development right so you should understand how grasshopper operates what kind of nodes there are available not all of them but some of them enough of them to now start figuring out what kind of a script would you like to create would you like to use or make right um one suggestion that I really or two two suggestions first one being right now for you the fastest way of how you will learn grasshopper is by simply making things but do not make difficult things do not come up with oh now I will go and invent AI that draws buildings for me I'm unique like every other student that I have so don't don't start thinking that or trying to do that because that's you're going to hit a wall that you will not be able to climb and uh a wall that you're not being able to climb does not really make you learn that well it's much better if you just find something very simple um let's say floor skirting right like the perimeter of the floor where you have the skirting on the wall right that's that's touching the floor how do you generate that in the most elegant way in grasshopper think about that right um a window generator right where you just have curves that you draw around an opening in the in the wall and it generates Windows window frames for you right automatically uh roof slope calculator or not necessarily roof slope landscape slope calculator that colors you know the the landscape different surfaces according to how much they're tilting those kind of definitions are simple well now for you they they they should be simple enough so that you can do them while also learning things later you build up the knowledge base and you start making harder and harder things but right now don't really try to over over strain yourselves right um so that's one thing second thing is and also i' I've shown you I I gave you all of the examples of what can you do for Architects but for product designers or for industrial designers or for engineers it's kind of the same thing you know a for engineers a Thrust system how do you create a a simple you know Bridge thrust system you know in in in in a nice way so that it's kind of assembling nicely and so on and all you need to do is just input the top curve and the bottom curve for instance for product designers how do you create a nice grip pattern right for a I don't know a bike a bike grip you know a bike handlebar grip okay I I stop here second thing second thing that I want to note is students that tend to learn grasshopper get really really excited about computational design and the premise of automation or the Allure of automation I am going to automate everything that I do wait maybe now I should be bigger I will automate everything that I do from now on I will figure out how to automate the staircase that I draw how to automate the lamps that I make like everything is going to be automated and there are no going to be no input from Rhino because that's yui and that's plebs I'm a patrician those are plebs right don't do that it's a very very dangerous um mindset to have I have seen so many students fail not just students honestly many professionals fail who are trying to automate a task and they spend months trying to automate some sort of a task that could have been done manually in a few days right or they spend a few days automating a test that could have been done manually in a few hours it scales right so always think about is it does making a system that generates these things insert a thing that you have in your head does making a system that generates these things that makes these things is making a factory worth it does does that make sense right or does it make sense to only kind of do the thing in Rhino manually and then maybe use grasshopper only as additional stuff for optimization or finding like different variations of it but the base of it is made in Rhino I personally the way I use grasshopper is I would say 80 between 80 and 90% of the work that I do is done in Rhino and then last 10% is done in grasshopper for in cases where I need to optimize something like structure according to stresses or uh architecture according to solar analysis or whatever so I I use it for that I use um grasshopper for form Finding in some cases where I need to grow a thing or I need to simulate some apologies some draping fabric thing or a balloon sure I assimilate with with Grasshopper and then last one is I automate boring stuff that I need to do constantly for example I mentioned window generator I do that in grasshopper I don't I I don't model windows for every proposal that we do I just you know I have a script uh that does that from time to time I'm also generate some sort of a nice paneling system for a a bedroom wall or or whatever but but that's besides the point the point is that you need to and you will find it yourselves the where you need to use grasshopper in you know what's what's the uh what's the use case and where does it make sense and that comes with time for now do simple things learn more keep learning never stop takes around 3 years after three years you will be fluent you and you will think through these systems and you will be able to virtually design anything well to a certain extent of course but like the only limitation will be your knowledge package rather than your skill set right I'll see you [Music] peace oh yeah and the all the files are available to patreon supporters [Music]