use <../cadlib.h> use // allviews testpost testclip testlock // Support for battery and propeller test // testviews testclip-check // Show base1 and testclip together // testviews test-postconnect // viewopts testpost brim10mm // viewopts testlock brim10mm // viewopts test-postconnect brim5mm // allviews base1 base2 rectop batt_plate top fronttop corner_spacer // viewopts base1 fill10 // viewopts corner_spacer fill10 // allviews batt_holder // allviews cpuholder-wii cpuholder-naze // allviews arm-start-left arm-start-right // Large motor // allviews arm-end-left // Large motors // allviews arm-end-right arm-connect // Large motors // allviews arm-smallmotor-left arm-smallmotor-right // testviews all all_notop base1_holder // testviews batt_holder_thin // testviews standalone_escholder standalone_recholder // testviews test_print_base2 test_print_base1 // testviews testholes testbasetop test-holes-smallmotor // testviews recholder // printviews batt_holder:x2 batt_plate:x2 // printviews batt_plate,batt_holder:x2,h80 // printviews group_batt_holder_thin // otherviews // esccpu: Combine the escholder and wiiholder in one view // testholes: Just prints a small rectangle with the corner holes // to make sure they are compatible with the old design // standalone_escholder: Just the escholder with extra support // so it can be attached to another mount surface // standalone_recholder: Just the recholder with extra support include // Various dimensions screwr=1.8; // Radius non treaded hole (m3 screw) threadr=1.6; // Radius for self threading hole (m3 screw) // ESC dimensions escx=65; escy=68; esch=17.25; // Receiver dimensions recx=56; recy=26; rech=14; // Size of a post postw=6; // Size of the base basex=200; basey=100; basethick=4; mainposth=45; // Size of the center top toplen=basex-70; topwidth=basey-6; topheight0=esch+4+3; // Clear the ESC + cpuholder + screws topheight= topheight0+25; // Size of the MultiWii CPU cpuw_wii=51; cpuw_naze=36; cpuoffsetx=-15; // The ESC holder, part of base2 is moved to the front // to make some place. The cpuholder is the moved back // to keep it centered. // Size of the battery battx=106; batty=24; batth=38; // Battery + some rubber mat (4mm) // Size of arm arml=190; armw=15; armt=10; armangle=15; module originalbase(){ import ("/tmp/PARTS/Base1.stl"); } // U shape box to hold components in placedate +%d/%b/%Y // The dimension represent the inside of the box module boite(lenx,leny){ translate([-2,-2,0]) cube([lenx+2,2,2]); translate ([-2,leny,0]) cube([lenx+2,2,2]); translate ([lenx,-2,0]) cube([2,leny+4,2]); } // 3 holes (cylinder, must use difference() // To screw one arm. The dimensions represents // the distance between center of the holes holex=18.5; holey=13; module armholes(thick){ translate([-holex/2,holey,0]) cylinder(r=screwr,h=thick); translate([ holex/2,holey,0]) cylinder(r=screwr,h=thick); translate([0,0,0]) cylinder(r=screwr,h=thick); } module armholes_corner(thick){ armholes(thick); // This cuts the whole base at the corners //translate([-holex,18,0]) cube([holex*2,20,thick]); } module testholes(){ difference(){ cube([24,18,1]); translate([12,3,0]) armholes_corner(1); } } // Main plate supporting the electronics module base(thick){ difference(){ union(){ x0=basex/2; x1=basex/2-20; y0=basey/2-13; y1=basey/2; path=[[-x0,-y0],[-x1,-y1],[x1,-y1],[x0,-y0],[x0,y0], [x1,y1],[-x1,y1],[-x0,y0]]; linear_extrude (thick) polygon(path); //translate ([-basex/2,-basey/2,0]) cube([basex,basey,thick]); // Add some support so it sticks better to the print bed //translate ([-basex/2,-basey/2-20,0]) cube([40,basey+40,0.5]); //translate ([basex/2-40,-basey/2-20,0]) cube([40,basey+40,0.5]); } //width=30; //translate ([-basex/2,-basey/2,0]){ // rotate([0,0,45]) cube([width,width*2,3]); //} //translate ([-basex_3_4, 30,0]) cylinder (r=25,h=3); //translate ([ basex_3_4,-30,0]) cylinder (r=25,h=3); //translate ([ basex_3_4, 30,0]) cylinder (r=25,h=3); off=20; union(){ translate([basex/2-off,-basey/2+off,0]) rotate([0,0,180+30]) armholes_corner(thick); translate([basex/2-off, basey/2-off,0]) rotate([0,0,-30]) armholes_corner(thick); translate([-basex/2+off,-basey/2+off,0]) rotate([0,0,180-30]) armholes_corner(thick); translate([-basex/2+off, basey/2-off,0]) rotate([0,0, 30]) armholes_corner(thick); } } } // Post to support the controller on top of the ESC module post(height,hole_depth){ difference(){ cube ([postw,postw,height]); translate([postw/2,postw/2,height-hole_depth]) cylinder(r=threadr,h=hole_depth); } } // Draw a cylinder representing the hole in a post // Useful when the post is merged into another object // so we make sure the hold a deep enough module post_hole(height,hole_depth){ translate([postw/2,postw/2,height-hole_depth]) cylinder(r=threadr,h=hole_depth); } // This is a solution used to secure the battery under // base1. // This is built upside down. There will be two of those module batt_holder(base_width){ cubew=7; platew=base_width; platelen=15; difference(){ union(){ translate([-platew/2,-batty/2-platelen,0]) cube([platew,batty+2*platelen,5]); translate([-cubew/2,-batty/2-7,0]) cube([cubew,cubew,batth+3]); translate([-cubew/2, batty/2,0]) cube([cubew,cubew,batth+3]); } union(){ translate([-platew/2,-batty/2,0]) cube([platew,batty,6]); translate([0,-batty/2-7/2,batth+3-10]) cylinder(r=threadr,h=11); translate([0, batty/2+7/2,batth+3-10]) cylinder(r=threadr,h=11); } } } module batt_plate(){ difference(){ union(){ translate([-7/2,-batty/2,3]) cube([7,batty,6]); translate([-7/2,-batty/2-7,0]) cube([7,batty+14,3]); } union(){ translate([0,-batty/2-7/2,0]) cylinder(r=threadr,h=10); translate([0, batty/2+7/2,0]) cylinder(r=threadr,h=10); } } } // Side battery holder with hole for the testclip module base_clip(len,w,h,left){ union(){ cube([len,w,h]); //translate([len/2,-1,h-4-1]) rotate([-90,0,0]) cylinder(r=2,h=w+2); wt = left ? -w : w; translate([len/2,wt,h]) rotate ([-90,0,0]){ difference(){ triangle_isocel(4,8,4); %translate([-2,-10,0]) rotate([0,-90,180]) triangle_rectangle(4,4,4); } } } } // Spacer to augment the distance between base1 and base2 module corner_spacer(){ difference(){ translate([-12.5,-4,0]) rotate ([0,0,0]) cube([25,20,basethick]); armholes_corner(basethick); } } // The bottom part module base1(thick){ difference(){ extraw=2; union(){ base(thick); wallw=4; walllen=20; wallh=15; translate([-battx/2+20,-batty/2-extraw-wallw,0]) base_clip(walllen,wallw,wallh,true); translate([-battx/2+20,batty/2+extraw,0]) base_clip(walllen,wallw,wallh,false); translate([battx/2-20-walllen,-batty/2-extraw-wallw,0]) base_clip(walllen,wallw,wallh,true); translate([battx/2-20-walllen,batty/2+extraw,0]) base_clip(walllen,wallw,wallh,false); } // We create a hole for the battery, slightly longer // so it is possible to slide the battery to adjust // the balance of the quad // The battery is on its side union(){ translate([-battx/2-10,-batty/2-extraw,0]) cube([battx+20,batty+extraw*2,thick]); // Remove material on each side to save weight translate([-battx/2-10,-basey/2+5,0]) cube([battx+20,20,thick]); translate([-battx/2-10,basey/2-5-20,0]) cube([battx+20,20,thick]); // Remove material in front and on the back whole=40; translate([-basex/2+5,-whole/2,0]) cube([20,whole,thick]); translate([basex/2-5-20,-whole/2,0]) cube([20,whole,thick]); } } } batt_post=7.2; module old_base1(thick){ difference(){ base(thick); // We create a hole for the battery, slightly longer // so it is possible to slide the battery to adjust // the balance of the quad union(){ hw=batt_post+0.25; translate([-battx/2-10,-batty/2,0]) cube([battx+20,batty,thick]); // Then 4 holes for the batt_holders translate ([-battx/2+20,-batty/2-hw,0]) cube([hw,hw,thick]); translate ([-battx/2+20,batty/2,0]) cube([hw,hw,thick]); translate ([ battx/2-20,-batty/2-hw,0]) cube([hw,hw,thick]); translate ([ battx/2-20, batty/2,0]) cube([hw,hw,thick]); } } } module base1_holder(thick){ base1(thick); translate([-battx/2+20+batt_post/2,0,10]) rotate([0,180,0]){ batt_holder(15); translate([0,0,batth+15]) rotate([0,180,0]) batt_plate(); } translate([ battx/2-20+batt_post/2,0,10]) rotate([0,180,0]){ batt_holder(15); translate([0,0,batth+15]) rotate([0,180,0]) batt_plate(); } } // ESC holder on top of base2 module escholder(){ escx_2=escx/2; escy_2=escy/2; translate ([-escx_2,-escy_2,0]){ boite (escx,escy); translate([-2,-2,0]) cube([2,10,2]); translate([-2,escy-10,0]) cube([2,10,2]); } // Place 4 posts around the box translate ([-escx_2-6,-escy_2-6,0]) post(esch,7); translate ([-escx_2-6, escy_2,0]) post(esch,7); translate ([ escx_2,-escy_2-6,0]) post(esch,7); translate ([ escx_2, escy_2,0]) post(esch,7); } module standalone_block(holey){ difference(){ w=10+postw; cube([7,w,3]); translate([3.5,holey,0]) cylinder(r=screwr,h=3); } } module standalone_escholder(){ escholder(); width=10+postw; translate ([-escx/2-2-5,-escy/2-postw,0]) standalone_block(10); translate ([-escx/2-2-5,escy/2-10,0]) standalone_block(5); translate ([ escx/2,-escy/2-postw,0]) standalone_block(10); translate ([ escx/2, escy/2-10,0]) standalone_block(5); } top_y1=escy/2+6; top_y0=topwidth/2; top_x1=toplen/2-11; top_y2=top_y1-8; top_h0=topheight0; top_h1=0; top_h2=topheight-topheight0; pathtop=[ [-top_y0,-top_h0,0],[-top_y0,0,0], [-top_y1,0,0],[-top_y2,0,0],[-top_y2,top_h2,40], [top_y2,top_h2,0],[top_y2,0,0],[top_y1,0,0], [top_y0,0,0],[top_y0,-top_h0,0] ]; pathroundtop=[[-top_y2,top_h2,40],[top_y2,top_h2,0]]; // This covers the CPU and attach to the escholder module top(){ difference(){ rotate ([0,0,90]) translate([0,-toplen/2,0]){ // We make the top shorter so it can slide into fronttop with // some tolerance profile_arc(pathtop,toplen-2.5,0.5,0,0.5,20); difference(){ union(){ profile_arc(pathroundtop,1,16,-8,0.5,20); rotate([0,0,90]){ translate([0,-top_y2,0]) cube([1,top_y2*2,top_h2]); translate([0,-top_y0,-top_h0]) cube([1,top_y0*2,top_h0]); } } rotate([0,0,90]){ translate([0,-top_y0,-top_h0]){ translate([-0.5,4,-1]) cube([2,8,6]); translate([-0.5,top_y0*2-12,-1]) cube([2,8,6]); translate([-0.5,top_y0-recy/2,-1]) cube([2,recy,rech+1]); } } } } union(){ w_2=postw/2; top_hx=top_x1-w_2; top_hy=top_y1-w_2; translate ([-top_hx,-top_hy,-1]) cylinder(r=screwr,h=3); translate ([-top_hx, top_hy,-1]) cylinder(r=screwr,h=3); translate ([ top_hx,-top_hy,-1]) cylinder(r=screwr,h=3); translate ([ top_hx, top_hy,-1]) cylinder(r=screwr,h=3); } } } // This connects to the top. module fronttop(){ rotate ([0,0,-90]) translate([0,0,0]){ difference(){ union(){ profile_arc(pathtop,10,3,0,1.75,20); profile_arc(pathroundtop,1,16,-8,1.75,20); } union(){ translate([0,2,0]) profile_arc(pathtop,9,1.5,0,0.5,20); // Remove 6mm to clear the rail translate([-top_y0-3,0,-top_h0-1]) cube([5,15,7.25]); translate([top_y0-3,0,-top_h0-1]) cube([5,15,7.25]); // 3 holes to screw in the top translate([-top_y0+8,5,-top_h0/2]) rotate([0,-90,0]) cylinder(r=threadr,h=10); translate([top_y0+5,5,-top_h0/2]) rotate([0,-90,0]) cylinder(r=threadr,h=12); translate([0,5,top_h2-10]) rotate([0,0,-90]) cylinder(r=threadr,h=40); } } rotate([0,0,90]){ // Close the front difference(){ union(){ translate([0,-top_y2,0]) cube([1,top_y2*2,top_h2]); translate([0,-top_y0,-top_h0]) cube([1,top_y0*2,top_h0]); } union(){ // Make holes for wires translate([0,-top_y0+4,-top_h0]) cube([1,8,5]); translate([0,top_y0-12,-top_h0]) cube([1,8,5]); // This hole is not centered because the emax ESC // is made this way translate([0,-15/2,-top_h0]) cube([1,25,10]); } } } } } // Receiver holder on top of base2 module recholder(){ boite(recx,recy); translate([recx/2,-postw,0]) post (rech,10); translate([recx/2, recy,0]) post (rech,10); } // Small plate to hold the receiver module rectop(){ difference(){ cube([postw,recy+2*postw,2]); union(){ translate([postw/2,postw/2,0]) cylinder(r=screwr,h=2); translate([postw/2,recy+postw+postw/2,0]) cylinder(r=screwr,h=2); } } } module standalone_recholder(){ recholder(); translate([recx/2-15,0,0]) rotate([0,0,270]) standalone_block(10); translate([recx/2-15,recy+postw+2,0]) rotate([0,0,270]) standalone_block(10); } // The second bottom part. The arms are between base1 and base2 // It contains a base and the various boxes to hold the ESC and the receiver // The receiver is behind the ESC. It is 10mm behind recpos=(escx/2)+10; module base2(thick){ difference(){ base(thick); union(){ // Hole to allow the ESC power connector to go between // base1 and base2 //translate([-75,-15/2,0]) cube([20,15,thick]); // Remove some material under the ESC to save weight hole_escx=escx-6; hole_escy=escy-6; translate([-10-hole_escx/2,-hole_escy/2,0.5]) cube([hole_escx,hole_escy,thick]); // Do the same under the receiver hole_recx=recx+12; hole_recy=recy-6; translate([basex/2-recx-15,-hole_recy/2,0.5]) cube([hole_recx,hole_recy,thick]); // Do the same in front translate([-basex/2+7,-20,0.5]) cube([20,40,thick]); } } // For Quad ESC 65mm x 68 translate([-10,0,thick]) escholder(); // Slots to hold the top basex3 = basey/2-3; basey2 = toplen/2; //basex/2-40; translate([0,0,thick-0.1]) // The 0.1 remove some slic3r errors difference(){ // The path defines a rail to insert the top path=[[-basex3+5,-basey2],[-basex3,-basey2], [-basex3,basey2],[basex3,basey2],[basex3,-basey2], [-basex3+5,-basey2]]; union(){ // We do the path 6mm high so the wires stay in place // while we install the top rotate([90,0,90]) profile (path,6,3,0,2); // We draw the receiver holder to remove some parts of it below translate([recpos,-recy/2,0]) recholder(); } union(){ // Remove a slice to allow the top to fit in rotate([90,0,90]) profile (path,6,1,0,0.5); // Make the slice larger in front and in the back sthick=2; translate([basey2-sthick/2,-basex3,0]) cube([sthick,basex3*2,6]); translate([-basey2-sthick/2,-basex3,0]) cube([sthick,basex3*2,6]); // We remove some part of the path to let the wires go through // Front translate([-basey2-3,-basex3+4,0]) cube([6,8,7]); translate([-basey2-3,basex3-12,0]) cube([6,8,7]); translate([-basey2-3,-15/2,-1]) cube([6,25,7]); // back, we let some space for the receiver translate([basey2-3,-basex3+4,0]) cube([6,8,7]); translate([basey2-3,basex3-12,0]) cube([6,8,7]); translate([basey2-3,-recy/2,0]) cube([6,recy,7]); } } // Place 4 posts to support the top postx=toplen/2-11; posty=escy/2; posth=topheight0; translate ([-postx,-posty-6,thick]) post(posth,7); translate ([-postx, posty,thick]) post(posth,7); translate ([ postx-6,-posty-6,thick]) post(posth,7); translate ([ postx-6, posty,thick]) post(posth,7); if (false){ // 6 posts to support the top // The middle posts are moved to the front to allow place // for the wires of the ESC translate([-postw/2-20,-basey/2,3]) post (mainposth,7); translate([-postw/2-20, basey/2-postw,3]) post (mainposth,7); translate([-basex/2,-recy/2-postw,3]) post (mainposth,7); translate([-basex/2, recy/2,3]) post (mainposth,7); translate([ basex/2-postw,-recy/2-postw,3]) post (mainposth,7); translate([ basex/2-postw, recy/2,3]) post (mainposth,7); } } // one arm of the X shape covering the ESC module escarm(len){ difference(){ translate([-postw/2,-postw/2,0]){ cube([len+postw,postw,3]); patch=10+postw+1; // Because of the sub-hole to clear // the ESC assembly screw // we increase the thickness cube([patch,postw,4]); translate([len+postw-patch,0,0]) cube([patch,postw,4]); } union(){ // Mounting holes cylinder(r=screwr,h=6); translate([len,0,0]) cylinder(r=screwr,h=6); // Allow space for assembly screws of the ESC translate([10,0,0]) cylinder(r=3,h=2); translate([len-10,0,0]) cylinder(r=3,h=2); } } } // Small support for the MultiWii/naze board module cpuholder_square(offx,cpuw,posth){ translate([offx,-cpuw/2,0]){ difference(){ cube([cpuw,cpuw,3]); translate([7,7,0]) cube([cpuw-14,cpuw-14,3]); } translate([0,0,0]) post(posth,5); translate([cpuw-postw,0,0]) post(posth,5); translate([cpuw-postw,cpuw-postw,0]) post(posth,5); translate([0,cpuw-postw,0]) post(posth,5); } } module cpuholder_posthole(offx,cpuw){ translate([offx,-cpuw/2,0]){ translate([0,0,0]) post_hole(5,5); translate([cpuw-postw,0,0]) post_hole(5,5); translate([cpuw-postw,cpuw-postw,0]) post_hole(5,5); translate([0,cpuw-postw,0]) post_hole(5,5); } } module arm_connect(){ thick=1.5; gap=0.2; pathout=[[-thick,-thick],[armw+thick,-thick], [armw+thick,3],[armw/2,armt+thick], [-thick,3],[-thick,-thick]]; pathin=[[-gap,-gap],[armw+gap,-gap],[armw+gap,3], [armw/2,armt+gap],[-gap,3],[-gap,-gap]]; difference(){ linear_extrude(30) polygon(pathout); union(){ linear_extrude(30) polygon(pathin); translate([armw/2,5,5]) rotate([90,0,0]) cylinder(r=screwr,h=10); translate([armw/2,5,25]) rotate([90,0,0]) cylinder(r=screwr,h=10); } } } // This is the holder on which the motor is screwed module arm_smallmotor(right){ translate([10,0,right?30-0.5:0]) cube([20,10,0.5]); translate([-10,0,right?armw:0]) cube([10,5,armw]); translate([-4,12,0]){ rotate([90,0,armangle]) translate([0,0,sin(armangle)*30]){ difference(){ union(){ translate([0,right?15:0,0]) cube([15,15,4]); translate([17,right?17:13,0]) cylinder(r=12.5,h=4); } union(){ translate([18,right?17:13,0]) rotate([0,0,45]){ cylinder(r=3,h=4); larger=8; smallr=6; //5.5; translate([larger,0,0]) cylinder(r=screwr,h=4); translate([-larger,0,0]) cylinder(r=screwr,h=4); translate([0,smallr,0]) cylinder(r=screwr,h=4); translate([0,-smallr,0]) cylinder(r=screwr,h=4); } } } } } } // This is the holder on which the motor is screwed module arm_bigmotor(right){ translate([10,0,right?30-0.5:0]) cube([20,10,0.5]); translate([-10,0,right?armw:0]) cube([10,5,armw]); translate([-4,12,0]){ rotate([90,0,armangle]) translate([0,0,sin(armangle)*30]){ difference(){ union(){ translate([0,right?15:0,0]) cube([15,15,4]); translate([17,15,0]) cylinder(r=15,h=4); *translate([0,0,-15]) cube([30,0.5,30]); } union(){ translate([18,15,0]) rotate([0,0,45]){ cylinder(r=5,h=4); translate([9,0,0]) cylinder(r=screwr,h=4); translate([-9,0,0]) cylinder(r=screwr,h=4); translate([0,7.5,0]) cylinder(r=screwr,h=4); translate([0,-7.5,0]) cylinder(r=screwr,h=4); } } } } } } // The arm is broken in two to allow longer length. // arm_connect connects the two parts (arm-start and // arm-end together module arm(smallmotor,start,right){ thick=1.5; arm_start=start ? 0 : arml/2; pathout=[[0,0],[armw,0],[armw,3],[armw/2,armt],[0,3],[0,0]]; pathin=[[thick,thick],[armw-thick,thick],[armw-thick,3], [(armw)/2,armt-thick],[thick,3],[thick,thick]]; translate([0,0,right ? 30: 0]) rotate([0,right?180:0,0]){ translate([arm_start,0,right ? 30-armw : 0]) difference(){ translate([0,0,armw]) rotate([0,90,0]) linear_extrude(arml/2){ polygon(pathout); } union(){ translate([0,0,armw]) rotate([0,90,0]) linear_extrude(arml/2){ polygon(pathin); } if(!smallmotor){ translate([10,0,armw/2]) rotate([-90,0,0]) cylinder(r=threadr,h=4); } } } for(i=[0:2]){ translate([i*arml/5+arm_start-5,-5,right ? 30-0.5 : 0]){ cube([20,10,0.5]); } } // Holders for wires for (i=[0:1]){ depth=9; translate([i*arml/4+arm_start+20,-depth,right?armw:0]){ difference(){ cube([2,depth,armw]); translate([0,2,2]) cube([2,depth-2,armw-4]); } } } *translate([arml/2,-15,right ? 30-2 : 0]) cube([20,30,1]); if (start || smallmotor){ cube([10,5,30]); translate([-26,4,0]) rotate([90,0,armangle]) translate([0,0,sin(armangle)*30]){ difference(){ union(){ cube([30,30,4]); *translate([0,right ? 30-0.5 : 0,-15]) cube([30,0.5,30]); } translate([7,15,0]) rotate([0,0,-90]) armholes(4); } } } if (!start || smallmotor){ if (smallmotor){ translate([arml/2,0,0]){ arm_smallmotor(right); } }else{ translate([arml,0,0]){ arm_bigmotor(right); } } } } } module cpuholder(offx,cpuw){ // Evaluate the length between the mounting holes of the posts // in escholder // The posts are placed on the holder, so 2 mm of the post // are part of the escx and escy on each side. escx_p=escx+postw/2*2; escy_p=escy+postw/2*2; angle=atan2(escy_p,escx_p); len=sqrt(escx_p*escx_p+escy_p*escy_p); postw_2=postw/2; postheight=20; difference(){ union(){ translate([-escx_p/2,-escy_p/2,0]) rotate([0,0,angle]) escarm(len); translate([ escx_p/2,-escy_p/2,0]) rotate([0,0,180-angle]) escarm (len); cpuholder_square(offx,cpuw,postheight); } union(){ // We cut the front so the cpuholder will fit the top holders translate([-escx_p/2-12,-escy_p/2-10,0]) cube([10,100,4]); if (postheight <= 5){ cpuholder_posthole(offx,cpuw); } // Remove the useless escarm inside the multiwii area translate([offx,-cpuw/2,0]){ translate([7,7,0]) cube([cpuw-14,cpuw-14,3]); } } } } module standalone_cpuholder(){ cpuholder(-cpuw/2,false); } module oldtop(){ base(); } // Dummy components to see if the propeller have enough room module motorarm(){ //import ("/tmp/PARTS/Arms.stl"); motorh=25; translate([basex/2-20,basey/2-25,0]){ rotate([0,0,60]) translate([0,-10,0]){ difference(){ armthick=3; translate([0,0,-armthick]) cube([130,24,armthick]); rotate([0,0,270]) translate([-12,7,-armthick]) armholes(armthick+1); } translate([115,24/2,-basethick]){ cylinder(r=13,h=motorh); proplen=8.5*25; // 8.5 inch rotate([0,0,-20]) translate([-proplen/2,-8/2,motorh]) cube([8.5*25,8,8]); } } } } // Dummy receiver to show that it has enough room for the wires module receiver(lenconnector){ translate([lenconnector,0,0]) cube([recx,recy,rech]); cube([lenconnector-1,recy,rech]); } module all_notop(){ base1(basethick); translate([0,0,20]) base2(basethick); translate([-10,0,20+esch+5]) cpuholder(-15,false); translate([recpos+recx/2,-recy/2-postw,20+rech+10]) rectop(); base1_holder(basethick); } postray=15; postheight=60; module testpost(height,extra){ subray=postray-0.7; difference(){ cylinder(r=postray,h=height,$fn=40); translate([0,0,-1]) union(){ cylinder(r=postray-0.5,h=height-5,$fn=40); cylinder(r=subray-0.5,h=height+2,$fn=40); } } translate([0,0,height]){ difference(){ cylinder(r=subray,h=extra,$fn=40); cylinder(r=subray-0.5,h=height+20,$fn=40); } } } module testclip(){ baseh=10; difference(){ cylinder(r=postray,h=baseh,$fn=20); translate([0,0,-1]) cylinder(r=postray-0.5,h=baseh+2,$fn=40); } attachray=20; attachlen=70; difference(){ translate([-attachlen/2,0,attachray]) rotate([0,90,0]) cylinder(r=attachray,h=attachlen,$fn=40); union(){ cylinder(r=postray-0.5,h=baseh,$fn=20); translate([-attachlen/2-1,0,attachray]) rotate([0,90,0]) cylinder(r=attachray-0.5,h=attachlen+2,$fn=40); translate([-attachlen/2-1,-attachray,attachray]) cube([attachlen+2,attachray*2+2,attachray*2]); } } h=10; difference(){ union(){ translate([-attachlen/2,-attachray,attachray]) cube([attachlen,0.5,h]); translate([-attachlen/2,attachray-0.5,attachray]) cube([attachlen,0.5,h]); } offx=23; translate([0,-attachray-1,attachray+h/2]){ translate([-offx,0,0]) rotate([-90,0,0]) cylinder(r=5,h=2*attachray+2,$fn=40); translate([offx,0,0]) rotate([-90,0,0]) cylinder(r=5,h=2*attachray+2,$fn=40); } } } module main_view(view){ if (view=="base1"){ base1(basethick-1); }else if (view=="base1_holder"){ base1_holder(basethick); }else if (view=="base2"){ base2(basethick); }else if (view=="test_print_base2"){ // We punch holes to speed the printing. // We are only interested in testing dimensions thick=0.5; difference(){ base2(thick); union(){ translate([-basex/2+4,-basey/4,0]) cube([18,basey/2,thick]); translate([-40,-basey/2+20,0]) cube([58,basey-40,thick]); translate([30,-10,0]) cube([65,20,thick]); } } }else if (view=="test_print_base1"){ // We punch holes to speed the printing. // We are only interested in testing dimensions thick=0.5; difference(){ base1(thick); union(){ translate([-basex/2+4,-basey/4,0]) cube([24,basey/2,thick]); translate([basex/2-28,-basey/4,0]) cube([24,basey/2,thick]); translate([-basex/2+28,-basey/2,0]) cube([140,18,thick]); translate([-basex/2+28,basey/2-18,0]) cube([140,18,thick]); } } }else if (view=="test_base2"){ base2(basethick); translate([-10,0,20]) cpuholder(cpuoffsetx,false); offtop=30; translate([0,0,offtop+topheight0+basethick]) top(); translate([-toplen/2,0,offtop+topheight0+basethick]) fronttop(); motorarm(); wirelen=15; // How much space is needed for the wires translate([basex/2-2-recx-wirelen,-recy/2,basethick+5]) receiver(wirelen); translate([basex/2-20,0,-4]) landing(); }else if (view=="testbasetop"){ // Test to see if the top properly insert at the front translate([-50,0,0]){ intersection(){ base2(0.5); translate([toplen/2-10,-basey/2,0]) cube([15,basey,10]); } } translate([50,0,0]){ intersection(){ base2(0.5); translate([-toplen/2-15,-basey/2,0]) cube([20,basey,10]); } } }else if (view=="corner_spacer"){ corner_spacer(); }else if (view=="motorarm"){ motorarm(); }else if (view=="cpuholder-wii"){ cpuholder(cpuoffsetx,cpuw_wii); }else if (view=="cpuholder-naze"){ cpuholder(cpuoffsetx,cpuw_naze); }else if (view=="escholder"){ escholder(); }else if (view=="standalone_escholder"){ standalone_escholder(); }else if (view=="recholder"){ recholder(); }else if (view=="rectop"){ rectop(); }else if (view=="standalone_recholder"){ standalone_recholder(); }else if (view=="standalone_cpuholder"){ standalone_cpuholder(); }else if (view=="oldtop"){ oldtop(); }else if (view=="esccpu"){ escholder(); translate([0,0,esch+2]) standalone_cpuholder(); }else if (view=="batt_holder"){ batt_holder(15); }else if (view=="batt_holder_thin"){ batt_holder(7); }else if (view=="batt_plate"){ batt_plate(); }else if (view=="testholes"){ testholes(); }else if (view=="all_notop"){ all_notop(); }else if (view=="group_batt_holder_thin"){ batt_holder(7); translate([20,0,0]) batt_holder(7); }else if (view=="batt_plate"){ batt_plate(); }else if (view=="top"){ rotate([0,90,0]) top(); }else if (view=="fronttop"){ rotate([0,-90,0]) fronttop(); }else if (view=="test_top"){ escholder(); translate([0,0,25]) top(); translate([-75,0,25]) fronttop(); }else if (view=="arm-start-right"){ rotate([0,0,90]) arm(false,true,true); }else if (view=="arm-start-left"){ rotate([0,0,90]) arm(false,true,false); }else if (view=="arm-end-right"){ translate([0,arml,0]) rotate([0,0,90]) arm(false,false,true); }else if (view=="arm-end-left"){ translate([0,-arml,0]) rotate([0,0,90]) arm(false,false,false); }else if (view=="arm-smallmotor-left"){ rotate([0,0,90]) arm(true,true,false); }else if (view=="arm-smallmotor-right"){ rotate([0,0,90]) arm(true,true,true); }else if (view=="test-holes-smallmotor"){ intersection(){ translate([-40,arml/2+4,0]) cube([250,250,40]); rotate([0,0,90]) arm(true,true,false); } }else if (view=="arm-connect"){ rotate([90,0,0]) translate([0,1.5,0]) arm_connect(); }else if (view=="testpost"){ testpost(postheight,10); }else if (view=="testlock"){ testpost(10,20); difference(){ cylinder(r=postray+5,h=5,$fn=40); cylinder(r=postray-0.5,h=5,$fn=40); } }else if (view=="testclip"){ testclip (); }else if (view=="testclip-check"){ testclip (); translate([0,0,35]) rotate([180,0,0]) base1(3); }else if (view=="test-postconnect"){ intersection(){ cylinder(r=postray+2,h=12); translate([0,0,-postheight+5]) testpost(postheight); } }else{ // Anything else is all all_notop(); translate([0,0,mainposth+20+20]) top(); } }