 Hey, what's up folks and welcome back to another layer by layer in today's tutorial We're gonna take a look at this week's project and pull out some tips on how we design the case So this is a little smart mirror that uses the pipe portal And one of the things I wanted to show is how you can optimize parts when you're doing a similar type of thing So in this case, I have a little stand And I'm attaching that with some screws and a lock nut to the main enclosure where the pipe portal is So if I head over to the back and remove the back cover, you can kind of see where I'm looking at here So I got a little hexagonal kind of holder for this lock nut with a nylon insert And what's really cool about this sort of design technique is that it holds the Lock nut in place so you don't have to hold it when you're attaching and inserting the screw So the screw goes in this end and and it comes out this end and if I didn't have this geometry here I would have to use something like needle-nose pliers to hold the hex nut in place While fastening the screw on the other side So what's pretty cool about this is that it prints without any support material because we have a drafted angle here at the Bottom and we have enough clearance just enough clearance for the screw to not hit the actual PCB here So you have a little bit of clearance there, but it's really cool because you can just press fit this This lock nut this m3 Lock nut into the holder that's built into the enclosure and then when you attach The stand to the enclosure you just fasten You just fashion the screw in and just kind of hold this in there And if it has a tight fitting then you don't even have to hold it It'll the thing will just hold it for you So that's kind of a neat design approach for making really anything that attaches To something else and needs a hex nut and it worked out pretty well for this for this project So let me create a new tab and kind of show off how how we can make something like that I'll start off with kind of drawing a little box And then we'll make a wall. So I'll just do something like 50 by 50 And then I'll extrude this out Let's say one and a half millimeters and then I want to kind of create A box so instead of doing one and a half millimeters Let's make this the whole extent of the box. Let's say it's uh, let's go with 12 hit. Okay I'll select the top here and then just do a shell And I'll make that shell one and a half millimeters. So I got my box now And I'm going to go ahead and start drawing out You know the hex nut holder So you want to Depending on your case you want to figure out which side you want it. What did you want it on? So I'm just going to do it on this side here So I'll just kind of create a new sketch and select where I want it to be And just to get some uh, some geometry here I'll select the surface again and project in that surface And then here you can see it's a projection linked So that means if I ever change the dimensions of this shape, uh, this Lines this projected surface will update with it. So now, uh, you can kind of Either freehand where like the position of where you want your your hex nut to be or it could be very precise Um, and I'll I'll I'll kind of do it freehand And then I'll lock it down with some dimensions. So let's go ahead and make our circle Um, you can use this the command C anywhere here will work just fine I'm gonna try to keep it in the middle here. Let's make it three and a half millimeters So that the m3 screw can just pass through it And that's kind of what I want and then next I'll create a A polygon using the subscribe circumscribed polygon. That's kind of the one I like to use And I'll start uh, I'll I'll click in the center Of our circle that we just created that way it'll be um It'll be a kind of lock to it. So at this point, um, you can see like as I drag it out I can I can see that the the dimensions are changing And in this case, I'm going to make it three millimeters And then hit okay So the dimension here is just half of the full length. So from this line to this line is actually six millimeters Um, but here you can see it's only three. So what we can do is you can either delete that And then you can add a new Uh sketch dimension by selecting and holding down shift and selecting both of those Those lines and then I'll add a dimension by hitting, uh, the hot key d And then there you can see I'm starting to create that so if I ever wanted to change it Let's say I want 5.6 for example. I can do that Now you'll see that as I move the circle now the circumscribe polygon is going with me But there's some weirdness going on. So what I want to do is I want to lock this one of these I want to apply a horizontal, uh, or vertical constraint to one of these lines and You want to think about your printing orientation. So in this case, uh, this will be the bottom And I kind of don't want a flat surface So like if if I was printing this out your printer could do it But I think it'd be better if you had a point going straight up that way that this These two lines kind of face up as a port as a as a as opposed to, you know, having a flat surface and 90 degree overhang So let's pick this line here to be horizontally or vertically constrained So I'll just pick that and now it is Always going to be vertically constrained. So I can just about free move this wherever I want And uh, you can see here That this 5.6 is going to be pretty much wherever I go So if I select these two just to confirm. Yeah, it's 5.6 So even though it looks like this is out of the place, uh, it is not But we could always delete it too, you know, and then add a new one Just to kind of get some sanity here. So this is 5.6 All right, that looks good. Now it's it can move it wherever we want Um, so that depends on where you want it. So let's say I wanted it to be in the center of this whole thing I could use the line tool and then one of these edges here I can just roll over until I get that triangle that triangle. Let's me. It's the mid Point constraint. So I'll click that and then I'll follow through the other side and do the same thing Right where I see that triangle. I know that it's locking to the middle of that line. So whenever I change Let's say that the the the height of this case This will this line will always be in the center now that I have it selected. Let's go ahead and make it a construction line by hitting the either hitting the the hot key x on my keyboard Or using this This button here that's it's very hard to see for some reason So I'm going to hit the x key and you'll see it makes it a dotted line that way It's just you it's just being used as a reference Uh line and not something that will cut through our profile Now what I can do is I can grab this line here And with it selected I'll hold down shift and select that dotted line. I'll bring up my sketch Shortcuts window with the s key and then I'll make it midpoint and watch what happens and click that midpoint It'll bring it right in the middle. So it is in the absolute middle of this line And then this line is in the middle of this line. So everything's kind of in the middle So if you wanted your Attachment bit to be in the exact center of this of this surface here Then this is how you would do it. So let's hit finish sketch And then let's start making some extrusions. So I'll select my circle I'll want it to go this way out So instead of adding a dimension, let's go ahead and do some uh Some smarts here where I say the extent type Let's make it to object and I'll select this surface So it goes from that profile to that surface And if the thickness ever changes that'll change as well because it's always going to this surface. So hit okay And the next step will do another extrusion But I've just noticed that I need to do a little bit of work to my thing here If I were to extrude this then where would the hex nut be right? So I actually need to make an offset to this uh to this, uh This thing so I'll go back into my sketch by double clicking it And it's really easy to do an offset of a thing Because this shape is like a chain a loopable chain I could just hit the hot key o o is for offset and you can see I need to select it So if your chain selection is checked on Then that means you can select just this whole shape here and you can see it's already doing A nice offset for me. So uh what you want to do is probably use the same number That we use for the shell when we shelled this out that was one and a half millimeters and I'll hit okay All right, so now I can start extruding so I'll just hit the e key on my keyboard And then how much we want to make this it depends on how thick Or how deep you want your hex nut to be I'm going to go with uh two millimeters is fine for this one And that's kind of it for that. So I've extruded it out But now what I want to do is I want to Optimize these edges here some of these surfaces because right now The printer is going to struggle on printing this out because it is it is it is an overhang even though it's got um Some sort of uh It's still going to struggle a little bit. So what we can do is we can use the draft edges Uh feature to draft those edges. So uh in my shortcuts window, I'll just type in draft I'll select that And what you want to do is for the pull direction want to select the surface That you are going to pull It's always a little bit backwards. So I'm going to hit select the face that I want to be um Drafted and it's going to be these two bottom ones. It's a little hard to kind of see it Um, so we could do a cross section And I recommend doing that because it's really hard to see so let's do a cross section So under inspect I'll click on that And then I'll select one of these surfaces here And then I'll use the uh the arrow to kind of pull so I can get in there Um, I kind of will change the orientation of it so that I can kind of Do one of these views where I can see kind of half of it. I think that'll work better I think that will be okay. So let's hit okay And that gives us a little bit better view. So back to the design shortcuts window. We'll select draft Click on that faces and we'll select this face here Rotate around and I think I could just about get under here And then hold down the command on mac or probably control on pc to do is it's kind of a Multi selection of those two surfaces. So we got our face to select and now we need to pull that direction And the surface to do that is actually this front facing surface here So I'll click on that and now I have a little handle as to which I can start pulling this So let's make it 45 degrees and you can see here as I'm doing that It's kind of Eating into or merging into the bottom floor plane there and you can see I'm getting a little bit of extra geometry there So you want to be aware of that But I'll hit okay And that tend to have kind of went away automatically, which is Which is nice for us and now we don't have to delete those But that's a good way to kind of see that When you have some overhang you can use that draft edges Feature to optimize the jump for printing better Yeah, and then because of the way this is printing out We don't have to draft these edges here. These edges can be flat But that's kind of what you want to do now. The next thing I'll do is maybe play around a little bit with like the height Let's say I want to go 16 millimeters if I update that feature Fusion will calculate all that again and you'll see that our Our our mounting hole is actually Exactly in the middle because we have that midpoint constraint And that means if we were to extend The dimension of the case itself, let's say we made it longer. Let's make that 100 millimeters You can see it'll always be in the center and that is sort of the power of combining The midpoint constraint with A coincident constraint, let's say for this case So that's cool From here, we can do like we can mirror it if we want If you wanted to find the center of this Of this case here, you can do that very easily with a construction plane the mid plane right here It lets you select one surface Another surface and then it'll find and calculate the middle of those two surfaces now. We can use this This construction plane as a as a reference point to create our mirror So let me go ahead and type in mirror. I want to do the type as a feature. I want This extrusion this extrusion I got a hold down command or something These there we go I deselected the one of them and I can select those three items In my timeline, you can see a little preview of it. It looks green And then my mirror plane is already selected. I'll hit okay And it gave me a little error there Let's read the error. It says compute failed. No target body It looked fine to me fusion will sometimes do that Yeah, it doesn't like it for some reason. Let me see if it It's there though. It's happening. I don't know why fusion is freaking out Um, but it looks fine to me. Oh, it didn't do the uh the extrusion because The extrusion over here was set to um You know to to be uh the extent type set to object So in that case, let's go back into the mirror and instead of Futures, let's try faces And then I'll uh deselect that and then select these three things um Let me just select them manually these surfaces then it shouldn't be that difficult But sometimes it is All right, that looks like the the hole is going to be a part of it. Let's hit okay Still didn't do it. Oh gosh fusion You are not making it fun. So let me uh go back into that extrusion that made the hole And then instead of extent type two object, we're trying to be fancy and parametric Let's just put distance Leave it at negative 1.5 because that is the right number we want And then when we mirror it, let's go back to features And then I'll select those uh those features here the extrude the extrude And the draft let's see if that works And that worked Yeah, you just have to understand like what is actually going on when you're mirroring if you have those sort of Uh special things like two objects. It will just not do it Um, but you know, you could be smart and then say you could use um Instead of using a hard-coded Number here, we could have created a user parameter and said thickness And then that way when we created our shell, we could have made this hard-coded value into a user parameter And that way we could retain that parametric ability But you can always go back in to change it But that's a quick look at how you can make some optimized geometry for attaching one thing to another thing And a little bit of work on troubleshooting mirrors infusion And uh, just a good lesson in using the circumscribe Uh tool and the draft edges tool. So check out the project here I got a couple things here that are they're pretty interesting. You could check out This 3d model of the pi portal is available to download as well. It's got all the onboard components Uh, I'll give a little promotion to the learn guide as well If you want to pick up the pi portal, they are in stock and you can create this smart mirror project Connects over wi-fi And this pi portal is fully featured if you ever want to do anything with the display and iot projects This is definitely the way to go And then the cad parts are over here on our get hub repo at get hub.com slash adafruit slash Adafruit underscore cad parts Check this out if you have a parts request you can always add them to the issues tab And I'll post up when I get through them But uh, the way it works is you just search for the pid In this case, I could just type in pi portal and you can see all the pi portals that are here Because you got the titano the pint and the regular classic pi portal You can download in a step file fusion 360 file and an stl. So check this out That's going to do it for this tutorial. Let me know what you thought of it in the comments below I'll see you next time. But until then remember to Make a great day. Bye folks