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;
// Add hook
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)
linear_extrude(height = h, convexity = 10, twist = -twistangle, slices = 100, scale = 1.0)
// Bottom rail
// Top rail
// Female part of clip
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.