|
|
@@ -1,6 +1,33 @@
|
|
|
include <../config/plate.scad>
|
|
|
include <ATX.scad>
|
|
|
|
|
|
+function plate_mount_holes_pattern() = [
|
|
|
+ [
|
|
|
+ -plate_mount_width / 2 + plate_mount_rounding,
|
|
|
+ plate_mount_depth / 2 - plate_mount_rounding - plate_mount_small
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ -plate_mount_width / 2 + plate_mount_rounding,
|
|
|
+ -plate_mount_depth / 2 + plate_mount_rounding + plate_mount_small
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 0,
|
|
|
+ plate_mount_depth / 2 - plate_mount_rounding - plate_mount_small / 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 0,
|
|
|
+ -plate_mount_depth / 2 + plate_mount_rounding + plate_mount_small / 2
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ plate_mount_width / 2 - plate_mount_rounding,
|
|
|
+ plate_mount_depth / 2 - plate_mount_rounding
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ plate_mount_width / 2 - plate_mount_rounding,
|
|
|
+ -plate_mount_depth / 2 + plate_mount_rounding
|
|
|
+ ]
|
|
|
+];
|
|
|
+
|
|
|
module plate_shape() {
|
|
|
size = plate_size;
|
|
|
holes = plate_holes;
|
|
|
@@ -41,7 +68,74 @@ module plate_shape() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ module mount_shape(position = [0, 0], mirrored = false, scaled = false) {
|
|
|
+ if (mirrored) {
|
|
|
+ mirror([1, 0]) {
|
|
|
+ mount_shape(mirrored = false);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+
|
|
|
+ width = plate_mount_width;
|
|
|
+ depth = plate_mount_depth;
|
|
|
+ small = plate_mount_small;
|
|
|
+ rounding = plate_mount_rounding;
|
|
|
+ hole_scale = plate_mount_hole_scale;
|
|
|
+ hole = plate_mount_hole;
|
|
|
+
|
|
|
+ move_x = width / 2 - rounding;
|
|
|
+ move_y_big = depth / 2 - rounding;
|
|
|
+ move_y_small = move_y_big - small;
|
|
|
+
|
|
|
+ translate(position) {
|
|
|
+ difference() {
|
|
|
+ hull() {
|
|
|
+ translate([move_x, move_y_big]) {
|
|
|
+ circle(r = rounding);
|
|
|
+ }
|
|
|
+
|
|
|
+ translate([move_x, -move_y_big]) {
|
|
|
+ circle(r = rounding);
|
|
|
+ }
|
|
|
+
|
|
|
+ translate([-move_x, move_y_small]) {
|
|
|
+ circle(r = rounding);
|
|
|
+ }
|
|
|
+
|
|
|
+ translate([-move_x, -move_y_small]) {
|
|
|
+ circle(r = rounding);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!scaled) {
|
|
|
+ scale(hole_scale) {
|
|
|
+ mount_shape(scaled = true);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (count = plate_mount_holes_pattern()) {
|
|
|
+ translate(count) {
|
|
|
+ circle(r = hole / 2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ mount_move_x
|
|
|
+ = plate_mount_width / 2
|
|
|
+ + plate_size.x / 2
|
|
|
+ + plate_padding;
|
|
|
+
|
|
|
shape_with_mobo_mount();
|
|
|
+
|
|
|
+ translate([mount_move_x, 0]) {
|
|
|
+ mount_shape(mirrored = true);
|
|
|
+ }
|
|
|
+
|
|
|
+ translate([-mount_move_x, 0]) {
|
|
|
+ mount_shape(mirrored = false);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
module plate_object() {
|