/* This is a modular wing. This produces regular wing (same profile all accross). Each module plugs into a similar one, extending the wing. */ depth=100; // Everything is computed based on this number // It represents the distance from the front of the wing to the end. profile_w = 3; // width of the robust part of the profile profile_hw = 7; // width of the weak part of the profile profile_hwo=20; // width of the weak oversize part of the profile angletop=20; module arc(ray,angle_start,angle_end,thick,width){ difference(){ // First we draw the full cylinder, but with a hole difference(){ cylinder(h=width,r=ray); cylinder(h=width,r=ray-thick); } // Then using cubes, we remove the unwanted part. // We have to use 3 cubes. One large to cleanup most of the unwanted // cylinder and two small to make the cut perpendicular. { // First cube is running from one end of the arc to the other subray=ray-thick; translate([cos(angle_start)*subray,sin(angle_start)*subray,0]){ diff_angle = angle_end - angle_start; rotate(a=angle_start+diff_angle/2+90) translate([0,-ray,0]) cube([2*sin(diff_angle/2)*subray,ray,width+1]); } // The other cube are running from the center of the cylinder to the outside // using a suitable thickness to make the cut perpendicular. // Now for large angle, using the thick parameter is not enough // and for small angle, it is too small. rotate (a=angle_start) cube ([ray,thick,width]); rotate (a=angle_end) translate([0,-thick,0]) cube ([ray,thick,width]); } } } module profile(thick,width){ // the nose is simply a round // The bottom of the wing is flat. // The top of the wing raise a little and then goes meat the end // The end is simply the connection between the top and the bottom ray=depth/5; difference(){ cylinder(h=width,r=ray); { cylinder(h=width,r=ray-thick); translate([-ray,0,0]) cube([ray*2,ray,width]); } } // bottom translate([ray-thick,0,0]) cube ([thick,depth,width]); // top raise rlen=depth/5; translate([-cos(angletop)*ray,-sin(angletop)*ray,0]){ rotate (a=10){ cube([thick,rlen,width]); // top connect // translate([-(ray+sin(angletop)*rlen)+thick,-sin(angletop)*ray+rlen,0]) translate([0,rlen,0]){ rotate (a=-34) cube([thick,depth,width]); } } } } arc(20,20,180,3,10); if(false){ profile(profile_w,profile_w); translate([0,0,-profile_hw]) profile(0.5,profile_hw); translate([0,0,-(profile_hw+profile_hwo)]) profile (0.25,profile_hwo); }