Created
November 6, 2017 07:20
-
-
Save robbintt/5851832081d6cdfe841800a1e115446e to your computer and use it in GitHub Desktop.
drone_chassis_openscad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c_diam = 6.9; | |
c_rad = c_diam/2; | |
// this comes from the projection of the length | |
// of the rectangle onto the axis (the rectangle's | |
// corner is on the origin and it is at 45 deg | |
// so follows: 2a^2 = c^2 which reduces to sqrt(2)*a = c | |
// final form is a=c/sqrt(2) | |
l1_projected = 107.9/sqrt(2); | |
l2_projected = 16.9/sqrt(2); | |
// this is used because you have to subtract the projection | |
// of the overhang after mirroring the part. | |
mirror_distance = l1_projected-l2_projected; | |
translate([mirror_distance,0,0]) { | |
rotate([0,180,-45]) { | |
// this is the rectangle with holes, fundamental unit | |
difference() { | |
difference() { | |
square(size = [107.9, 16.9], center = false); | |
translate([5,5,0]) { | |
translate([c_rad, c_rad, 0]) { | |
circle(d=c_diam); | |
} | |
} | |
// this translates from the center point of the circle | |
// so you don't have to include the circle radius in | |
// the translation from 0,0 | |
translate([(91+5),5,0]) { | |
translate([c_rad, c_rad, 0]) { | |
circle(d=c_diam); | |
} | |
} | |
} | |
} | |
} | |
} | |
rotate([0,0,45]) { | |
// this is the rectangle with holes, fundamental unit | |
difference() { | |
difference() { | |
square(size = [107.9, 16.9], center = false); | |
translate([5,5,0]) { | |
translate([c_rad, c_rad, 0]) { | |
circle(d=c_diam); | |
} | |
} | |
// this translates from the center point of the circle | |
// so you don't have to include the circle radius in | |
// the translation from 0,0 | |
translate([(91+5),5,0]) { | |
translate([c_rad, c_rad, 0]) { | |
circle(d=c_diam); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment