Bladeren bron

Start working on mount for motherboard.

Cixo Develop 11 maanden geleden
bovenliggende
commit
bbe0ababf0

+ 8 - 0
case/assets/ATX.scad

@@ -0,0 +1,8 @@
+function ATX_mini_itx_size() = [ 170, 170 ];
+function ATX_mini_itx_holes_diameters() = 3;
+function ATX_mini_itx_holes() = [
+    [-78.65, 74,84],
+    [78.83, 51.98],
+    [-78.65, -80.78],
+    [78.83, -80.78] 
+];

+ 6 - 0
case/assets/functions.scad

@@ -0,0 +1,6 @@
+function square_vector(width, height, rounding = 0) = [
+    [-width / 2 + rounding, height / 2 - rounding],
+    [width / 2 - rounding, height / 2 - rounding],
+    [-width / 2 + rounding, -height / 2 + rounding],
+    [width / 2 - rounding, -height / 2 + rounding],
+];

+ 35 - 0
case/assets/pattern.scad

@@ -0,0 +1,35 @@
+include <../config/pattern.scad>
+
+module pattern(width, height) {
+    module single() {
+        move_x = pattern_size_x / 2 - pattern_width / 2;
+        move_y = pattern_size_y / 2 - pattern_width / 2;
+
+        hull() {
+            translate([-move_x, move_y]) {
+                circle(d = pattern_width);
+            }
+
+            translate([move_x, -move_y]) {
+                circle(d = pattern_width);
+            }
+        }
+    }
+
+    move_x = pattern_size_x + pattern_space_x;
+    move_y = pattern_size_y + pattern_space_y;
+   
+    abs_width = width - (width % move_x);
+    abs_height = height - (height % move_y);
+
+    corner_x = abs_width / 2 - move_x / 2;
+    corner_y = abs_height / 2 - move_y / 2;
+
+    for (count_x = [-corner_x : move_x : corner_x]) {
+        for (count_y = [-corner_y : move_y : corner_y]) {
+            translate([count_x, count_y]) {
+                single();
+            }
+        }
+    }
+}

+ 55 - 0
case/assets/top.scad

@@ -0,0 +1,55 @@
+include <ATX.scad>
+include <pattern.scad>
+include <functions.scad>
+include <../config/global.scad>
+include <../config/top.scad>
+
+module top_shape() {
+    padding = top_padding;
+    rounding = top_rounding;
+    motherboard_size = top_motherboard_size;
+    motherboard_holes_positions = top_motherboard_holes;
+    motherboard_hole = top_motherboard_holes_diameters;
+
+    module corner(move = [0, 0]) {
+        translate(move) {
+            circle(r = rounding);
+        }
+    }
+
+    module base_shape() {
+        width = motherboard_size.x + padding * 2;
+        height = motherboard_size.y + padding * 2;
+    
+        hull() {
+            for (count = square_vector(width, height, rounding)) {
+                corner(count);
+            }
+        }
+    }
+
+    module motherboard_holes() {
+        translate([0, padding]) {
+            for (count = motherboard_holes_positions) {
+                translate(count) {
+                    circle(d = motherboard_hole);
+                }
+            }
+        }
+    }
+
+    difference() {
+        base_shape();
+        motherboard_holes();
+    
+        if (top_pattern) {
+            pattern(motherboard_size.x, motherboard_size.y);
+        }
+    }
+}
+
+module top_object() {
+    linear_extrude(center = true, height = plywood_thickness) {
+        top_shape();
+    }
+}

+ 3 - 0
case/config/global.scad

@@ -0,0 +1,3 @@
+plywood_thickness = 3;
+default_padding = 10;
+default_rounding = 5;

+ 5 - 0
case/config/pattern.scad

@@ -0,0 +1,5 @@
+pattern_size_x = 40;
+pattern_size_y = 40;
+pattern_space_x = 10;
+pattern_space_y = 10;
+pattern_width = 10;

+ 7 - 0
case/config/top.scad

@@ -0,0 +1,7 @@
+top_padding = default_padding;
+top_rounding = default_rounding;
+top_pattern = true;
+
+top_motherboard_size = ATX_mini_itx_size();
+top_motherboard_holes = ATX_mini_itx_holes();
+top_motherboard_holes_diameters = ATX_mini_itx_holes_diameters();

+ 1 - 0
case/renders/render_options.scad

@@ -0,0 +1 @@
+$fn = 40;

+ 4 - 0
case/renders/top.scad

@@ -0,0 +1,4 @@
+include <render_options.scad>
+include <../assets/top.scad>
+
+top_object();