Showing posts with label MeasureIt. Show all posts
Showing posts with label MeasureIt. Show all posts

Tuesday, June 18, 2019

Blendering a remixed Treasure Puzzle Box

A friend wanted a puzzle box that could hold one thousand crisp US dollar bills.

The first step was to figure out how much space would be necessary, which gets messy with imperial measurements. 1000 bills stacked on each other - 4.3"? What is that on a ruler? I added 5%, as a safety. (4.5 inches became 115mm.) 2.61" by 6.14" were converted to mm, then rounded to 70mm by 160 mm. Then I created a "cash-block" in a Blender file, designed as a testing metric. Similar to software engineering, if you come up with your tests beforehand, you can test to the challenge. (Otherwise, it is similar to writing a question to an answer you have written down already.)

The next step was finding an initial puzzle box. I chose this steampunk version from Thingiverse, and imported the stl files into the Blender file. Obviously, it's not big enough internally to hold the money. Using the MeasureIt plugin, I mapped out the existing internal measurements, in order to do casual scaling of the object on the appropriate x/y/z axis (130% x 120% x 244%). It wasn't necessary for the box, but I wanted to keep the same scale for the other parts.

With that said, there are issues. The steampunk gears decorations on the side stretched more on the z-axis, as did the compass rose. No good — so I switched to wireframe mode, the edit...selecting all of the gear & compass vertices on the outside of the box, and deleted them. Then I rebuilt the faces. A simple box. But...no decorations. To deal with that, I imported another copy of the base box stl into the project.

You'll notice a vertical measurement of 134.99mm. I added more overall space for the lock mechanism, as well as a plate for the locks to rest on — don't want to damage the dollar bills when the locks turn.
With the "old" version of box, I went into wireframe (z), and edit mode. Once again, selecting all of the vertices of a single gear. It'll pick up any of the faces as well, which is inconvenient for the spaces between the gear teeth. Oh well. With the vertices selected, "p" lets you separate by selection. Switch to object mode, select your new gear object, go back into edit mode. Using face select, I chose all of the ugly, not-needed faces between the gear teeth, and "x" to delete those faces.

The import process isn't always clean. Most of the time, you can ignore the cleanup. It will sometimes cause issues with edge select, selected an edge while holding down shift-alt (OSX). If you do have awkward faces/edges, you merge vertices to a "corner of a plane" vertex, using alt-m and then merging to the last one selected.

If you look at the two horizontal lines, there should just be one face (or two faces, if you have a diagonal line, like the faces above the selection. It probably wasn't designed this way...just a function of importing an stl file.
Getting back to the gear as a whole, let's assume the edge select with shift-alt selected the back edge of the gear. I (e)xtruded those edges by 2 to thicken it, then use "f" to fill in a face for those edges. As a best practice, try to merge only solid piece to another solid piece. (Either by using control-j to join, or boolean>union — I prefer Boolean>Union.)

As I finished each gear, I dropped them into a new collection just for gears (a feature of Blender 2.8).

The compass rose turned out to be...problematic. I wonder how much of it was from the STL, vs. how I took it apart in Blender.



You can see how the faces behind the star work, instead of the separate faces connecting between the spokes. When I saw all of those weird lines, I knew from experience that those faces would need to be cleaned up.

I deleted all of the bad faces, rebuilt them by hand. For each of the 8 face areas between the compass rose spikes, grabbing the vertices in edit mode with the (c)ircular select tool, then making a (f)ace.

There were also some non-manifold faces/edges on the back of the 4 tips, as well as edges/faces BEYOND the other faces already cleaned up. Those non-manifold pieces were just deleted. (Sample selections as viewed from the back of the compass rose.)

You can see the top tip highlighted - it had multiple edges that needed to be cleaned up as well, where it touched the back ring. I would guess this was a function of the software made the original remix.

After those were done, from the back side, I selected the outside edge and the tip edges, and made that a (f)ace. (Everything was now manifold - no air gaps.) I made the whole thing thicker, and recessed the separate faces between the compass spokes. I was a bit concerned that the detail might get lost, with a larger puzzle box...and it make it easier to Boolean>Union with the box.




I made the compass rose and gears 160% bigger on the x-axis and z-axis to match the box's ends, and 120% thicker on the y-axis to make it similar in look. They were put into their own collection.

The final box — the hinges stick straight out, but the rest of the box is accurate.



Sunday, March 12, 2017

How to Remix an STL or object in Blender

Premise:
I need to modify a poop bag holder that will hang off the dog's leash.

Goal:
Original STL is set for 70mm-tall cylinder for its bags, I'm going to adjust this to a 63mm-tall cylinder.

What you'll need:
Blender (MeasureIt plug-in hugely recommended, File>User Preferences>Add-ons>3D View: MeasureIt)
STL to be modified (I chose www.thingiverse.com/thing:1369224)

Importing the Robot into Blender:
File > Import > Poop_bag_robot_body.stl (from wherever you've stored it)

Moving the camera view:
NumPad-9 flips the orientation, NumPad-2 & -8 raise and lower your view, NumPad-4 & -6 change side-to-side. I changed the view to look from the robot's bottom, so I could look at the top and spike that I will be pulling down.

Prep Work
You're in Object Mode - it'll show this at the bottom of the primary window. You can mouse it to Edit mode, or just hit <tab>. Everything now shows up as orange lines, because this was imported from an STL. This is doable, you'd just have to make sure you select everything you want to move correctly.


Instead, we're going to lightly cheat. Mesh > Clean Up > Limited Dissolve. Clean! There is a risk that you could dissolve details, but it would take multiple applications of that, as well as changing the constraints.

Click "a" on the main screen to deselect everything.

MeasureIt
You're in Edit mode, nothing is selected. There are three boxes on the bottom of your screen — Vertex, Edge, and Plane selection tool. If you choose one, the others will turn off.  Choose the Edge selection box in the center, then click on any line runs the length of the cylinder.

Click on the MeasureIt tab on the far left, click Show, then <-> Segment. You can now see a blue line with a ".07m" measurement attached to it, running along that edge/line you selected. This measurement will change if either vertex moves — useful later on, when we start moving things.

On the right hand side of your primary window, there's a tab for MeasureIt. Any line that you measure will show up in that tab...you can hide them, change their colors, but I'm concerned about .07m being rounded up. Change the number of decimal precision to 3 - it now shows the line length as .069m!



The modification:
Next, we'll hit "a" again to deselect everything. Choose Plane selection, hit "c" for an area selection tool, then left-click your mouse over the spike. This should select the spike as well as the top of the cylinder.



With those highlighted, hit "g" for grab, "x" to only move it on the X-axis, then move your mouse so that the .069m becomes a .063m.

Conclusion:
That's all! It wasn't a huge amount of work, but you can save the Blender file (File>Save), or just export the STL (File>Export). There are more complex things you could try — if you wanted more room for bags, use MeasureIt to find the width of the cylinder, select the whole object in Edit mode ("a" will select/deselect all), "s" for scale, "shift-x" means you scale everything BUT the x-axis...then use your mouse to scale. (You might want to deselect the spike on the inside before scaling, unless you want that to become bigger as well.)

Personal Preference:
I felt the spike at the top of the cylinder wouldn't print without supports (the 45 degree overhang angle rule). In Vertex selection, scrolled my mouse wheel to view it closely (you can also use the "." on the number pad). I grabbed "g" the tip, hit "x" to only move on the x-axis, then moved it towards the top of the sideways cylinder.