Browse Source

Start working from scratch.

cixo 9 months ago
parent
commit
d6127e8592

+ 2 - 11
case/assets/ATX.scad

@@ -1,11 +1,2 @@
-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] 
-];
-
-function ATX_full_height() = 111.15;
-function ATX_half_height() = 68.90;
+function microATX() = [244, 244];
+function miniITX() = [170, 170];

+ 0 - 27
case/assets/addon.scad

@@ -1,27 +0,0 @@
-include <functions.scad>
-
-include <../config/global.scad>
-include <../config/addon.scad>
-
-function addon_size() = [
-    100, 50
-];
-
-module addon_cutoff() {
-    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);
-        }
-    }
-}
-

+ 0 - 164
case/assets/angle.scad

@@ -1,164 +0,0 @@
-include <../config/global.scad>
-include <../config/angle.scad>
-
-function angle_top_holes_space()
-    = angle_holes_space;
-
-function angle_bottom_holes_space()
-    = angle_holes_space + angle_margin * 2;
-
-function angle_width()
-    = max(angle_top_holes_space(), angle_bottom_holes_space())
-    + angle_margin * 2
-    + angle_thickness * 2;
-
-function angle_outside_depth()
-    = angle_depth
-    + angle_thickness;
-
-module angle_cutoff(top = false, only_holes = false) {
-    module holes() {
-        move 
-        = top 
-        ? angle_top_holes_space() / 2 
-        : angle_bottom_holes_space() / 2;
-
-        translate([-move, 0]) {
-            circle(d = angle_hole_diameter);
-        }
-    
-        translate([move, 0]) {
-            circle(d = angle_hole_diameter);
-        }
-    }
-
-    module supports() {
-        move 
-        = angle_width() / 2
-        - angle_thickness / 2;
-
-        translate([-move, 0]) {
-            square([angle_thickness, angle_depth], center = true);   
-        }
-
-        translate([move, 0]) {
-            square([angle_thickness, angle_depth], center = true);   
-        }
-    }
-
-    holes();
-
-    if (!only_holes) {
-        supports();
-    }
-}
-
-module angle_object() {
-    module cross_section(hulled = false) {
-        module corner(move_x = 0, move_y = 0) {
-            translate([move_x, move_y]) {
-                circle(d = angle_thickness);
-            }
-        }
-
-        module base() {
-            move = angle_depth / 2;
-
-            hull() {
-                corner(-move, move);
-                corner(move, move);
-            }
-
-            hull() {
-                corner(-move, move);
-                corner(-move, -move);
-            }
-        }
-
-        if (hulled) {
-            hull() {
-                base();
-            }
-        } else {
-            base ();
-        }
-    }
-
-    module base_object() {
-        module center() {
-            height 
-            = angle_width()
-            - angle_thickness * 2;
-        
-            linear_extrude(height = height, center = true) {
-                cross_section(hulled = false);
-            }
-        }
-
-        module support() {
-            height = angle_thickness;
-
-            linear_extrude(height = height, center = true) {
-                cross_section(hulled = true);
-            }
-        }
-
-        module full() {
-            center();
-
-            move
-            = angle_width() / 2
-            - angle_thickness / 2;
-
-            translate([0, 0, move]) {
-                support();
-            }
-
-            translate([0, 0, -move]) {
-                support();
-            }
-        }
-
-        rotate([270, 0, 90]) {
-            full();
-        }
-    }
-
-    module holes() {
-        height = angle_outside_depth();
-        move = angle_thickness / 2;
-
-        translate([0, move, 0]) {
-            linear_extrude(height = height, center = true) {
-                angle_cutoff(top = true, only_holes = true);
-            }
-        }
-
-        translate([0, 0, move]) {
-            rotate([90, 0, 0]) {
-                linear_extrude(height = height, center = true) {
-                    angle_cutoff(top = false, only_holes = true);
-                }
-            }
-        }
-    }
-
-    color("#AABBCC") {
-        render() {
-            correction_y
-            = angle_outside_depth() / 2
-            - angle_depth / 2;
-
-            correction_z
-            = angle_outside_depth() / 2
-            - angle_depth / 2;
-
-            translate([0, correction_y, correction_z]) {
-                difference() {
-                    base_object();
-                    holes();
-                }
-            }
-        }
-    }
-}

+ 0 - 124
case/assets/front.scad

@@ -1,124 +0,0 @@
-include <ATX.scad>
-include <functions.scad>
-include <angle.scad>
-include <addon.scad>
-include <switch.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();
-        }
-    }
-
-    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_move_cutoff();
-        }
-    }
-}
-
-module front_object() {
-    height = plywood_thickness;
-
-    color("#AAEEFF") {
-        render() {
-            linear_extrude(height = height, center = true) {
-                front_shape();
-            }   
-        }
-    }
-}

+ 0 - 6
case/assets/functions.scad

@@ -1,6 +0,0 @@
-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],
-];

+ 0 - 35
case/assets/pattern.scad

@@ -1,35 +0,0 @@
-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();
-            }
-        }
-    }
-}

+ 30 - 0
case/assets/plate.scad

@@ -0,0 +1,30 @@
+include <../config/all.scad>
+include <ATX.scad>
+
+module plate_shape() {
+    module corner(x, y) {
+        translate([x, y]) {
+            circle(r = radius);
+        }
+    }
+
+    module base() {
+        move_x = motherboard_size.x / 2 - radius;
+        move_y = motherboard_size.y / 2 - radius;
+
+        hull() {
+            corner(move_x, move_y);
+            corner(-move_x, move_y);
+            corner(move_x, -move_y);
+            corner(-move_x, -move_y);
+        }
+    }
+
+    base();
+}
+
+module plate_object() {
+    linear_extrude(height = shape_thickness, center = true) {
+        plate_shape();
+    }
+}

+ 0 - 83
case/assets/side.scad

@@ -1,83 +0,0 @@
-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();
-            }
-        }
-    }
-}

+ 0 - 26
case/assets/switch.scad

@@ -1,26 +0,0 @@
-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);
-        }
-    }
-}

+ 0 - 94
case/assets/top.scad

@@ -1,94 +0,0 @@
-include <ATX.scad>
-include <pattern.scad>
-include <angle.scad>
-include <functions.scad>
-include <../config/global.scad>
-include <../config/top.scad>
-
-function top_size() = [
-    top_motherboard_size.x + top_padding * 2,
-    top_motherboard_size.y + top_padding * 2
-];
-
-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 = top_size().x;
-        height = top_size().y;
-    
-        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);
-                }
-            }
-        }
-    }
-
-    module angles_cuts() {
-        module front_cutoff(move_x = 0) {
-            move_y
-            = motherboard_size.y / 2
-            + plywood_thickness;
-
-            translate([move_x, -move_y]) {
-                angle_cutoff(top = true);
-            }
-        }
-
-        module side_cutoff(left = true, move_y = 0) {
-            move_x
-            = motherboard_size.x / 2
-            + plywood_thickness;
-
-            translate([move_x * (left ? 1 : -1), move_y]) {
-                rotate(90) {
-                    angle_cutoff(top = true);
-                }
-            }
-        }
-        
-        front_cutoff(move_x = 0);
-        side_cutoff(left = true, move_y = 0);
-        side_cutoff(left = false, move_y = 0);
-    }
-
-    render() {
-        difference() {
-            base_shape();
-            motherboard_holes();
-            angles_cuts();
-
-            if (top_pattern) {
-                pattern(motherboard_size.x, motherboard_size.y);
-            }
-        }
-    }
-}
-
-module top_object() {
-    color("#CCBBAA") {
-        linear_extrude(center = true, height = plywood_thickness) {
-            top_shape();
-        }
-    }
-}

+ 0 - 1
case/config/addon.scad

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

+ 1 - 0
case/config/all.scad

@@ -0,0 +1 @@
+include <global.scad>

+ 0 - 5
case/config/angle.scad

@@ -1,5 +0,0 @@
-angle_depth = 20;
-angle_hole_diameter = 3;
-angle_holes_space = 20;
-angle_margin = 10;
-angle_thickness = 10;

+ 0 - 10
case/config/front.scad

@@ -1,10 +0,0 @@
-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;
-front_switch_margin = [10, 10];
-front_addon_margin = [10, 10];

+ 4 - 3
case/config/global.scad

@@ -1,3 +1,4 @@
-plywood_thickness = 3;
-default_padding = 10;
-default_rounding = 5;
+shape_thickness = 3;
+radius = 5;
+motherboard_padding = 15;
+motherboard_size = microATX();

+ 0 - 5
case/config/pattern.scad

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

+ 0 - 6
case/config/side.scad

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

+ 0 - 1
case/config/switch.scad

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

+ 0 - 7
case/config/top.scad

@@ -1,7 +0,0 @@
-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();

+ 0 - 4
case/manufacture/angle.3D.scad

@@ -1,4 +0,0 @@
-include <../assets/angle.scad>
-
-$fn = 200;
-angle_object();

+ 0 - 4
case/manufacture/top.2D.scad

@@ -1,4 +0,0 @@
-include <../assets/top.scad>
-
-$fn = 200;
-top_shape();

+ 0 - 0
case/renders/addon.scad


+ 0 - 4
case/renders/angle.scad

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

+ 0 - 4
case/renders/front.scad

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

+ 4 - 0
case/renders/plate.scad

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

+ 0 - 1
case/renders/render_options.scad

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

+ 0 - 4
case/renders/side.scad

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

+ 0 - 130
case/renders/submission.scad

@@ -1,130 +0,0 @@
-include <render_options.scad>
-include <../assets/top.scad>
-include <../assets/angle.scad>
-include <../assets/side.scad>
-include <../assets/front.scad>
-
-top_position_z = 0;
-
-module top_mount() {
-    top_object();
-   
-    module side() {
-        move_y = 0;
-        move_z = plywood_thickness / 2;
-        move_x 
-        = top_size().x / 2
-        + plywood_thickness;
-
-        translate([move_x, move_y, -move_z]) {
-            rotate([0, 0, 90]) {
-                angle_object();
-            }
-        }
-    }
-    
-    module front() {
-        move_x = 0;
-        move_z = plywood_thickness / 2;
-        move_y
-        = top_size().y / 2
-        + plywood_thickness;
-
-        translate([move_x, -move_y, -move_z]) {
-            angle_object();
-        }
-    }
-
-    mirror([0, 0, 0]) {
-        side();
-    }
-
-    mirror([1, 0, 0]) {
-        side();
-    }
-
-    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]) {
-    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, 180]) {
-        front_object();
-    }   
-}
-
-side_mount();

+ 0 - 4
case/renders/top.scad

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