--- /dev/null
+eps = 0.01;
+infty = 300;
+
+stem_len = 90;
+stem_d = 12;
+stem_d2 = 2;
+stem_x = 12;
+
+stem_hole_w = 4;
+stem_hole_h = 12;
+
+module stem_profile() {
+difference() {
+ translate([0, 0, stem_d/2])
+ hull() {
+ rotate([0, 90, 0])
+ scale([1.5, 1, 1])
+ cylinder(r = stem_d/2, h = stem_len, $fn = 64);
+ rotate([0, 90, 0])
+ translate([-stem_x-stem_d2/2, 0, 0])
+ cylinder(r = stem_d2/2, h = stem_len, $fn = 16);
+ }
+ translate([-infty/2, -infty/2, -infty]) cube(infty);
+ translate([-eps, -stem_hole_w/2, -eps])
+ cube([stem_len + 2*eps, stem_hole_w, stem_hole_h + 2*eps]);
+}
+}
+
+motor_d = 28; // unused here, just for reference
+motor_screw_dist = 12.5;
+motor_screw_d = 3 + 0.5;
+motor_screw_head = 5 + 0.5;
+motor_center_hole = 8 + 2;
+motor_wall = 2.5;
+motor_plate_h = 2.5; // base thickness of the motor mount
+
+module motor_mount_body() {
+ // make it symmetrical in both axes
+ for (x = [-1,1]) scale([x, 1, 1])
+ for (y = [-1,1]) scale([1, y, 1]) {
+ hull() { // bottom plate with motor mount
+ cylinder(r = motor_center_hole/2 + motor_wall,
+ h = motor_plate_h);
+ translate([motor_screw_dist/2, motor_screw_dist/2, 0])
+ cylinder(r = motor_screw_d/2 + motor_wall,
+ h = motor_plate_h);
+ }
+ }
+}
+
+module motor_mount_square() {
+ translate([-motor_screw_dist/2-motor_screw_d/2-motor_wall,
+ -motor_screw_dist/2-motor_screw_d/2-motor_wall, 0])
+ cube([motor_screw_dist + motor_screw_d + 2*motor_wall,
+ motor_screw_dist + motor_screw_d + 2*motor_wall,
+ motor_plate_h]);
+}
+
+screw_hole_h = 20;
+module motor_mount_holes() {
+ // center hole
+ translate([0, 0, -eps])
+ cylinder(r = motor_center_hole/2, h = 2*motor_plate_h + 2*eps);
+ // make it symmetrical in both axes
+ for (x = [-1,1]) scale([x, 1, 1])
+ for (y = [-1,1]) scale([1, y, 1]) {
+ // screw hole
+ translate([motor_screw_dist/2, motor_screw_dist/2, -eps])
+ cylinder(r = motor_screw_d/2, h = screw_hole_h+eps);
+ // screw head cone
+ translate([motor_screw_dist/2, motor_screw_dist/2, motor_plate_h - (motor_screw_head - motor_screw_d)/2])
+ cylinder(r1 = motor_screw_d/2, r2 = motor_screw_head/2, h = (motor_screw_head - motor_screw_d)/2 + eps);
+ // screw top (for subtracting from other objects
+ translate([motor_screw_dist/2, motor_screw_dist/2, motor_plate_h])
+ cylinder(r = motor_screw_head/2, h = screw_hole_h - motor_plate_h);
+ }
+ // cut the bottom
+ translate([-infty/2, -infty/2, -infty]) cube(infty);
+}
+
+mount_angle = -110;
+
+difference() {
+ union() {
+ stem_profile();
+ translate([stem_len, 0, 0])
+ rotate([0, mount_angle, 0])
+ translate([motor_screw_dist/2 + motor_screw_d/2 + motor_wall, 0, 0])
+ motor_mount_square();
+ }
+ translate([stem_len, 0, 0])
+ rotate([0, mount_angle, 0])
+ translate([motor_screw_dist/2 + motor_screw_d/2 + motor_wall, 0, 0])
+ rotate([0, 0, 90]) // rotate the hexagons
+ motor_mount_holes($fn = 6);
+ // cut the bottom of the rotated motor plate
+ translate([-infty/2, -infty/2, -infty]) cube(infty);
+ // angled rear end
+ rotate([0, 45, 0])
+ translate([-infty, -infty/2, -infty/2]) cube(infty);
+}