Tuesday, August 26, 2014

First Thing on Thingiverse

My daughter has been reluctant to admit that the 3D printer is cool, but she finally made a request.  She wanted a basket to clip onto her bed, to keep stuff in.  To really understand this you need to know a bit about the bed.  It's an Ikea Kura reversible bed  with canopy.  She has it in the loft configuration (at left) with a canopy like the one shown at right, but blue and a bit larger.  The canopy is supported with what are effectively tent poles that slot into brackets that clip onto the bed railing.




Mana wanted a basket that would clip on in the same way as the canopy supports.  The first step was to recreate the bracket.  I did this by measuring out the dimensions of the bracket, drawing it out on graph paper, and then entering polygon coordinates into OpenSCAD.  I did the rounded edges using sines and cosines at 10 degree intervals.  With the basic clip shape defined, I could extrude into the 3rd dimension to make the clip.  A quick test-print verified that it worked as well as the original.  Then it was an easy matter to add a male hook onto the bracket that I could use to attach  the basket to the bracket.



Here's the code :

railHeight = 42;
lipHeight = 15;
thickness = 5;
railWidth = 42;
depth = 25;


RailClip(railWidth,railHeight,lipHeight,thickness,depth);

// Add hook

translate([10,-5,0])
cube([20,3,depth]);
translate([30,-5,0])
cube([3,5,depth]);

where RailClip is a module that just extrudes the polygon as described above.  I parameterized it so that it would work with arbitrarily-sized railings.

The basket was also pretty easy:




pi = 3.141592;

angle = 30; // Select in part based on overhang your printer can handle.
h = 100; // Height of basket cylinder wall
rad = 50; // Radius of basket
npts = 40; // Number of bands around the circle
bandWidth = 2; // Width of individual bands

// Calculate twist for linear extrusion based on overhang angle and cylinder height

twistangle = 180*tan(angle)*h/rad/pi;

// Cylindrical wall

for(i = [0:npts-1])
{
linear_extrude(height = h, convexity = 10, twist = twistangle, slices = 100, scale = 1.0)
translate([rad*cos(i/npts*360),rad*sin(i/npts*360)])
rotate([0,0,i/npts*360])
square([bandWidth,bandWidth],center=true);
linear_extrude(height = h, convexity = 10, twist = -twistangle, slices = 100, scale = 1.0)
translate([rad*cos(i/npts*360),rad*sin(i/npts*360)])
rotate([0,0,i/npts*360])
square([bandWidth,bandWidth],center=true);
}

// Bottom rail

translate([0,0,-2])
difference()
{
cylinder(h=2,r=rad+1,$fn=100);
cylinder(h=2,r=rad-1,$fn=100);
}


// Top rail
translate([0,0,h])
difference()
{
cylinder(h=2,r=rad+1,$fn=100);
cylinder(h=2,r=rad-1,$fn=100);
}

// Female part of clip

translate([0,-rad-2,89.5])
difference()
{
cube([27,10.9,25],center=true);
translate([0,-2,-1.5])
cube([24.7,3.5,22],center=true);
}

I kept the bottom separate as I wanted to print the thing upside-down to avoid the need for support material.  I considered doing something fancy to fasten the two pieces together, but ended up just making the bottom a disk that I super-glued onto the basket wall.





Finally, I uploaded the whole thing to Thingiverse.  It's now Thing #442097.  I saw that someone else had been thinking along similar lines and already created a hanger for the same bed.

Fun!

Sunday, August 24, 2014

Rapid prototyping

I recently had a great experience helping a friend with the 3D printer.  He is very into sailing, and is planning a year-long trip with his family down the west coast of the Americas.  They needed a bigger boat for the trip, and after purchasing one and refitting it made an unfortunate discovery.

The problem they had was this (as I understand it, being a landlubber): the sails are raised and lowered on the mast using small rectangular "cars".  The cars (pictured below) fit in a slot on the mast, and the end pieces pictured below keep a tight seal between mast and car that keeps the bearings in place.  The end caps that my friend had looked like the black one on the left. The cross-piece of the T shape was too narrow, however.  When the wind blew hard it allowed a space to open between mast and car, which caused the bearings to spill out onto the deck.

Replacement end pieces could only be ordered from a company in Denmark, at a price of $4 each.  With 7 cars, and two caps each, the cost adds up.  Worse, delivery was slow, and the catalog didn't show the detailed dimensions, so it was impossible to tell which piece was the one he needed.  The alternative was to buy entire replacement cars, also shipped from Denmark, at $90 each.



So my friend came by one evening, and in the course of 3 hours we did 5 design iterations, coming up with a piece that seemed to fit pretty well.  I printed two in PLA, and he took them back to his boat to test them out.  One more sub-millimeter tweak and we were good to go.  I printed out the final set of 14 in ABS, as there was a lot of question about whether PLA would stand up to weathering well.


They're taking the design files with them, in case they need more printed later.