Forráskód Böngészése

Continue work on plate.

cixo 1 éve
szülő
commit
c48c16dd47
3 módosított fájl, 55 hozzáadás és 3 törlés
  1. 8 1
      assets/ATX.scad
  2. 42 1
      assets/plate.scad
  3. 5 1
      config/plate.scad

+ 8 - 1
assets/ATX.scad

@@ -3,5 +3,12 @@ function MICRO_ATX_SIZE() = [244, 244];
 function ATX_SIZE() = [305, 244];
 
 function MINI_ITX_HOLES() = [
-    [
+    [-78.65, 74,84],
+    [78.83, 51.98],
+    [-78.65, -80.78],
+    [78.83, -80.78]
 ];
+
+function MINI_ITX_HOLE() = 3;
+function MICRO_ATX_HOLE() = 3;
+function ATX_HOLE() = 3;

+ 42 - 1
assets/plate.scad

@@ -2,9 +2,50 @@ include <../config/plate.scad>
 include <ATX.scad>
 
 module plate_shape() {
+    size = plate_size;
+    holes = plate_holes;
+    padding = plate_padding;
+    hole = plate_hole;
 
+    module corner(x = 0, y = 0) {
+        translate([x, y]) {
+            circle(r = padding);
+        }
+    }
+
+    module board_mount_hole(hole = [0, 0]) {
+        translate(hole) {
+            circle(r = hole / 2);
+        }
+    }
+
+    module base_shape() {
+        hull() {
+            move_x = size[0] / 2;
+            move_y = size[1] / 2;
+
+            corner(move_x, move_y);
+            corner(-move_x, move_y);
+            corner(move_x, -move_y);
+            corner(-move_x, -move_y);
+        }
+    }
+
+    module shape_with_mobo_mount() {
+        difference() {
+            base_shape();
+            
+            for (hole = holes) {
+                board_mount_hole(hole);  
+            }
+        }
+    }
+
+    shape_with_mobo_mount();
 }
 
 module plate_object() {
-    
+    linear_extrude(height = plate_thickness, center = true) {
+        plate_shape();
+    }   
 }

+ 5 - 1
config/plate.scad

@@ -1 +1,5 @@
-
+plate_size = MINI_ITX_SIZE();
+plate_hole = MINI_ITX_HOLE();
+plate_holes = MINI_ITX_HOLES();
+plate_padding = 5;
+plate_thickness = 3;