Ver código fonte

Continue working on case.

Cixo Develop 10 meses atrás
pai
commit
cdf984ecaf

+ 21 - 1
case/assets/addon.scad

@@ -1,7 +1,27 @@
+include <functions.scad>
+
+include <../config/global.scad>
+include <../config/addon.scad>
+
 function addon_size() = [
     100, 50
 ];
 
 module addon_cutoff() {
-    square([addon_size().x, addon_size().y], center = true);
+    rounding = addon_rounding;
+    width = addon_size().x;
+    height = addon_size().y;
+
+    module corner(vector) {
+        translate(vector) {
+            circle(r = rounding);
+        }
+    }
+
+    hull() {
+        for (count = square_vector(width, height, rounding)) {
+            corner(count);
+        }
+    }
 }
+

+ 40 - 1
case/assets/front.scad

@@ -2,6 +2,7 @@ include <ATX.scad>
 include <functions.scad>
 include <angle.scad>
 include <addon.scad>
+include <switch.scad>
 
 include <../config/global.scad>
 include <../config/front.scad>
@@ -62,12 +63,50 @@ module front_shape() {
         }
     }
 
+    module switch_move_cutoff() {
+        move_x 
+        = width / 2
+        - switch_size().x / 2
+        - angle_depth
+        + plywood_thickness / 2
+        - front_switch_margin.x;
+
+        move_y 
+        = height / 2
+        - switch_size().y / 2
+        - angle_depth
+        + plywood_thickness / 2
+        - front_switch_margin.y;
+        
+        translate([move_x, move_y]) {
+            switch_cutoff();
+        }
+    }
+
+    module addon_move_cutoff() {
+        move_x 
+        = -width / 2
+        + addon_size().x / 2
+        + angle_depth
+        + front_addon_margin.x;
+
+        move_y 
+        = -height / 2
+        + addon_size().y / 2
+        + front_addon_margin.y;
+
+        translate([move_x, move_y]) {
+            addon_cutoff();
+        }
+    }
+
     difference() {
         base_shape();
         mounting_cutoff();
+        switch_move_cutoff();
 
         if (front_addon) {
-            addon_cutoff();
+            addon_move_cutoff();
         }
     }
 }

+ 26 - 0
case/assets/switch.scad

@@ -0,0 +1,26 @@
+include <functions.scad>
+
+include <../config/global.scad>
+include <../config/switch.scad>
+
+function switch_size() = [
+    60, 30
+];  
+
+module switch_cutoff() {
+    rounding = switch_rounding;
+    width = switch_size().x;
+    height = switch_size().y;
+
+    module corner(vector) {
+        translate(vector) {
+            circle(r = rounding);
+        }
+    }
+
+    hull() {
+        for (count = square_vector(width, height, rounding)) {
+            corner(count);
+        }
+    }
+}

+ 1 - 0
case/config/addon.scad

@@ -0,0 +1 @@
+addon_rounding = default_rounding;

+ 2 - 0
case/config/front.scad

@@ -6,3 +6,5 @@ front_rounding = default_rounding;
 front_motherboard_size = ATX_mini_itx_size();
 front_height = side_height;
 front_addon = true;
+front_switch_margin = [10, 10];
+front_addon_margin = [10, 10];

+ 1 - 0
case/config/switch.scad

@@ -0,0 +1 @@
+switch_rounding = default_rounding;

+ 0 - 0
case/renders/addon.scad


+ 1 - 1
case/renders/submission.scad

@@ -122,7 +122,7 @@ front_position_z
 - plywood_thickness / 2;
 
 translate([0, front_position_y, front_position_z]) {
-    rotate([90, 0, 0]) {
+    rotate([90, 0, 180]) {
         front_object();
     }   
 }