My parametric object was inspired by a bike mounted air planter my co-worker made to keep me company during my commute. http://www.instructables.com/id/3D-Printed-Bike-Planter/. Since then my air plant got stolen off my bike and my commutes have been quite lonely. (though I’m not sure the plant would have lasted through a Pittsburgh winter). I decided my bike needed a new friend and I designed a program in openSCAD to generate bike head tube ornaments featuring .stl files of your choice.
You can customize the head tube diameter to match your bike’s dimensions, scale the mount, scale the zip-tie holes and load your own stl file to mash-up. My bike head tube has a diameter of 1.5″. I decided to start with a unicorn, dinosaur, and mermaid for when I’m feeling nautical.
Here’s my code:
module example004()
{
tubeDiameter = 1.5;
height = 2.5;
depth = 1.25;
width = tubeDiameter+.75;
zipHeight=.3;
zipDepth=.15;
zipLength=width+1;
difference() {
translate([-depth/2,-width/2,-height/2]){
cube([depth,width,height]);}
translate([depth/2,0,-height/2-.5]){
cylinder (h = height+1, r=.75,$fn=100);}
translate([0,-width/2-.5,0]){
cube([zipDepth,zipLength,zipHeight]);}
}
union()
{
translate([-depth-.75,0,.5])scale([.2,.2,.2])rotate([0,0,-90])import("/Users/sebrandwarren 1/Documents/OpenSCAD/libraries/Unicorn_Head.stl");
}
}
example004();