Join Chris Reilly for an in-depth discussion in this video Modeling the through hole profiles, part of Rhino for Mac Essential Training.

- Overview
- Transcript
- View Offline

- [Instructor] In the last video, we looked at working through Grasshopper to create a definition for the profile of the wooden base of our musical instrument. Now we'll take a look at making the three thru holes that are centered on the horizontal axis of symmetry out of our base. And if you remember from the modeling videos, those were three holes, one of which was in the very center of the base. And when we made those in Rhino, we spaced them 1-5/8" out from the center on either side. But of course since we're in Grasshopper, we are going to make that distance flexible, so that we could rearrange the parts if we ever wanted to.

So to get started making the thru holes, let's go to the Curve component menu. And under Primitive, we'll grab a Circle. And that makes sense to you since we're making holes. Okay, so you can see I've got my Circle component here, and that has two inputs. We have the Base plane, which by default is the origin on the World XY construction plane. And then we have the Radius, and that just sets the size of the circle. So, the first step I wanna do here is to get that circle centered in the horizontal and vertical center of my base profile there.

So still under the Curve component menu, I can go to Analysis, and then I can grab this Polygon Center component. So that takes a polyline as its input, and what we can do is grab this Rectangle component, take that rectangle output and plug it in to the polyline input. So that's gonna find the center point of that rectangle, and it's gonna give it to us in a couple different formats. The one that we want is this top output, the Center Vertex. Take that and just plug it right into the base plane input of the circle, and that'll slide it right over there onto the center of the base and what's really cool is that that's gonna update, so any time we change either the width or the length, that hole is always gonna be centered on the profile of the base.

Now of course, we also need to do some work to get the radius set up so that we can control the size of the circles okay, so I'm just gonna go ahead and grab one of these number sliders we set up earlier. Command + C, Command + V to copy/paste and we'll just plug that right in and set the radius. Okay obviously this is much, much larger then we want that thru hole to be. Actually larger than the width of the base itself, which is kinda silly. Let's go ahead and double-click on that number slider, and we'll do a little bit of adjustment here.

So I'm gonna change the name here to Thru Hole Diameter. We still want this to be a real number with three digits of accuracy. For the min, I'll set this to something maybe like 0.01, which is very small, and probably much smaller then we would ever want it in reality, but this is still not a totally unreasonable range. And actually maybe let's make that 0.50 for the max. Then we'll click Okay.

Okay, so that's a little bit more reasonable. I can do a very small hole or a larger hole. Now one thing you might be noticing here, is that on the number slider, I'm calling this Thru Hole Diameter, but the input of the circle component is specifying a radius, So if I'm feeding this, you know, 0.30 or 0.299, thinking it's the diameter, that's actually coming in as a radius, and that's gonna make my circle twice as big as I'm expecting it to be so, what I'd like to do is also add an expression here on the radius input, so I'm Right-clicking.

Going to Expression, and I'll just say x/2, so what that's gonna do is basically just cut in half any number that's coming in to that input. So that way I can just think of this as diameter. I don't have to worry about radius, and the expression's gonna take care of the conversion for me. So you might remember also, that our thru hole diameter, when we modeled this in Rhino, was 11/64", which is some very large fraction that I don't really remember right now. But what I'm thinking as I model this in Grasshopper, is that that's gonna be really hard to get to on this kind of a number slider where I'm just getting these you know, three decimals of accuracy and trying to kind of line it up to exactly 11/64" so ...

But there's a couple of things I could do, to make that a little bit easier on myself. I'll show you one right now. So let's Double-click again on that Number Slider. So we can actually add a rounding expression here, so that we can constrain the value of the number slider to certain increments, so in this case, I'd like to constrain these to 1/64". So I'm gonna type in an expression here, and I'm gonna say 1/64*floor(x*64).

And we could very easily change the increment that we're rounding to, so we would just switch out the 64 here. Maybe we could substitute eight or 16, depending on what sorts of units we'd like to sorta snap to but, basically this will take any value on the number slider, and round it to the nearest 64th of an inch, and let's give ourselves a few more digits to work with. So I'll dial it up to six, and I'll say Okay. Okay, so you can see as I'm dialing that down, Grasshopper's telling me what the original value is, and then it's showing me on the number slider the rounded value.

And I know just from practice that this 0.171875, that's 11/64, and so that's the diameter of the hole that I had in my original, but now of course I can dial this up or down to make smaller or larger thru holes as I need. Okay so we've got our one thru hole here. I need to go ahead and make duplicates of that on either side and add some controls for spacing those out. So let's go up here to the Transform component menu. And under Euclidean, let's grab this Move component.

Okay, so Move is asking us for some geometry. And then a translation vector, so basically it's asking us what to move and what direction to move it in, so the thing we wanna move is the circle okay, so I'll plug that in. And now let's take a look at this other input, the Translation Vector Input. So that's expecting something in the form of a vector, so that is a set of numbers that has an X, a Y, and a Z coordinate, and that's gonna tell that Move component what direction to move our objects in. Okay, so to start getting that set up, I'll grab a Number Slider.

And again, I'm just gonna copy and paste one of these ones we made earlier. That's really just a matter of preference, you could go ahead and remake your own from the Component menu. It's about the same amount of work. Okay, so I'm plugging the Output of that number slider into the Translation Vector Input, and you can see I'm getting an error here. Okay, and it's telling me Data conversion failed from number to vector, so we can't just plug in a straight number here. Let me go ahead and Right-click and Disconnect that wire. So we need to add one intermediary component, and we can find that under the Vector menu.

Okay, and so we can grab one of these Unit vectors. And since we're wanting to offset these thru holes to either side of the middle one, and that's along the X axis, so I can grab that Unit X component, feed that through. Okay, great and now you can see that Move component is actually working properly, so what's happening is we're chaining together, this Unit X vector, so that is a vector with a magnitude of one in the X direction, and that's just getting multiplied by whatever we're feeding it on the number slider.

Okay, so let's double-click here on the Number Slider, and just do a little bit of adjustment. So this is Thru Hole Spacing. Okay, let's set a min. Maybe that's 0.05. And the max five again. I don't think we'd ever get to those kinds of extreme values but that'll just give us some kind of reasonable starting points. Okay, so you can see we have the second thru hole, and that's lookin great.

But we need to get the third thru hole mirrored over that vertical axis there, so let's figure out how to do that, and the first thing I'm gonna do is to Copy both this number slider and the unit X component, so you'll just Shift + Click both of those, and Command + C, Command + V. Alright, so we've got a second set here. And what I can do to reverse this is just add an expression to the input of the Unit X vector, and just invert whatever number we're popping in there, so I say -x, and it changes, and so the vector we're spitting out is -1.16200.

Okay, so if I Attach that to the Translation vector, now you can see I'm moving in the opposite direction. But of course, I can only connect one of these at a time, so I need to add something in between here to merge all of these vectors together. And I can get that under the Sets component menu, under Tree. I'm looking for this Merge component. Okay, so that's just gonna kinda stitch together all of those vectors.

Okay, so you can see we have that one on the left, that one on the right. Now I can already see a problem here, and that is that I'd like those thru holes to be symmetrical, so I'd like the spacing on the left and the right side to be identical so, what I'm actually gonna do is just Delete this second number slider, and let's Connect that first one to the inverted unit vector. And now these should slide out symmetrically in either direction. And that's lookin great. Okay, one last thing I need to pay attention to here, is that the circles that I'm getting from the Move command, they're just the ones on the right and left, they're not the ones on the center, and that's gonna end up being a little bit confusing when I come to these in later steps that I'd like to grab all three circles.

You can see that a little bit more clearly even if I hide this original circle, so I'll Turn Off that preview. And you can see I'm really only getting two circles here, so I'd like to make sure that I get one in the center that are all coming out of that Move component, so I can just grab that one Move component and know that I'm getting all three thru hole circles, okay? So I'm gonna go back to my Vector component menu, and just grab a Vector XYZ component okay, and so by default that's an empty vector, it's 000, and I can just connect that right into my merge, so that way the Move component takes that input circle, moves it Ox, Oy, 0z, and pops it out right there in the middle, as well as the two that are controlled by our thru hole spacing slider.

Okay, and just for the sake of cleanliness, I'm going to Right-click on the Polygon Center, turn that off so we get rid of the little point coordinate there. Okay, and I'll just do a little bit of cleanup here. Just to make these a little bit more logically arranged. And slide 'em over just a little bit. Okay, so we have this group here that's making the profile of our wooden base. We have this group here, that's making our thru holes, and we can control the diameter, as well as the spacing of those thru holes very easily.

Last but not least, I'll Save this out. And I'll save this as 05_03-ThruHoles in the Exercise files. Okay, next up we're gonna take a look at making the wooden top of the instrument and pulling in those thru holes, cuz those will need to go all the way through both of the wooden parts.

###### Released

11/1/2016*Up and Running with Rhino for Mac*. Chris concentrates on product design, but the lessons are just as valuable for those specializing in jewelry design, architecture, automotive design, or any other CAD-driven industry.

- Installing Rhino for Mac
- Preparing a design
- Modeling metal parts
- Importing models
- Modeling parametrically with Grasshopper
- Extruding objects
- Modeling curves, surfaces, and solids
- Creating diagrams, 2D drawings, and layouts
- Rendering
- Preparing for fabrication: cutting and 3D printing

## Share this video

## Embed this video

Video: Modeling the through hole profiles