bar_length = 26; bar_height = 0.5; bar_width = 1; n = 10; resolution = 40; prop_height = 3; cage_count = 5; //must divide into n prop_thickness = 0.2; or = bar_width/2; ir = or - prop_thickness; thresh = 0.04; //assert(n % cage_interval == 0); //make the basic chassis module create_bar(rotation){ intersection(){ //the bars on which the rotors will be mounted rotate([0, 90, rotation]) { cylinder(r=bar_height, h=bar_length, center=true, $fn = resolution); } translate([0, 0, -bar_width/2.0]){ rotate([0, 0, rotation]) { cube([bar_length,bar_width,bar_height],center=true); } } } } module create_circle(rotation){ rotate([90, 0, rotation]) rotate_extrude(convexity = 10, $fn = resolution) translate([bar_length/2, 0, 0]) circle(r = bar_height/4, $fn = resolution); } module create_prop_holder(rotation){ rotate([0, 0, rotation]) translate([bar_length / 3, 0, bar_height / 2.0]) union(){ cylinder(h=prop_height/3, r=or, center=true, $fn = resolution); translate([0, 0, prop_height / 3]) cylinder(h=prop_height/3, r=ir, center=true, $fn = resolution); translate([0, 0, prop_height * 2 / 3]) cylinder(h=prop_height/3, r=or, center=true, $fn = resolution); } } module set_props(rotation){ rotate([0, 0, rotation]) translate([bar_length / 3, 0, bar_height / 2.0]) translate([0, 0, prop_height / 3]) union(){ difference(){ scale([0.1, 0.1, 0.1]) import("C:\\Prop.stl", convexity=5); cylinder(h=prop_height/3, r=or, center=true, $fn = resolution); } difference(){ cylinder(h=prop_height/3 - thresh*2, r=or, center=true, $fn = resolution); cylinder(h=prop_height/3 - thresh*2, r=ir + thresh, center=true, $fn = resolution); } } } module assemble(){ //make the outer cage union(){ for ( i = [0 : n] ) { rotation = 360 * i / n; create_bar(rotation); } for (i = [0 : cage_count]){ rotation = 360 * i / cage_count; create_circle(rotation); } for (i = [0 : n]){ rotation = 360 * i / n; create_prop_holder(rotation); } for (i = [0 : n]){ rotation = 360 * i / n; set_props(rotation); } } } assemble();