// Pedal foot holder // allviews base base2 // testviews assembly include include <../cadlib.h> width=50; height1=20; depth=30; ray=40; d=25; // Distance between the holes module base(){ // hook to attach to the pedal difference(){ union(){ cube([width,5,height1]); // Supports so the foot cover stick to the bed cube([width,vs_first_layer_height,height1+depth+10]); } union(){ h=height1-10; translate([width/2-d/2,-1,h]) rotate([-90,0,0]) cylinder(r=3,h=10,$fn=20); translate([width/2+d/2,-1,h]) rotate([-90,0,0]) cylinder(r=3,h=10,$fn=20); } } // floor translate([0,0,height1]) cube([width,depth,5]); // floor to hook triangles for (x=[0:2]){ translate([x*(width-5)/2,5,height1]) rotate([0,90,0]) triangle_rectangle(height1,depth-5,5); } // Foot cover intersection(){ cube([width,depth,height1+100]); translate([width,depth-ray,height1]) rotate ([0,-90,0]) 3darc (ray,5,width,10,90,80); } } module base2(){ height2=height1+5; difference(){ union(){ cube([60,width,5]); cube([5,width,height2]); translate([55,0,0]) cube([5,width,height2]); cube([60,5,height2]); translate([0,width/2-5/2,0]) cube([60,5,height2]); translate([0,width-5,0]) cube([60,5,height2]); } union(){ translate([-1,width/2-d/2,height2-10]) rotate([0,90,0]) cylinder(r=3,h=100,$fn=20); translate([-1,width/2+d/2,height2-10]) rotate([0,90,0]) cylinder(r=3,h=100,$fn=20); } } } module main_view(view){ if (view=="base"){ if (vs_printing){ rotate([90,0,0]) base(); }else{ base(); } }else if (view=="base2"){ base2(); }else if (view=="assembly"){ rotate([0,0,0]) base(); translate([0,-70,height1+5]) rotate([180,0,90]) base2(); } }