Skip to content

Instantly share code, notes, and snippets.

@robbintt
Created November 6, 2017 07:20
Show Gist options
  • Save robbintt/5851832081d6cdfe841800a1e115446e to your computer and use it in GitHub Desktop.
Save robbintt/5851832081d6cdfe841800a1e115446e to your computer and use it in GitHub Desktop.
drone_chassis_openscad
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