Geometry Fun with Onshape Loft

300x170Further exploring Onshape’s geometry tools, I started playing with the loft command. This command allows me to select two 2D shapes and Onshape will calculate a volume that spans the two shapes.

It is fairly limited in what it can extrapolate, the shapes need to be fairly similar for this to work. Circle to oval? OK. Circle to polygon? Problems.

I’m sure the feature is only designed to handle things like generate an adapter part to mate one shape to another. It’s not for artistic things. That is more in the domain of a 3D sculpting tool and not CAD.

Still, there’s some room for entertainment, especially since these lofted volumes can then be fed into the boolean operations tool. The picture above is one such result. The exterior of the shape is a square lofted with an identical square that has been rotated 45 degrees. The interior is a very similar operation, but the squares were rotated in the opposite direction. Subtracting one from the other results in the cut-out shape above. The corner of the inner square, rising in an opposite direction, cuts the edge of the outer square.

Not that this is functional or useful in any way, but it is a fun exploration of three dimensional geometries.


Duck Light

Duck lightAnd now for something with aesthetics as its primary function: A duck light. I started with the battery-powered LED lights imitating little tea light candles. These lights are widely available at very low cost from discount stores and dollar stores. My local 99-cent store sold a pair of lights for 99 cents.

The lights consist of the functional base, incorporating the battery, the switch, and the LED. It sits under the cosmetic shell, which is a cylinder pretending to be a candle with an unconvincing imitation flame above it. A little prying action should be sufficient to separate the shell from the base.

The unremarkable cosmetic shell can go in the trash. Then measure the diameter of the remaining base. Use that as a starting point: Go into Onshape and design a custom shell for that base.

My custom shell project started with a surface that describes a variant of the popular bathtub toy duck. It was not difficult to import the surface data into Onshape, but making use of the shape turned out to be more difficult than anticipated. Onshape surface manipulation tools aren’t robust enough (yet?) to deal with arbitrary surfaces imported from elsewhere. In theory I can use the “thicken” command to turn the surface into a solid, but it and many related operations fail with a generic error message.

After some trial and error I found that the split operation works: Define a large rectangular solid, position it over the duck surface, and split the solid block into two: the duck and its negative. After deleting the negative, I have a solid duck shape.

In theory I can use the Onshape “hollow” tool to hollow out the duck shape, but again I was stymied by the error messages. To work around this problem, I started crafting shapes to manually carve out the interior. It didn’t take terribly long to hollow out the bulk of the duck this way.

After sending the hollowed-out duck to my 3D printer, I was able to mate it with the LED light base and now I have a custom duck-shaped tea light!


Sesame Oil & Chili Oil Holder

Sesame oil and chili oil bottle holderThe next problem to solve in the kitchen are a pair of oil bottles – sesame oil and chili oil. Conveniently, they are from the same company so they have the same sized bottles. Inconveniently, they stand taller than other items in the kitchen cabinet, blocking views to the back and easily topple over as I reach for nearby items.

I decided it’d be good to have them on the door instead. Pull them out of the clutter. The easy way to do this is to have a shelf on the door. Unfortunately, tall bottles make this complicated: the shelf needs to be deep enough so that the bottles don’t topple over when I open the door, yet not so deep to make the bottles inconvenient to access.

My solution is to start with a shallow and accessible bottom shelf. Above the center of gravity, the bottle will be held by a flexible clip. The clip needs to be strong enough to keep the bottle from toppling when the door is opened while able to give and release the bottle when I want to pull it free. 3D printed plastic can handle the flexibility part, no problem, but the durability is a question mark. The weakest part of a FDM printed part are between the layers. When something breaks it’s almost always at the layer boundary. It’s important to make sure that the design accounts for the strengths and limitations of the manufacturing technique. We accomplish the goal by arranging the features to avoid the sharp corners that magnify the stress of flexing.

Fortunately Onshape has plenty of tools to round out corners and edges. With the help of those tools and some creative intersection across orthogonal axis, the resulting shape looks more fluid and organic than it actually is. I’m pleasantly surprised at how well the appearance looks especially since I was strictly focused on functionality.


Condiment Shelf Project

Condiment ShelfAfter being duly humbled by the complexity of the planetary gears project, I decided to back off a bit and tackle something simpler. While cooking in the kitchen, inspiration struck as I poked around in the cabinets looking for the condiments I wanted: let’s organize this thing.

This is a problem space ideally suited for 3D printing: Low-volume problem solving. Everybody’s kitchen layout is different, starting from the cabinet dimensions to the selection of spices and condiments to how much a person uses each spice in their preferred meals.

Naturally, I quickly dropped into the rabbit hole of devising a grand master plan to completely organize the kitchen cabinets. It took a while before I reminded myself: “Hey, remember when we decided to do something smaller and simpler?”

Right, that. Let’s get back to that.

The first item with immediate usefulness is a way to keep the sugar and salt containers in a way that keeps them accessible, standing above the fray of the other little jars and bottles. The few initial versions focused on building stack-able jar cubicles, but that ran into problems as the dimensions approach the maximum print size of my little printer.

Retreating yet further, I decided the vertical dimension support can be accomplished via some threaded rods and nuts I can buy at Home Depot. I only need to deal with the horizontal dimension – the shelf itself. The threaded rods are the vertical posts, they go through the small holes in each corner of the shelf. The shelf is then held in a particular position by the nuts on each of the rods.

Successfully reducing the problem down to basics gave me a small shelf that is quick to print and solves the problem. No more time-consuming huge cubes, just a small slice of plastic. It’s simple, it’s fast, it works.

If you also want to organize jars 9 cm in diameter, you can find this item in the Onshape public document library under the title “Condiment Shelf”


3D Printed Planetary Gear

Planetary Gear ToyAfter getting the 3D printer settings dialed in, successfully printing small test objects, I decided to tackle a real project. Move beyond printing static shapes and make a multi-part machine.

In hindsight, that was too big of a step, but I didn’t know until I tried it.

The project of choice was to make a simple planetary gear toy. Such objects are in no short supply on Thingiverse, of course, with a huge spectrum of size and complexity. But I wanted to practice making my own end-to-end.

Why planetary gear? Because of all the basic mechanical machines out there, I was never able to build a planetary gear in LEGO. There was never a LEGO Technic inside-out gear for the annular ring in a planetary gear set.

The first obstacle was actually a surprise – I couldn’t find the gear tool in Onshape. I had expected the basic involute gear to be somewhere in the standard toolbox and found nothing in the documentation.

A search on Onshape forums determined that I was not blind – the feature is absent from the basic set. It was, however, available as a “custom feature” published as a public document by an Onshape staffer. Onshape has its own internal programming language called FeatureScript and a spur gear generator was available as a demo of the language. I’ll have to look at FeatureScript in more depth later, but for now I have my gear tool.

The first print didn’t work, as expected. The parts didn’t fit together at all. This is the point where I had to face the fact consumer 3D printers are still far short of professional machining tools in terms of precision. In my specific case, the extruded plastic “squished out” sideways so every dimension along the horizontal (X&Y) axis are too big.

I assumed this wasn’t a new problem so started researching. Eventually I found that some slicer software have the ability to compensate for this particular trait of FDM printers. Cura called theirs the “Horizontal Expansion” parameter. Unfortunately, I had to abandon the Cura 15.04.2 I had been using and restart with Cura 2.1.2 in order to gain that capability.

With some tweaking of the horizontal expansion parameter, I got my printed planetary gear to mesh and turn like I wanted. At least I found success! But that still took way more time and effort than I had originally bargained for.

Moral of the story: Building small scale precision machinery is beyond easy reach of consumer 3D printers. I might come back to this again, but in the immediate future, I’ll stick with simpler shapes and build 3D printing experience that way.

In the meantime, my project is a public document on Onshape. Search for its title “Planetary Gear Toy.”