Transcript
Transcript
In this lesson, we will use the concepts that we learned about list processing and implement them to a list of implicit bodies. So, the first thing I’ll do is rename this section to “Creating Lists and Sequencing.” I’m going to go to my create tab and choose a sphere, cube, torus, cone, and cylinder for our body list.To place these all into one list, I will search for Implicit Body List and add that to my notebook. I’ll click on this plus button, which we can also remove items in our list by clicking on that minus button, and add five items to this list and place all of my implicit bodies into our implicit body list.And I will right-click and make this a variable, which I’ll label “Implicit Body List,” which we’ll be using in the rest of this lesson. Next, I’m going to go to my imported blocks, and I’m going to import our CB Wall TPMS. You can download this file below this video, and we’ll be using this custom block that will add a wall TPMS to a part.We have this example box in the custom block like so, where we can put in different TPMS structures, change the cell size, and the approximate thickness. So, I’ll remove that box and instead put in my implicit body list, and I could do this five times with each of those parts. But by putting in this list, I will have that wall TPMS on all five of my implicit bodies in that list using this one box.And we can see this is a lattice list, since this is a lattice that is taken out of this, and I have those five lattices created. And I’ll right-click, make this a variable. This is a lattice list, and I’ll label this “Bodies with TPMS.” The last thing I’ll do is just click on that icon and convert this from a lattice list to an implicit body list, choose a cell size of 222, a thickness of 0.5 mm, and choose a gyroid structure.And so, we can see this has produced five items in this wall TPMS. And to see all of this, I’m going to use a Translate Object. So, I can translate these all out, place my wall TPMS into this object, and for the vector, I could choose a vector list and have a vector for each one of these. Or what I can do is just type in a singular vector and control that X, Y, and Z. So, I can put a list into there, or I can go to my math tab, and under utilities, I can choose a sequence, sequence from bounds, or random sequence, and we’ll use Sequence.So, for my start, my first item I want to be right at 0 mm, then an increment of 15, and my count. I can put in a value here and get three items in my list. We can see 0, 15, and 30 mm. Or I can go into my implicit body list and choose that size and place it in there. So, even if I remove an item, we can see that that size changes to match how many items are in my list, as does my sequence.So, I will drag and drop that Sequence block into the X for my vector, and then for the Y and Z, I’ll have 0 mm. So, we just have that translation in the X direction. And if I type ‘I’ to only view this, I can see that all of my items have that wall TPMS on each of them. And I’ll right-click and make this a variable, which I will label “Translated Bodies.” And we can see that each of these are an implicit body list as opposed to implicit body, and they all have that five items in our list. Since we started with a list, all down that stream, we’ll have a list.Next, we’ll talk about sort and filtering. So, I’ll right-click and add a section labeled “Sort and Filter.” So, I’ll add a Filter block to my notebook, which we can choose to put in a list and a condition. Or if we click on that overload, we can have our list values, comparison, and reference. So, I’m going to filter out my bodies with TPMS, and for the values, I want to use the mass of all of these. So, I can place in that bodies with TPMS. I’ll put in a density of one, and this will give me my mass properties for all five of those. And we’ll just use that mass, and I’m going to drag and drop that to do a separate line in its notebook and label this “Mass of Object.” So, I’ll use that as my values, and for the comparison, I only want my items that have a mass that is greater than 200 grams. So, we can see that now this has filtered these three items.Let me make this a filtered variable and add that to the bottom of my notebook. Since I use those bodies with TPMS and not the translated objects, in order to visualize which ones these are, what I can do is use a List Element block for my filter. I’ll place that in as the list, and I can type zero to isolate my view to that list element and change that index to see the different options I have.If I type a three for instance, we can see I have an index out of range because I only have three items in my filter list. So that would be index 0, 1, 2, and our list element, as we can see, is an implicit body as opposed to an implicit body list. So this is also a good way to transition from a list to an implicit body. I also want to sort, so I’ll grab that Sort block, and I’m going to also sort these by mass.So I’ll click on that overload section. For my list, I’m going to have my bodies with TPMS, and I want to sort them by the mass of objects. So now I have these five items. They’re sorted, and to better visualize how they’re sorted, I’ll use another Translate Object block. So I’ll place these in here for the vector. I’ll type in Vector so that I can again have that change along that x-axis, and I’ll use that same sequence we made before.So I’ll right click and make this a variable and label this translated sequence. I’ll place this into my X, and I’ll also translate this down 20 mm in the Z Direction just so that we have it below our translated bodies. And now if we turn on that translated bodies, we can see how we now have this filtered so that we’re going from the smallest mass to the largest mass. So I’ll right-click and make this a variable, and I will label this volume sorted.The next thing I’ll do is just choose those three lightest by using a Sub List. So our Sub List we can put in our list, and this will allow me to have a range. So I’ll go from zero index to three. So this will allow me to choose these three lightest items, and I’ll right click and make this a variable and label this choosing lightest three. I can also change its index length. So if I just had 0 to 1, I would just have that lightest object. But even if I have only one item in my list, in order to have a single implicit body and set of a list, I would have to drag and drop that item from the properties into my notebook. But I’ll keep that to be the lightest three.And then let’s add a new section, and this last section will be an example custom block that implements this idea of filtering that we can use for other applications. So you can import this block if you download the file from below this video. I already have this in my blocks folder, and that’s going to be CB. If, and because this is a custom block, you can also right-click and Export that block. What I’ll do is I can say if true, if false, then I’m going to have something happen. And I’m just going to go in my bodies with TPMS and put that first item for if true, second item if false, and that condition, if I click on that, it’ll switch from that sphere to that cube. So I’ll right-click and make that a variable, which I will label choose sphere. So if you click on that, it will show that wall TPMS on a sphere, otherwise a wall TPMS on a cube.We could also use our logic tab in the math tab and choose something like this greater than and say if the mass properties are greater for one than the other, show that item. So I’ll go into my mass of object and take that first mass and that second mass. So if the first object’s mass is greater than the second object’s mass, we would get something true, otherwise false. So this block will show me the object with the greatest mass, which in this case would be that wall TPMS cube. And so we can see that and also note that this is instead of that Filter block. This is always going to have just one item, so we just have an implicit body as opposed to a list. So this shows some of the options that we can do with our list processing to help automate and save time when creating an nTop workflow.

