/* This was an attempt to create a top for the quadcopter. Too complex to assemble. Fail. */ use <../cadlib.h> // printviews printback printcenter printfront // allviews printback printcenter printfront // allviews back center front wallfront //view="all"; //view="printcenter"; //view="printback"; view="front"; view="wallfront"; // A very limited front //view="back"; strongt=2.5; // Thickness if the strong section sloth=1; // Insertion slot height thint=0.25; // Slot tab thickness w=100; wh1=30; wh2=20; h1=35; h2=65; len=110; // The center goes below the floor profile1_fulltab=[ [-w/2+wh1,0] ,[-w/2,0],[-w/2,h1],[-w/4,h2] ,[w/4,h2],[w/2,h1],[w/2,0] ,[w/2-wh1,0]]; profile1_nofloor=[ [-w/2,0],[-w/2,h1],[-w/4,h2] ,[w/4,h2],[w/2,h1],[w/2,0] ]; profile1_halftab=[ [-w/2+wh2,0] ,[-w/2,0],[-w/2,h1],[-w/4,h2] ,[w/4,h2],[w/2,h1],[w/2,0] ,[w/2-wh2,0]]; // This back goes on the floor, not below, so it is shorter backoff=5; profile1_back=[ [-w/2,0],[-w/2,h1-backoff],[-w/4,h2-backoff] ,[w/4,h2-backoff],[w/2,h1-backoff],[w/2,0] ]; profile1_support=[ [-w/2,h1-10],[-w/2,h1],[-w/4,h2+2] ,[w/4,h2+2],[w/2,h1],[w/2,h1-10] ,[0,h2-2],[-w/2,h1-10] ]; wback=60; h1back=28-backoff; h2back=46-backoff; profile2_back=[ [-wback/2,0],[-wback/2,h1back],[-wback/4,h2back] ,[0,h2back+10] ,[wback/4,h2back],[wback/2,h1back],[wback/2,0] ]; // The front goes on the floor, not below, so it is shorter profile1_front=[ [-w/2,0],[-w/2,h1-backoff],[-w/4,h2-backoff] ,[w/4,h2-backoff],[w/2,h1-backoff],[w/2,0] ]; wfront=60; h1front=28-backoff; h2front=46-backoff; profile2_front=[ [-wfront/2,0],[-wfront/2,h1front],[-wfront/4,h2front] ,[0,h2front+10] ,[wfront/4,h2front],[wfront/2,h1front],[wfront/2,0] ]; //toit(); module center(){ difference(){ union(){ profile(profile1_halftab,len,thint,0,1); profile(profile1_fulltab,7,strongt,0,1); translate([0,len-7,0]) trace(profile1_fulltab,7,strongt,0,1); } union(){ profile(profile1_nofloor,4,sloth,0,0.5); translate([0,len-4,0]) profile(profile1_nofloor,4,sloth,0,0.5); } } } module screwtab(){ difference(){ cube([10,10,1]); union(){ translate([3,0,0]) cube([4,5,1]); translate([5,5,-1]) rotate([0,0,0]) cylinder(r=2,h=2); } } } module back(){ profile(profile1_back,3,thint,0,0.25); translate([0,-5,0]) profile(profile1_back,5,strongt,0,1.5); translate([0,-5,0]) profile(profile1_back,thint,20,-10,0.5); translate([0,-75,0]) profile(profile2_back,70,thint,0,0.5); translate([0,-75,0]) profile(profile2_back,thint,25,-25/2,0.5); rotate([90,0,0]) translate([0,-7,0]) linear_extrude(5) polygon(profile1_support); translate([20,-75+10,0]) rotate([0,0,180]) screwtab(); translate([-10,-75+10,0]) rotate([0,0,180]) screwtab(); } module front(){ len=30; // length of the lower part profile(profile1_front,3,thint,0,0.25); translate([0,3,0]) profile(profile1_front,5,strongt,0,1.5); translate([0,8,0]) profile(profile1_front,thint,20,-10,0.5); translate([0,8,0]) profile(profile2_front,len,thint,0,0.5); translate([0,len+8,0]) profile(profile2_front,thint,25,-25/2,0.5); rotate([90,0,0]) translate([0,-7,-8]) linear_extrude(5) polygon(profile1_support); translate([10,len+8-10,0]) screwtab(); translate([-20,len+8-10,0]) screwtab(); if (false){ translate([0,20+17,h2front]) rotate([90,0,0]) 3darc (wfront/4,0.5,30,180,360); } } module wallfront(){ len=30; // length of the lower part profile(profile1_front,4,thint,0,0.25); translate([0,4,0]) profile(profile1_front,5,strongt+2,0,2.5); difference(){ translate([0,8.5,0]) profile(profile1_front,0.5,40,-20,2.5); translate([-w/2+10,7,-1]) cube([w-20,10,7]); } difference(){ translate([0,-4,0]) profile(profile1_front,10,strongt+2,0,0); union(){ translate([0,-4,0]) profile(profile1_front,10,strongt,0,2.5); translate([0,-4,0]) profile(profile1_front,10,10,-5,2.5); } } } if (view=="center"){ center(); }else if (view=="back"){ back(); }else if (view=="front"){ front(); }else if (view=="printcenter"){ rotate([90,0,0]) center(); }else if (view=="printback"){ rotate([90,0,0]) back(); }else if (view=="printfront"){ rotate([90,0,0]) front(); }else if (view=="wallfront"){ rotate([-90,0,0]) translate([0,-8,0]) wallfront(); }else{ center(); translate([0,-10,backoff]) back(); translate([0,len+10,backoff]) front(); }