use use use rail_z=-7.5; rail_play=0.3; rail_t=7; attache_h=rail_t-1; attache2_h=8; rail_l=210; hook_cylinder_z=-4; trigger_angle=12; trigger_dist=7; screw_offset=6.5; tripod_thread_pitch=25.4/20; tripod_thread_r=6.35/2+0.3; module profile_rail() translate([5,0]) { translate([0,-1]) square([2,2]); hull() { translate([0,1]) square([3,0.5]); translate([1,2.5]) square([2,0.5]); } } catapulte_points= [[0,-35],SHARP(), SHARP(),[10,-35],POLAR(40,-90), POLAR(10,90),[20,-87],SMOOTH_ABS(5), POLAR(50,90),[14,-148],SHARP(), SHARP(),[0,-148]]; module catapulte_profile() polygon(Bezier(catapulte_points,precision=0.02)); module catapulte() difference() { for(i=[0,1]) mirror([i,0]) { difference() { union() { difference() { translate([0,0,rail_z]) linear_extrude(1-rail_z) catapulte_profile(); translate([11.6,-150-4+5,rail_z+2]) cylinder(r=3,h=10,$fn=64); translate([20,-200,-2.5]) rotate([0,50]) translate([0,0,-10])cube([20,200,20]); } translate([11.6,-150-4,rail_z]) difference() { union() { hull() { cylinder(r=3.6,h=2,$fn=64); translate([-3.6,0]) cube([6,6,2]); } hull() for(y=[3,5]) translate([0,y]) cylinder(r=1.5,h=8,$fn=64); } cylinder(r=2,h=10,$fn=64); translate([0,7,3.8]) rotate([0,90]) cylinder(r=2,h=10,center=true,$fn=64); } } translate([0,-87.3,-2.5]) rotate([0,-4]) { rotate([0.8]) translate([0,-100,1.3]) cube([50,200,10]); difference() { translate([0,-100]) cube([50,200,10]); difference() { union() { translate([0,0,0.6]) rotate([-20]) translate([0,-50,-20]) cube([50,50,30]); translate([0,-80,-20]) cube([50,80,30]); } rotate(-9) translate([0,-70]) cube([15,80,10]); } } } translate([0,0,rail_z]) rotate([90]) linear_extrude(200) difference() { profile_rail(); translate([7,1]) rotate(20)translate([0,-5]) square([10,5]); } } } rotate([90]) cylinder(r=7.2,h=150,$fn=6); for(y=[-145:20:-45]) translate([-2,y,-10]) cube([4,4,5]); } module attache() { difference() { hull() for(x=[0,11]) translate([x,0,attache_h/2-rail_t]) rotate([90]) cylinder(r=attache_h/2,h=3,$fn=64); translate([10.5,0,attache_h/2-rail_t]) rotate([90]) cylinder(r=2,h=10,$fn=64); } translate([1,1.8,attache_h-rail_t]) rotate([-90]) linear_extrude(2) hull() for(x=[1,6+1.5-1]) for(y=[1,attache_h-1]) translate([x,y]) circle(1,$fn=32); hull() for(x=[3.5,7]) translate([x,0,attache_h/2-rail_t]) rotate([-90]) cylinder(r=1.5,h=2,$fn=64); } function thread_profile(pitch,angle,ocut) = [ // workaround OpenScad bug [-0.001,0], [pitch/2/tan(angle)-ocut,pitch/2-ocut*tan(angle)], [pitch/2/tan(angle)-ocut,pitch/2+ocut*tan(angle)], [-0.001,pitch+0.001] ]; /* Screw of total length (turns+1)*pitch */ module trapezoidal_screw(radius,pitch,angle,icut,ocut,turns,fn) { straight_thread( section_profile=thread_profile(pitch,angle,ocut), pitch = pitch, turns = turns, r=radius+ocut-pitch/2/tan(angle), fn=fn); cylinder(r=radius+icut+ocut-pitch/2/tan(angle),h=pitch*(turns+1),$fn=fn); } function inner_thread_profile(pitch,angle,icut) = [ // workaround OpenScad bug [0.001,0], [-pitch/2/tan(angle)+icut,pitch/2-icut*tan(angle)], [-pitch/2/tan(angle)+icut,pitch/2+icut*tan(angle)], [0.001,pitch+0.001] ]; /* Nut of total length turns*pitch */ module trapezoidal_inner_thread(outer_radius,radius,pitch,angle,icut,ocut,turns,fn) { intersection() { translate([0,0,-pitch/2]) straight_thread( section_profile=inner_thread_profile(pitch,angle,icut), pitch = pitch, turns = turns, r=radius+ocut, fn=fn); cylinder(r=radius+ocut+1,h=turns*pitch,$fn=fn); } difference() { cylinder(r=max(outer_radius,radius+ocut),h=pitch*turns,$fn=fn); translate([0,0,-1]) cylinder(r=radius,h=pitch*turns+2,$fn=fn); } } module tripod_nut() trapezoidal_inner_thread (6,tripod_thread_r,tripod_thread_pitch,30,0.1,0.1,(rail_t-rail_play)/tripod_thread_pitch,180); module rail() { difference() { rotate([90]) linear_extrude(rail_l) for(i=[0,1]) mirror([i,0]) { difference() { offset(-rail_play) profile_rail(); translate([7,rail_play+1]) rotate(20)translate([0,-5]) square([10,5]); } translate([0,-rail_t]) square([7-rail_play,rail_t-rail_play]); } for(y=[70:20:190]) translate([-2,-y-2,-rail_t-1]) cube([4,4,rail_t+2]); for(y=[70:20:210]) translate([0,screw_offset-y,-rail_t-1]) cylinder(r=1.4,h=rail_t,$fn=64); for(y=[-158:20:-118]) translate([0,y,3-rail_t]) rotate([0,90]) cylinder(r=2,h=20,center=true,$fn=64); translate([0,-30,-rail_t-1]) cylinder(r=5,h=rail_t+2,$fn=64); } for(i=[0,1]) mirror([i,0]) attache(); translate([0,-30,-rail_t]) tripod_nut(); } module trigger_anchor_profile() hull() { translate([0,3.2]) circle(r=3,$fn=64); translate([0,7.5]) circle(r=2,$fn=64); } module trigger() difference() { union() { rotate([0,90]) cylinder(r=1.8,h=13.4,center=true,$fn=64); difference() { rotate([trigger_angle]) { translate([-4,-1.8,-22]) { cube([8,1.8,22]); cube([8,3,10]); translate([0,1.5]) rotate([0,90]) cylinder(r=1.5,h=8,$fn=64); } translate([-4,-1.8,-12]) for(a=[15,30]) rotate([-a]) cube([8,3,8]); } translate([0,0,-8]) rotate([90]) cylinder(r=2,h=20,center=true,$fn=64); } difference() { translate([-4,0,-6]) cube([8,trigger_dist+1.8,6+1.8]); for(a=[1:trigger_angle]) rotate([a]) translate([-5,trigger_dist+1.8,-5]) cube([10,10,10]); translate([0,trigger_dist,2]) translate([0,0,hook_cylinder_z]) { rotate([trigger_angle]) translate([-2,-2]) cube([4,10,10]); hull() for(y=[0,10]) translate([0,y]) rotate([0,90]) cylinder(r=2,h=20,center=true,$fn=64); } } } rotate([trigger_angle]) translate([0,-1.8]) rotate([-90]) difference() { translate([0,0,-1]) linear_extrude(3.5) trigger_anchor_profile(); difference() { linear_extrude(3) offset(-1.5) trigger_anchor_profile(); translate([-2,0.5,0.5]) rotate([45]) cube([4,10,10]); } } } module trigger_box() difference() { union() { translate([-6.7,-16,-7]) cube([13.4,24,6.9]); translate([-3,0,-7]) cube([6,15,6.9]); for(y=[screw_offset,screw_offset-20]) translate([0,y,-7]) cylinder(r=3.8,h=6.9,$fn=64); } translate([-4.2,-trigger_dist-2,-10]) cube([8.4,trigger_dist+4,15]); hull() for(z=[0,-2]) translate([0,-trigger_dist,z]) rotate([0,90]) cylinder(r=2,h=20,center=true,$fn=64); for(y=[screw_offset,screw_offset-20]) translate([0,y,-7]) { cylinder(r=1.6,h=20,$fn=64); cylinder(r1=3,r2=1,h=2,$fn=64); } hull() for(z=[0,-3]) translate([0,11.5,z]) rotate([0,90]) cylinder(r=2,h=20,center=true,$fn=64); } module hook() { difference() { translate([-1.8,-1.8,hook_cylinder_z]) cube([3.6,3.6,-hook_cylinder_z+rail_t+1.5]); translate([0,1.9,rail_t-rail_play]) rotate([-25]) translate([-5,-5]) cube([10,10,10]); } translate([0,0,hook_cylinder_z]) rotate([0,90]) cylinder(r=1.8,h=8,center=true,$fn=64); } module handle() { translate([0,0,-1.5]) trapezoidal_screw(tripod_thread_r-0.3,tripod_thread_pitch,30,0.1,0.1,3,180); mirror([0,0,1]) rotate_extrude($fn=360) { hull() { square([20,2]); square([15,10]); } hull() { square([15,58]); square([13,60]); } } } /* translate([0,0,rail_z]) rail(); */ /* handle(); */ /* rotate([90-trigger_angle]) trigger(); */ /* trigger_box(); */ /* rotate([90]) hook(); */ catapulte(); /* translate([0,4.7]) rotate([90]) planeur(); */