include; use ; use ; use ; use ; include; use; use<3D_printed_parts.scad>; /* 2D TO EXPORT TO .svg */ dim_2D = 0; /* MODULE */ module rib(alpha){ rotate([90,0,90]){ translate([-0.5*rib_external_chord_length,0,-0.5*alpha*rib_external_thick]){ airfoil(naca = rib_external_naca, L = rib_external_chord_length, N=101, h = alpha*rib_external_thick, open = false); } } } module rib_wing(alpha){ difference(){ rib(alpha); translate([pos_rib_servo_wing_disk_hole_x,pos_rib_servo_wing_disk_hole_y,pos_rib_servo_wing_disk_hole_z]){ rotate([0,90,0]) cylinder(h=alpha*rib_servo_wing_cylinder_hole_height,r=rib_servo_wing_cylinder_hole_diameter,center=true); } translate([0,rib_external_chord_length*0.5+pos_rib_servo_wing_disk_hole_y,0]) cube([alpha*rib_external_chord_length,rib_external_chord_length,rib_external_chord_length],center=true); } } module rib_servo_wing(alpha){ difference(){ rib_wing(alpha); for(i=[0:2]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } translate([pos_rib_servo_wing_hole_x,pos_rib_servo_wing_hole_y,pos_rib_servo_wing_hole_z]){ //rotate([0,0,90]) cube([2*rib_external_thick,servo_height,servo_width],center=true); } translate([0,-75,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } module rib_servo_aileron(){ translate([0,-50,-10]){ difference(){ rib(1); scale([1.0001,1.001,1.001]){ rib_wing(2); } translate([0,50,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=0.5*sqrt(2)*carbon_square_side,center=true); } } for(i=[-1,1]){ translate([0,60,10+i*7]){ cube([10,1,1],center = true); } } //translate([0,80,6.5]){ // rotate([-5,0,0]) // cube([10,25,5.1],center = true); // } translate([0,30,0]) rotate([90,0,0]) carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } module rib_aileron_front_foam(){ color("SteelBlue") rotate([0,90,0]) linear_extrude(height = 50, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ rib_wing(1); for(i=[0:2]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0,1]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } } } module rib_aileron_front_balsa(){ color("BurlyWood") rotate([0,90,0]) linear_extrude(height = 5, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ rib_wing(1); for(i=[0:2]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } translate([0,-75,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } } module rib_aileron_servo_left_foam(){ color("SteelBlue",0.5) difference(){ rotate([0,90,0]){ linear_extrude(height = 50, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ rib_wing(1); for(i=[0:2]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0,1]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } } } //translate([-100,-0.5*rib_external_chord_length+10,2]){ //rotate([90,0,90]){ // // airfoil(naca = rib_external_naca, L = rib_external_chord_length-30, N=101, h = alpha*rib_external_thick, open = false); // // } //} translate([-25,10,12]) cube([50,75,32],center=true); translate([-50,-25,12]) rotate([0,90,0]) cylinder(h=50,r=16); } } module rib_aileron_servo_right_foam(){ mirror(){ rib_aileron_servo_left_foam(); } } module rib_aileron_rear_foam(){ color("PowderBlue") rotate([0,90,0]) difference(){ linear_extrude(height = 50, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ translate([0,-50,-10]){ difference(){ rib(1); scale([1.0001,1.001,1.001]){ rib_wing(2); } translate([0,50,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=0.5*sqrt(2)*carbon_square_side,center=true); } } //translate([0,80,6.5]){ // rotate([-5,0,0]) // cube([10,25,5],center = true); // } } } } } } translate([0,30,0]) rotate([90,0,0]) carbon_tube_square(carbon_square_side,tube_carbon_length ); } } module rib_aileron_rear_balsa(){ color("Sienna") rotate([0,90,0]) linear_extrude(height = 5, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ translate([0,-50,-10]){ difference(){ rib(1); scale([1.0001,1.001,1.001]){ rib_wing(2); } translate([0,50,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=0.5*sqrt(2)*carbon_square_side,center=true); } } //translate([0,80,6.5]){ // rotate([-5,0,0]) // cube([10,25,5],center = true); // } } } translate([0,30,0]) rotate([0,0,90]) carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } } module rib_servo_rear_left_foam(){ color("SteelBlue",0.5) difference(){ rotate([0,90,0]) linear_extrude(height = 50, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ translate([0,-50,-10]){ difference(){ rib(1); scale([1.0001,1.001,1.001]){ rib_wing(2); } translate([0,50,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=0.5*sqrt(2)*carbon_square_side,center=true); } } //translate([0,80,6.5]){ // rotate([-5,0,0]) // cube([10,25,5],center = true); // } } } } } } translate([-50,-6,2]){ rotate([0,90,0]){ cylinder(h=50,r=16); } } translate([0,30,0]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } } module rib_servo_rear_right_foam(){ mirror(){ rib_servo_rear_left_foam(); } } module rib_full_foam(){ color("SteelBlue") difference(){ rotate([0,90,0]){ linear_extrude(height = 50, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ rib(1); for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0:2]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } } } } } module rib_full_balsa(){ color("BurlyWood") difference(){ rotate([0,90,0]){ linear_extrude(height = 5, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ difference(){ rib(1); for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0:2]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } } } } } module winglet_tip(){ color("SteelBlue") union(){ translate([-20.5,0,49.8]){ rotate([0,-45,0]){ linear_extrude(height = 100, center = true, convexity = 10, scale=0.5){ projection(cut = true){ rotate([0,180,0]) rotate([0,0,90]){ airfoil(naca = rib_external_naca, L = rib_external_chord_length, N=101, h = alpha*rib_external_thick, open = false); } } } } } translate([50,0,50]) rotate([0,90,90]){ rotate_extrude(angle = 45, convexity = 10) { translate([50,0,0]){ projection(cut = true){ rotate([0,0,90]) airfoil(naca = rib_external_naca, L = rib_external_chord_length, N=101, h = alpha*rib_external_thick, open = false); } } } } } } module rib_motor(){ difference(){ union(){ translate([0,-50,30]){ rotate([0,90,0]){ linear_extrude(height = 50, center = true, convexity = 10, twist = 0){ projection(cut = true) rotate([0,-90,0]){ rib(1); } /* for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0:2]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } }*/ } } } translate([0,-89,24]) rotate([-90,0,0]) cylinder(h=228,r1=25,r2=15,center=true); translate([0,149.99,24]) rotate([-90,0,0]) cylinder(h=250,r1=15,r2=9,center=true); translate([0,275,24]) sphere(r=9); } translate([0,250,24]) carbon_tube_square(carbon_square_side,tube_carbon_length ); for(i=[0:2]){ translate([0,-150+i*50,12]) junction_wing_motor(); } for(i=[0:3]){ translate([-220,-150+i*50,40]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } } } /* translate([0,-200,27]) rotate([-90,0,0]) rotate_extrude(angle = 360, convexity = 10) { translate([21.5,0,0]){ projection(cut = true){ rotate([0,0,90]) airfoil(naca = 4425, L = 100, N=101, h = alpha*rib_external_thick, open = false); } } } */ module rib_motor_left(){ //color("SteelBlue") difference(){ rib_motor(); translate([-30,80,20]){ cube([60,600,100],center=true); } } } module rib_motor_right(){ //color("SteelBlue") difference(){ rib_motor(); translate([30,80,20]){ cube([60,600,100],center=true); } } } module junction_wing_motor(){ difference(){ hull(){ for(i=[-1,1]){ for(j=[-1,1]){ translate([i*carbon_square_side,j*carbon_square_side,0]) cylinder(h=5*carbon_square_side,r=0.5*carbon_square_side); } } } translate([0,0,3.5*carbon_square_side]) rotate([0,0,90]) carbon_tube_square(carbon_square_side,tube_carbon_length ); translate([0,0,1.5*carbon_square_side]) carbon_tube_square(carbon_square_side,tube_carbon_length ); } } module sg90() { color([0,0,1,1]) difference() { union() { // Servo Body translate([pos_servo_x,pos_servo_y,pos_servo_z]) cube([servo_depth,servo_width,servo_height], center=true); // Servo Tab translate([pos_servo_tab_x,pos_servo_tab_y,pos_servo_tab_z]) cube([servo_tab_depth,servo_tab_width,servo_tab_height], center=true); // Servo Gears translate([pos_servo_gears_x,pos_servo_gears_y,pos_servo_gears_z]) { hull() { // Gear 1 translate([pos_servo_gear_1_x,pos_servo_gear_1_y,pos_servo_gear_1_z]) cylinder(d=servo_gear_1_diameter, h=servo_gear_1_height); // Gear 2 translate([pos_servo_gear_2_x,pos_servo_gear_2_y,pos_servo_gear_2_z]) cylinder(d=servo_gear_2_diameter, h=servo_gear_2_height); } // Gear 3 translate([pos_servo_gear_3_x,pos_servo_gear_3_y,pos_servo_gear_3_z]) cylinder(d=servo_gear_3_diameter, h=servo_gear_3_height); } } // Servo tab holes for(i=[-1,1]){ translate([i*pos_servo_tab_hole_x,pos_servo_tab_hole_y,pos_servo_tab_hole_z]) { cylinder(d=servo_tab_hole_diameter, h=servo_tab_hole_height); } } } //Gear Servo Fastener color([1,1,1,1]) translate([pos_servo_gear_fastener_x,pos_servo_gear_fastener_y,pos_servo_gear_fastener_z]) { difference() { cylinder(d=servo_gear_fastener_diameter, h=servo_gear_fastener_height); translate([pos_servo_gear_fastener_hole_x,pos_servo_gear_fastener_hole_y,pos_servo_gear_fastener_hole_z]) cylinder(d=servo_gear_fastener_diameter_hole, h=servo_gear_fastener_height_hole); } } } module sg90_f2() { color("white") difference() { union() { linear_extrude(height=1.4) difference() { hull() { circle(d=6); translate([10,0]) circle(d=4); translate([-10,0]) circle(d=4); } for (i=[0:3]) { translate([4+i*2,0]) circle(d=1); translate([-4-i*2,0]) circle(d=1); } } cylinder(d=6.7, h=3.8); } //Extend 1mm in each open direction to prevent surfaces from being inside of each other translate([0,0,-1]) cylinder(d=2.5, h=3.8+2); translate([0,0,-1]) cylinder(d=4.7, h=1+1); translate([0,0,3.8-2+1]) cylinder(d=4.7, h=2+1); } } module wing_tip_dart(){ color("SteelBlue") //union(){ rotate([0,90,0]){ linear_extrude(height = 20, center = true, convexity = 10, twist = 0){ projection(cut = true){ rotate([0,-90,0]){ difference(){ rib(1); translate([0,-3,3]) scale([2,0.8,0.7]) rib(1); } } } } } hull(){ translate([10,-200,7]) rotate([0,90,0]) cylinder(h=10,r=7,center=true); for(i=[-1,1]){ translate([10,150,7+60*i]) rotate([0,90,0]) cylinder(h=10,r=7,center=true); } } //} for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0:3]){ translate([-20,-100+i*50,10]){ rotate([0,0,90]){ fastener_carbon_upper_v1(); fastener_carbon_lower_extended_vertical_v1(); } } } translate([-200,0,0]) screw("M3x20"); } module wing_tip(){ hull(){ translate([0,0,0]) rotate([0,90,0]){ linear_extrude(height = 5, center = true, convexity = 10, twist = 0){ projection(cut = true){ rotate([0,-90,0]){ rib(1); } } } } translate([30,-50,10]){ scale([0.04*rib_external_chord_length,0.25*rib_external_chord_length,0.04*rib_external_chord_length]) sphere(r=1); } } } module wing_tip_ellipsoid(){ union(){ difference(){ wing_tip(); translate([-1,0,0]) scale([0.9,0.9,0.9]) wing_tip(); } translate([3,-150,0]) rotate([0,90,0]) difference(){ cube([14,20,3],center=true); translate([0,3,2]) cylinder(h=4,r=5.05,center=true); } } } module wing_tip_in(){ rotate([0,90,0]){ linear_extrude(height = 5, center = true, convexity = 10, twist = 0){ projection(cut = true){ rotate([0,-90,0]){ rib(1); } } } } } module wing_tip_inside(){ color("DimGray",0.9) difference(){ union(){ wing_tip_in(); translate([2.5,0,0]){ scale([0.9,0.9,0.9]) wing_tip_in(); } } for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } translate([-1,-150,0]) rotate([0,90,0]) cylinder(h=5,r=5.05,center=true); } } module rib_landing_gear(){ pos_landing_gear_y = [-100,-100,0]; pos_landing_gear_z = [-6,-100,-6]; // pos_cylinder_center_hide = [] color("BurlyWood") difference(){ union(){ rotate([0,90,0]){ linear_extrude(height = 5, center = true, convexity = 10, twist = 0){ projection(cut = true){ rotate([0,-90,0]){ difference(){ // union(){ // hull(){ // translate([0,-125,50]) // rotate([0,90,0]) // cylinder(h=5,r=5,center=true); // translate([0,75,50]) // rotate([0,90,0]) // cylinder(h=5,r=5,center=true); // translate([0,-145,20]) // rotate([0,90,0]) // cylinder(h=5,r=5,center=true); // translate([0,95,20]) // rotate([0,90,0]) // cylinder(h=5,r=5,center=true); // } rib(1); // } for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0:2]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } } } } hull(){ for(i=[0:2]) translate([0,pos_landing_gear_y[i],pos_landing_gear_z[i]]) rotate([0,90,0]) cylinder(h=5,r=8,center=true); } } for(i=[0:6]){ if(i==3){ translate([0,-60-3.5*5,-20-3*10]){ cube([10,70-3.5*10,5],center=true); } } else{ translate([0,-60-i*5,-20-i*10]){ cube([10,70-i*10,5],center=true); } } } translate([0,-100,-100]){ rotate([0,90,0]){ cylinder(h=10,r=screw_body_radius,center=true); } } translate([0,-50,-50]){ rotate([0,90,0]){ cylinder(h=10,r=screw_body_radius,center=true); } } } } module rib_central_wood(){ color("BurlyWood") difference(){ translate([0,-50,0]) cube([5,250,50],center=true); for(i=[0:3]){ translate([0,-100+i*50,10]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } for(i=[0:2]){ translate([0,-75+50*i,10]){ rotate([0,90,0]){ cylinder(h=2*rib_external_thick,r=carbon_square_side,center=true); } } } } } module rib_rear(alpha){ rotate([90,0,90]){ translate([-0.25*rib_external_chord_length,0,-0.5*alpha*rib_external_thick]){ airfoil(naca = 0014, L = 0.5*rib_external_chord_length, N=101, h = alpha*rib_external_thick, open = false); } } } module rib_wing_rear(alpha){ difference(){ rib_rear(alpha); translate([0,10,0]){ rotate([0,90,0]) cylinder(h=alpha*rib_servo_wing_cylinder_hole_height,r=10,center=true); } translate([0,50,0]) cube([20,80,20],center=true); } } module rib_aileron_rear(){ color("SteelBlue",0.5) difference(){ rib_rear(1); scale([1.1,1.1,1.1]) rib_wing_rear(2); } } module rib_rear_front(){ difference(){ rib_wing_rear(1); translate([0,-50,0]) rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } translate([0,-15,0]) rotate([0,90,0]){ cylinder(h=100,r = sqrt(2)*0.5*carbon_square_side,center=true); } // translate([0,-70,0]) // rotate([0,0,90]){ // carbon_tube_square(carbon_square_side,tube_carbon_length ); // } } } module rib_balsa_servo_rear(){ difference(){ rib_rear_front(); translate([0,-25,0]) cube([2*rib_external_thick,servo_height,servo_width],center=true); } } module rib_aileron_servo_rear(){ difference(){ rib_aileron_rear(); translate([0,10,0]) rotate([0,90,0]){ cylinder(h=10,r = sqrt(2)*0.5*carbon_square_side,center=true); } translate([0,35,0]) rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } module rib_rear_foam_full(){ difference(){ rotate([0,90,0]){ translate([0,0,-25]){ linear_extrude(50){ projection(cut=true){ rotate([0,90,0]){ rib_rear(1); } } } } } for(i=[-50,10]){ translate([0,i,0]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } translate([0,-15,0]) rotate([0,90,0]){ cylinder(h=100,r = sqrt(2)*0.5*carbon_square_side,center=true); } } } module rib_rear_aileron_foam(){ rotate([0,90,0]){ translate([0,0,-25]){ linear_extrude(50){ projection(cut=true){ rotate([0,90,0]){ rib_aileron_servo_rear(); } } } } } } module rib_rear_aileron_foam_hollow_right(){ difference(){ rib_rear_aileron_foam(); translate([25,0,0]) cube([50,20,15],center=true); } } module rib_rear_aileron_foam_hollow_left(){ mirror(){ rib_rear_aileron_foam_hollow_right(); } } module rib_rear_front_foam(){ rotate([0,90,0]){ translate([0,0,-25]){ linear_extrude(50){ projection(cut=true){ rotate([0,90,0]){ rib_rear_front(); } } } } } } module rib_rear_front_foam_hollow_right(){ difference(){ rib_rear_front_foam(); translate([25,0,0]) cube([50,87,15],center=true); } } module rib_rear_front_foam_hollow_left(){ mirror(){ rib_rear_front_foam_hollow_right(); } } module rear_wing_tip(){ hull(){ rib_rear(1); translate([-10,-30,0]) scale([1,5,1]) sphere(r=5); } } module rear_wing_tip_ext(){ difference(){ rear_wing_tip(); translate([1,0,0]) scale([0.9,0.9,0.9]) rear_wing_tip(); } } module rear_wing_tip_inside(){ color("DimGray",0.9) difference(){ union(){ rib_rear(1); translate([-2.5,0,0]){ scale([0.9,0.9,0.9]) rib_rear(1); } } for(i=[-50,10]){ translate([0,i,0]){ rotate([0,0,90]){ carbon_tube_square(carbon_square_side,tube_carbon_length ); } } } // translate([-1,-150,0]) // rotate([0,90,0]) // cylinder(h=5,r=2.5,center=true); } } mirror() rear_wing_tip_inside(); //translate([-40,0,0]) //mirror() //rear_wing_tip_ext(); //rear_wing_tip(); //rotate([0,-90,0]) //rib_rear_front_foam_hollow_right(); //projection(cut=true) //rotate([0,90,0]) //rib_rear_front_foam(); //rib_rear_aileron_foam_hollow_right(); //rib_rear_aileron_foam(); //rib_rear_foam_full(); //rib_aileron_servo_rear(); //rib_balsa_servo_rear(); //translate([0,10,0]) // rotate([0,0,90]){ // carbon_tube_square(carbon_square_side,tube_carbon_length ); // } //rib_aileron_rear(); // rib_wing_rear(1); // rib_rear(1); // rib_wing(1); //rib_servo_wing(1); //projection(cut=true) //rotate([0,90,0]) //rib_landing_gear(); //rib_central_wood(); //mirror() //wing_tip_inside(); //wing_tip_ellipsoid(); //wing_tip_dart(); //projection(cut=true) //rotate([0,-90,0]) //rib_servo_aileron(); //rib_to_servo_wing(1); //rib_aileron_front_balsa(); //projection(cut=true) //rotate([0,-90,0]) //rib_aileron_front_foam(); // //translate([27.5,0,0]) //rotate([0,-90,0]) //rib_aileron_servo_left_foam(); //rotate([0,-90,0]) //rib_aileron_servo_right_foam(); //projection(cut=true) //rotate([0,-90,0]) //rib_aileron_rear_foam(); //projection(cut=true) //rotate([0,90,0]) ////rib_aileron_rear_balsa(); //rib_servo_rear_left_foam(); //rib_servo_rear_right_foam(); //projection(cut=true) //rotate([0,90,0]) //rib_full_foam(); //rib_full_balsa(); //mirror([1,0,0]){ //winglet_tip(); //} // //rib_motor(); //rib_motor_left(); //rib_motor_right(); /* translate([0,250,24]) carbon_tube_square(carbon_square_side,tube_carbon_length ); for(i=[0:2]){ translate([0,-150+i*50,12]) junction_wing_motor(); } */ // scale([0.3,0.3,0.3]) //projection(cut = true) // rotate([0,-90,0]){ // rib(1); // }