浏览代码

Start working on case sides.

Cixo Develop 11 月之前
父节点
当前提交
2021f84de5
共有 3 个文件被更改,包括 102 次插入0 次删除
  1. 89 0
      assets/side.scad
  2. 9 0
      config/side.scad
  3. 4 0
      renders/side.scad

+ 89 - 0
assets/side.scad

@@ -0,0 +1,89 @@
+include <ATX.scad>
+include <../config/side.scad>
+include <../config/plate.scad>
+
+module side_shape() {
+    rounding = side_rounding / 2;
+
+    module corner(x = 0, y = 0, rounded = true) {
+        translate([x, y]) {
+            if (rounded) {
+                circle(r = rounding);
+            } else {
+                square([rounding * 2, rounding * 2], center = true);
+            }
+        }
+    }
+
+    module handle() {
+        top_width = side_handle_width;
+        bottom_width = side_width;
+        height = side_handle_height;
+        
+        move_y = height / 2 - rounding;
+        move_x_top = top_width / 2 - rounding;
+        move_x_bottom = bottom_width / 2 - rounding;
+
+        union() {
+            hull() {
+                corner(-move_x_bottom, -move_y);
+                corner(-move_x_top, move_y);
+            }
+
+            hull() {
+                corner(-move_x_top, move_y);
+                corner(move_x_top, move_y);
+            }
+
+            hull() {
+                corner(move_x_top, move_y);
+                corner(move_x_bottom, -move_y);
+            }
+        }
+    }
+    
+    width = side_width;
+    handle_height = side_handle_height;
+    height = side_height + handle_height;
+    cutoff_width = side_cutoff_width;
+    cutoff_height = side_cutoff_height;
+
+    module base_shape() {
+        move_x = width / 2 - rounding;
+        move_y_top = height / 2 - handle_height / 2 + rounding;
+        move_y_bottom = -(height - rounding * 2) / 2 - handle_height / 2;
+        cutoff_move_x = cutoff_width / 2 - rounding;
+        cutoff_move_y = cutoff_height / 2 - rounding;
+        cutoff_position_y = move_y_bottom + cutoff_move_y;
+
+        difference() {
+            hull() {
+                corner(move_x, move_y_top);
+                corner(move_x, move_y_bottom);
+                corner(-move_x, move_y_top);
+                corner(-move_x, move_y_bottom);
+            }
+            
+            translate([0, cutoff_position_y]) {
+                hull() {
+                    corner(cutoff_move_x, cutoff_move_y);
+                    corner(-cutoff_move_x, cutoff_move_y);
+                    corner(cutoff_move_x, -cutoff_move_y, false);
+                    corner(-cutoff_move_x, -cutoff_move_y, false);
+                }
+            }
+        }
+    }
+
+    base_shape();
+    
+    translate([0, height / 2]) {
+        handle();
+    }
+}
+
+module side_object() {
+    linear_extrude(height = side_thickness, center = true) {
+        side_shape();
+    }
+}

+ 9 - 0
config/side.scad

@@ -0,0 +1,9 @@
+side_thickness = 3;
+side_height = 200;
+side_width = 150;
+side_rounding = 10;
+side_handle_width = 100;
+side_handle_height = 70;
+side_cutoff_width = 100;
+side_cutoff_height = 40;
+

+ 4 - 0
renders/side.scad

@@ -0,0 +1,4 @@
+include <../assets/side.scad>
+
+$fn = 100;
+side_object();