cixo 1 рік тому
батько
коміт
03ed0d4e15
6 змінених файлів з 161 додано та 245 видалено
  1. 13 0
      assets/corner.scad
  2. 94 225
      assets/platform.scad
  3. 47 1
      assets/wall.scad
  4. 1 0
      config/corner.scad
  5. 5 10
      config/platform.scad
  6. 1 9
      renders/platform.scad

+ 13 - 0
assets/corner.scad

@@ -0,0 +1,13 @@
+include <../config/corner.scad>
+
+module corner(move_x, move_y, rounded = true, size = false) {
+    translate([move_x, move_y]) {
+        radius = size != false ? size : corner_radius;
+        
+        if (rounded) {
+            circle(r = radius);
+        } else {
+            square(radius * 2, center = true);
+        }
+    }
+}

+ 94 - 225
assets/platform.scad

@@ -1,268 +1,137 @@
 include <../config/platform.scad>
 include <../config/thread.scad>
-include <../config/wall.scad>
-include <../config/hook.scad>
-include <thread.scad>
+include <corner.scad>
+include <wall.scad>
 
-function platform_mount_holes_move_x() = (
-    platform_support_depth / 2
-    - platform_rounding
-    - thread_top_diameter / 2
-);
+function platform_full_support_depth() 
+    = platform_support_depth
+    + thread_height
+    + platform_thickness;
 
-function platform_mount_holes_move_y() = (
-    platform_support_thickness / 2
-    - platform_rounding
-    - thread_top_diameter / 2
-);
+module platform_mount_object() {
+    rounding = corner_radius;
 
-function platform_mount_holes() = [
-    [-platform_mount_holes_move_x(), 0],
-    [-platform_mount_holes_move_x(), platform_mount_holes_move_y()],
-    [-platform_mount_holes_move_x(), -platform_mount_holes_move_y()],
-    [platform_mount_holes_move_x(), platform_mount_holes_move_y()],
-    [platform_mount_holes_move_x(), -platform_mount_holes_move_y()],
-];
+    holes_width 
+    = platform_width 
+    - rounding * 2 
+    - thread_screw * 2
+    - platform_side_thickness * 2;
+
+    holes_height 
+    = platform_height 
+    - rounding * 2 
+    - thread_screw * 2
+    - platform_side_thickness;
 
-module platform_support_object() {
     module base_shape() {
-        move_x = platform_support_depth / 2 - platform_rounding;
-        move_y = platform_support_height / 2 - platform_rounding;
-        size = platform_rounding;
+        move_x = platform_width / 2 - rounding;
+        move_y = platform_height / 2 - rounding;
         
         hull() {
-            translate([-move_x, move_y]) {
-                square(size * 2, center = true);
-            }
-
-            translate([move_x, move_y]) {
-                circle(r = size);
-            }
-
-            translate([-move_x, -move_y]) {
-                circle(r = size);
-            }
+            corner(move_x, move_y); 
+            corner(-move_x, move_y); 
+            corner(move_x, -move_y); 
+            corner(-move_x, -move_y); 
         }
     }
+    
+    base_thickness
+    = platform_thickness
+    + thread_height;
 
     module base_object() {
-        thickness = platform_support_thickness;
-
-        rotate([90, 0, 0]) {
-            linear_extrude(height = thickness, center = true) {
-                base_shape();
-            }
+        linear_extrude(height = base_thickness, center = true) {
+            base_shape();
         }
     }
 
-    module base_thread_object() {
-        oversize = max(
-            platform_support_depth, 
-            platform_support_height
-        );
+    module bottom_object() {
+        center = base_thickness / 2 - thread_height / 2;
 
         render() {
-            thread_object(false, oversize);
+            difference() {
+                base_object();
+                
+                translate([0, 0, center]) {
+                    rotate([180, 0, 0]) {
+                        width = holes_width;
+                        height = holes_height;
+                        thickness = platform_thickness;
+
+                        wall_thread_object(width, height, thickness);
+                    }
+                }
+            }
         }
     }
 
-    module wall_thread_object(move_y = 0, move_z = 0) {
-        move_x = -platform_support_depth / 2
-        + thread_height / 2
-        + platform_support_screw_thickness;
-
-        translate([move_x, move_y, move_z]) {
-            rotate([0, 270, 0]) {
-                base_thread_object();
+    module side_shape() {
+        module cutout_shape() {
+            move_x 
+            = platform_width / 2 
+            - platform_side_thickness
+            - rounding;
+
+            move_top_y 
+            = platform_height / 2 
+            - platform_side_thickness
+            - rounding;
+            
+            move_bottom_y 
+            = -platform_height / 2
+            + rounding;
+
+            hull() {
+                corner(move_x, move_top_y);
+                corner(-move_x, move_top_y);
+                corner(move_x, move_bottom_y, false);
+                corner(-move_x, move_bottom_y, false);
             }
         }
-    }   
-
-    module wall_threads_object() {
-        base_move_y = platform_support_thickness
-        - platform_support_thickness % wall_holes_space;
-
-        base_move_z = platform_support_height
-        - platform_support_height % wall_holes_space;
 
-        move_y = base_move_y / 2;
-        move_z = base_move_z / 2;
-
-        for (count_y = [-move_y : wall_holes_space : move_y]) {
-            for (count_z = [-move_z : wall_holes_space : move_z]) {
-                wall_thread_object(count_y, count_z);
+        module bottom_cutout_shape() {
+            bottom
+            = rounding / 2
+            - platform_height / 2;
+            
+            translate([0, bottom]) {
+                square([platform_width, rounding], center = true);
             }
         }
-    }
-
-    module platform_thread_object(move_x, move_y) {
-        move_z = platform_support_height / 2
-        - thread_height / 2
-        - platform_support_screw_thickness;
-
-        translate([move_x, move_y, move_z]) {
-            base_thread_object();
-        }
-    }
-
-    module platform_threads_object() {
-        for (count = platform_mount_holes()) {
-            platform_thread_object(count.x, count.y);
-        }
-    }
 
-    color("#239ddc") {
         render() {
             difference() {
-                base_object();
-                wall_threads_object();
-                platform_threads_object();
+                base_shape();
+                cutout_shape();
+                bottom_cutout_shape();
             }
         }
     }
-}
-
-module platform_shape() {
-    module base_shape() {
-        move_x = platform_width / 2 - platform_rounding;
-        move_y = platform_depth / 2 - platform_rounding;
 
-        hull() {
-            translate([move_x, move_y]) {
-                circle(r = platform_rounding);
-            }
+    module side_object() {
+        thickness = platform_support_depth;
 
-            translate([-move_x, move_y]) {
-                circle(r = platform_rounding);
-            }
-
-            translate([move_x, -move_y]) {
-                square(platform_rounding * 2, center = true);
-            }
-
-            translate([-move_x, -move_y]) {
-                square(platform_rounding * 2, center = true);
-            }
+        linear_extrude(height = thickness, center = true) {
+            side_shape();
         }
     }
 
-    module bonding_holes() {
-        for (count = platform_mount_holes()) {
-            move_y = count.x 
-            - platform_depth / 2 
-            + platform_support_depth / 2;
+    bottom_center 
+    = thread_height / 2
+    + platform_thickness / 2
+    - platform_full_support_depth() / 2;
 
-            translate([count.y, move_y]) {
-                circle(r = thread_screw / 2); 
-            }   
-        }
-
-        move_x = platform_width / 2 - platform_rounding;
-        top_y = platform_depth / 2 - platform_rounding;
-        bottom_y = platform_support_depth - top_y;
-        center_y = platform_support_depth / 2;
+    side_center 
+    = platform_support_depth / 2
+    + thread_height
+    + platform_thickness
+    - platform_full_support_depth() / 2;
 
-        translate([move_x, top_y]) {
-            circle(r = thread_screw / 2);
-        }
-
-        translate([-move_x, top_y]) {
-            circle(r = thread_screw / 2);
-        }
-
-        translate([move_x, bottom_y]) {
-            circle(r = thread_screw / 2);
-        }
-
-        translate([-move_x, bottom_y]) {
-            circle(r = thread_screw / 2);
-        }
-
-        translate([-move_x, center_y]) {
-            circle(r = thread_screw / 2);
-        }
-
-        translate([move_x, center_y]) {
-            circle(r = thread_screw / 2);
-        }
+    translate([0, 0, bottom_center]) {
+        bottom_object();
     }
 
-    module mounting_holes() {
-        top_y = platform_mounting_holes_spacing / 2
-        + platform_mounting_holes_move;
-
-        bottom_y = -platform_mounting_holes_spacing / 2
-        + platform_mounting_holes_move;
-
-        translate([0, top_y]) {
-            circle(r = platform_mounting_screw / 2);
-        }
-
-        translate([0, bottom_y]) {
-            circle(r = platform_mounting_screw / 2);
-        }
-    }
-    
-    module useable_holes() {
-        move_x = platform_width / 2
-        - hook_mounting_hole / 2
-        - platform_rounding * 2;
-
-        top_y = platform_depth / 2
-        - hook_mounting_hole / 2
-        - platform_rounding * 4
-        - wall_holes_space / 2;
-
-        bottom_y = platform_support_depth
-        - top_y;
-
-        translate([move_x, top_y - wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([move_x, top_y + wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([-move_x, top_y - wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([-move_x, top_y + wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([move_x, bottom_y - wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([move_x, bottom_y + wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([-move_x, bottom_y - wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-
-        translate([-move_x, bottom_y + wall_holes_space / 2]) {
-            circle(r = hook_mounting_hole / 2);
-        }
-    }
-
-    difference() {
-        base_shape();
-        bonding_holes();
-        mounting_holes();
-        useable_holes();
-    }
-}
-
-module platform_object() {
-    color("#9bdf20") {
-        render() {
-            linear_extrude(height = platform_thickness, center = true) {
-                platform_shape();
-            }
-        }
+    translate([0, 0, side_center]) {
+        side_object();
     }
 }

+ 47 - 1
assets/wall.scad

@@ -1,5 +1,51 @@
-include <hole.scad>
 include <../config/wall.scad>
+include <../config/thread.scad>
+include <hole.scad>
+include <thread.scad>
+
+module wall_holes_shape(width, height, diameter = false) {
+    module hole(move_x, move_y) {
+        translate([move_x, move_y]) {
+            if (diameter == false) {
+                circle(r = thread_screw / 2);
+            } else {
+                circle(r = diameter / 2);
+            }
+        }   
+    }
+    
+    base_width = width - width % wall_holes_space;
+    base_height = height - height % wall_holes_space;
+
+    move_x = base_width / 2;
+    move_y = base_height / 2;
+
+    for (count_x = [-move_x : wall_holes_space : move_x]) {
+        for (count_y = [-move_y : wall_holes_space : move_y]) {
+            hole(count_x, count_y);
+        }
+    }
+}
+
+module wall_thread_object(width, height, oversize = 0) {
+    module hole(move_x, move_y) {
+        translate([move_x, move_y]) {
+            thread_object(false, oversize);
+        }   
+    }
+    
+    base_width = width - width % wall_holes_space;
+    base_height = height - height % wall_holes_space;
+
+    move_x = base_width / 2;
+    move_y = base_height / 2;
+
+    for (count_x = [-move_x : wall_holes_space : move_x]) {
+        for (count_y = [-move_y : wall_holes_space : move_y]) {
+            hole(count_x, count_y);
+        }
+    }
+}
 
 module wall_base_shape() {
     move_x = wall_width / 2 - wall_rounding;

+ 1 - 0
config/corner.scad

@@ -0,0 +1 @@
+corner_radius = 5;

+ 5 - 10
config/platform.scad

@@ -1,11 +1,6 @@
-platform_rounding = 5;
-platform_thickness = 6;
-platform_width = 85;
+platform_height = 70;
+platform_width = 70;
 platform_depth = 280;
-platform_support_depth = 50;
-platform_support_height = 55;
-platform_support_thickness = 75;
-platform_support_screw_thickness = 2;
-platform_mounting_screw = 4;
-platform_mounting_holes_spacing = 159;
-platform_mounting_holes_move = 50;
+platform_thickness = 3;
+platform_side_thickness = 5;
+platform_support_depth = 15;

+ 1 - 9
renders/platform.scad

@@ -2,12 +2,4 @@ include <../assets/platform.scad>
 
 $fn = 100;
 
-translate([0, 0, -platform_support_height / 2 - platform_thickness / 2]) {
-    rotate([0, 0, 90]) {
-        platform_support_object();
-    }
-}
-
-translate([0, platform_depth / 2 - platform_support_depth / 2, 0]) {
-    platform_object();
-}
+platform_mount_object();