Browse Source

Add plate mount.

Cixo 1 year ago
parent
commit
80f5631eed
2 changed files with 100 additions and 0 deletions
  1. 94 0
      assets/plate.scad
  2. 6 0
      config/plate.scad

+ 94 - 0
assets/plate.scad

@@ -1,6 +1,33 @@
 include <../config/plate.scad>
 include <../config/plate.scad>
 include <ATX.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() {
 module plate_shape() {
     size = plate_size;
     size = plate_size;
     holes = plate_holes;
     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();
     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() {
 module plate_object() {

+ 6 - 0
config/plate.scad

@@ -1,5 +1,11 @@
 plate_size = MINI_ITX_SIZE();
 plate_size = MINI_ITX_SIZE();
 plate_hole = MINI_ITX_HOLE();
 plate_hole = MINI_ITX_HOLE();
 plate_holes = MINI_ITX_HOLES();
 plate_holes = MINI_ITX_HOLES();
+plate_mount_width = 60;
+plate_mount_depth = 70;
+plate_mount_small = 10;
+plate_mount_rounding = 5;
+plate_mount_hole_scale = 0.5;
+plate_mount_hole = 3;
 plate_padding = 5;
 plate_padding = 5;
 plate_thickness = 3;
 plate_thickness = 3;