Selaa lähdekoodia

Continue working on project. Add sides and fronts.

cixo 10 kuukautta sitten
vanhempi
commit
551fd2d58c

+ 3 - 0
case/assets/ATX.scad

@@ -6,3 +6,6 @@ function ATX_mini_itx_holes() = [
     [-78.65, -80.78],
     [78.83, -80.78] 
 ];
+
+function ATX_full_height() = 111.15;
+function ATX_half_height() = 68.90;

+ 7 - 0
case/assets/addon.scad

@@ -0,0 +1,7 @@
+function addon_size() = [
+    100, 50
+];
+
+module addon_cutoff() {
+    square([addon_size().x, addon_size().y], center = true);
+}

+ 85 - 0
case/assets/front.scad

@@ -0,0 +1,85 @@
+include <ATX.scad>
+include <functions.scad>
+include <angle.scad>
+include <addon.scad>
+
+include <../config/global.scad>
+include <../config/front.scad>
+
+function front_size() = [
+    front_motherboard_size.x + front_padding * 2,
+    front_height + front_padding * 2
+];
+
+module front_shape() {
+    padding = front_padding;
+    rounding = front_rounding;
+    size = front_size();
+    width = size.x;
+    height = size.y;
+    
+    module corner(vector) {
+        translate(vector) {
+            circle(r = rounding);
+        }
+    }
+
+    module base_shape() {
+        hull() {
+            for (count = square_vector(width, height, rounding)) {
+                corner(count);
+            }
+        }
+    }
+
+    module mounting_cutoff() {
+        move_y 
+        = height / 2
+        - angle_depth / 2
+        + plywood_thickness / 2;
+
+        move_x
+        = width / 2
+        - angle_depth / 2
+        + plywood_thickness / 2;
+        
+        module right_cutoff() {
+            translate([move_x, 0]) {
+                rotate(90) {
+                    angle_cutoff();
+                }
+            }
+        }
+
+        translate([0, move_y]) {
+            angle_cutoff();
+        }
+
+        right_cutoff();
+
+        mirror([1, 0]) {
+            right_cutoff();
+        }
+    }
+
+    difference() {
+        base_shape();
+        mounting_cutoff();
+
+        if (front_addon) {
+            addon_cutoff();
+        }
+    }
+}
+
+module front_object() {
+    height = plywood_thickness;
+
+    color("#AAEEFF") {
+        render() {
+            linear_extrude(height = height, center = true) {
+                front_shape();
+            }   
+        }
+    }
+}

+ 83 - 0
case/assets/side.scad

@@ -0,0 +1,83 @@
+include <ATX.scad>
+include <functions.scad>
+include <pattern.scad>
+include <angle.scad>
+
+include <../config/global.scad>
+include <../config/side.scad>
+
+function side_size() = [
+    side_motherboard_size.y + side_padding * 2,
+    side_height + side_padding * 2
+];
+
+module side_shape() {
+    width = side_size().x;
+    height = side_size().y;
+    make_pattern = side_pattern;
+    padding = side_padding;
+    rounding = side_rounding;
+
+    module corner(vector = [0, 0]) {
+        translate(vector) {
+            circle(r = rounding);
+        }
+    }
+
+    module base_shape() {
+        hull() {
+            for (count = square_vector(width, height, rounding)) {
+                corner(count);
+            }
+        }
+    }
+
+    module angle_hole() {
+        top_move_y 
+        = height / 2 
+        - angle_depth / 2
+        + plywood_thickness;
+
+        right_move_x
+        = -width / 2
+        + angle_depth / 2
+        - plywood_thickness;
+
+        translate([0, top_move_y]) {
+            angle_cutoff(top = false); 
+        }
+        
+        translate([right_move_x, 0]) {
+            rotate(90) {
+                angle_cutoff(top = true);
+            }
+        }
+    }
+
+    module final() {
+        difference() {
+            base_shape();
+            angle_hole();
+
+            if (make_pattern) {
+                pattern(width, height);
+            }
+        }
+    }
+
+    render() {
+        final();
+    }
+}
+
+module side_object() {
+    height = plywood_thickness;
+
+    color("#CCFFCC") {
+        render() {
+            linear_extrude(height = height, center = true) {
+                side_shape();
+            }
+        }
+    }
+}

+ 8 - 0
case/config/front.scad

@@ -0,0 +1,8 @@
+include <side.scad>
+
+front_padding = default_padding;
+front_rounding = default_rounding;
+
+front_motherboard_size = ATX_mini_itx_size();
+front_height = side_height;
+front_addon = true;

+ 6 - 0
case/config/side.scad

@@ -0,0 +1,6 @@
+side_padding = default_padding;
+side_rounding = default_rounding;
+side_pattern = true;
+
+side_motherboard_size = ATX_mini_itx_size();
+side_height = ATX_full_height();

+ 4 - 0
case/renders/front.scad

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

+ 4 - 0
case/renders/side.scad

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

+ 82 - 1
case/renders/submission.scad

@@ -1,6 +1,8 @@
 include <render_options.scad>
 include <../assets/top.scad>
 include <../assets/angle.scad>
+include <../assets/side.scad>
+include <../assets/front.scad>
 
 top_position_z = 0;
 
@@ -44,6 +46,85 @@ module top_mount() {
     front();
 }
 
+module side_mount() {
+    height = side_size().y;
+    width = top_size().x;
+    length = side_size().x;
+
+    module sides() {
+        move_z 
+        = -height / 2
+        - plywood_thickness / 2;
+
+        move_x
+        = width / 2
+        + plywood_thickness / 2;
+
+        module single() {
+            translate([move_x, 0, move_z]) {
+                rotate([90, 0, 270]) {
+                    side_object();
+                }
+            }
+        }
+
+        single();
+
+        mirror([1, 0, 0]) {
+            single();
+        }
+    }
+
+    module mounts() {
+        move_z 
+        = -height / 2
+        - plywood_thickness / 2;
+
+        move_y
+        = length / 2
+        + plywood_thickness;
+
+        move_x
+        = width / 2
+        + plywood_thickness / 2;
+
+        module single() {
+            translate([move_x, move_y, move_z]) {
+                rotate([0, 90, 180]) {
+                    angle_object();
+                }
+            }
+        }
+
+        single();
+
+        mirror([1, 0, 0]) {
+            single();
+        }
+    }
+
+    sides();
+    mounts();
+}
+
 translate([0, 0, top_position_z]) {
-    top_mount();
+    rotate([180, 0, 0]) {
+        top_mount();
+    }
 }
+
+front_position_y 
+= top_size().y / 2
++ plywood_thickness / 2;
+
+front_position_z
+= -front_size().y / 2
+- plywood_thickness / 2;
+
+translate([0, front_position_y, front_position_z]) {
+    rotate([90, 0, 0]) {
+        front_object();
+    }   
+}
+
+side_mount();