소스 검색

Add side parts of the platform.

Cixo Develop 1 년 전
부모
커밋
6435e770e0
3개의 변경된 파일272개의 추가작업 그리고 4개의 파일을 삭제
  1. 232 4
      assets/platform.scad
  2. 6 0
      assets/thread.scad
  3. 34 0
      renders/platform.scad

+ 232 - 4
assets/platform.scad

@@ -8,6 +8,93 @@ function platform_full_support_depth()
     + thread_height
     + platform_thickness;
 
+function platform_top_width()
+    = platform_width
+    - corner_radius * 2;
+
+function platform_side_width() 
+    = platform_height
+    - corner_radius * 2;
+
+module platform_side_holes(thread = false) {
+    move_x
+    = platform_side_width() / 2
+    - corner_radius
+    - thread_screw;
+
+    move_top_y
+    = platform_full_support_depth() / 2
+    - thread_screw;
+
+    move_bottom_y
+    = thread_top_diameter / 2
+    - move_top_y;
+
+    module thread(move_x, move_y) {
+        translate([move_x, move_y]) {
+            thread_object(false, platform_thickness);
+        }
+    }
+
+    module screw(move_x, move_y) {
+        translate([move_x, move_y]) {
+            thread_screw_object(thread_height);
+        }
+    }
+    
+    if (thread) {
+        screw(move_x, move_top_y);
+        screw(0, move_top_y);
+        thread(move_x, move_bottom_y);
+        thread(-move_x, move_bottom_y);
+    } else {
+        thread_screw_hole(move_x, move_top_y); 
+        thread_screw_hole(0, move_top_y);
+        thread_screw_hole(move_x, move_bottom_y); 
+        thread_screw_hole(-move_x, move_bottom_y); 
+    }
+
+}
+
+module platform_top_holes(thread = false) {
+    move_x
+    = platform_top_width() / 2
+    - corner_radius
+    - thread_screw;
+
+    move_top_y
+    = platform_full_support_depth() / 2
+    - thread_screw;
+
+    move_bottom_y
+    = thread_top_diameter / 2
+    - move_top_y;
+
+    module thread(move_x, move_y) {
+        translate([move_x, move_y]) {
+            thread_object(false, platform_thickness);
+        }
+    }
+
+    module screw(move_x, move_y) {
+        translate([move_x, move_y]) {
+            thread_screw_object(thread_height);
+        }
+    }
+    
+    if (thread) {
+        screw(move_x, move_top_y);
+        screw(-move_x, move_top_y);
+        thread(move_x, move_bottom_y);
+        thread(-move_x, move_bottom_y);
+    } else {
+        thread_screw_hole(move_x, move_top_y); 
+        thread_screw_hole(-move_x, move_top_y);
+        thread_screw_hole(move_x, move_bottom_y); 
+        thread_screw_hole(-move_x, move_bottom_y); 
+    }
+}
+
 module platform_mount_object() {
     rounding = corner_radius;
 
@@ -127,11 +214,152 @@ module platform_mount_object() {
     + platform_thickness
     - platform_full_support_depth() / 2;
 
-    translate([0, 0, bottom_center]) {
-        bottom_object();
+    module layer_base_object() {
+        translate([0, 0, bottom_center]) {
+            bottom_object();
+        }
+
+        translate([0, 0, side_center]) {
+            side_object();
+        }
+    }
+
+    module top_holes() {
+        center_y 
+        = platform_height / 2
+        - thread_height / 2;
+        
+        translate([0, center_y, 0]) {
+            rotate([90, 0, 0]) {
+                platform_top_holes(true);
+            }
+        }
+    }
+
+    module left_holes() {
+        center_x 
+        = platform_width / 2
+        - thread_height / 2;
+
+        translate([center_x, 0, 0]) {
+            mirror([0, 1, 0]) {
+                rotate([90, 0, 270]) {
+                    platform_side_holes(true);
+                }
+            }
+        }
+    }
+
+    module right_holes() {
+        center_x 
+        = thread_height / 2
+        - platform_width / 2;
+
+        translate([center_x, 0, 0]) {
+            rotate([90, 0, 90]) {
+                platform_side_holes(true);
+            }
+        }
+    }
+
+    render() {
+        difference() {
+            layer_base_object();
+            top_holes();
+            left_holes();
+            right_holes();
+        }
+    }
+}
+
+module platform_top_shape() {
+    move_x 
+    = platform_top_width() / 2 
+    - corner_radius;
+
+    move_y
+    = platform_depth / 2
+    - corner_radius;
+
+    module base_shape() {
+        hull() {
+            corner(move_x, move_y);
+            corner(-move_x, move_y);
+            corner(move_x, -move_y);
+            corner(-move_x, -move_y);
+        }
     }
 
-    translate([0, 0, side_center]) {
-        side_object();
+    holes_y
+    = platform_full_support_depth() / 2
+    - platform_depth / 2;
+
+    difference() {
+        base_shape();
+
+        translate([0, holes_y]) {
+            platform_top_holes();
+        }
+    }
+}
+
+module platform_top_object() {
+    height = platform_thickness;
+    
+    color("#9711EE") {
+        render() {
+            linear_extrude(height = height, center = true) {
+                platform_top_shape();
+            }
+        }
+    }
+}
+
+module platform_side_shape() {
+    move_x
+    = platform_side_width() / 2
+    - corner_radius;
+
+    move_y 
+    = platform_depth / 2
+    - corner_radius;
+
+    module base_shape() {
+        hull() {
+            corner(0, -move_y / 1.5);
+            corner(move_x, -move_y / 1.5);
+            corner(move_x, -move_y);
+            corner(-move_x, -move_y);
+        }
+
+        hull() {
+            corner(0, -move_y / 1.5);
+            corner(move_x, -move_y / 1.5);
+            corner(move_x, move_y);
+        }
+    }
+
+    holes_y
+    = platform_full_support_depth() / 2
+    - platform_depth / 2;
+
+    difference() {
+        base_shape();
+
+        translate([0, holes_y]) {
+            platform_side_holes();
+        }
+    }
+}
+
+module platform_side_object() {
+    height = platform_thickness;
+
+    color("#DA25B3") {
+        render() {
+            linear_extrude(height = height, center = true) {
+                platform_side_shape();
+            }
+        }
     }
 }

+ 6 - 0
assets/thread.scad

@@ -1,5 +1,11 @@
 include <../config/thread.scad>
 
+module thread_screw_hole(move_x, move_y) {
+    translate([move_x, move_y]) {
+        circle(r = thread_screw / 2);
+    }
+}
+
 module thread_object(screw = false, oversize = 0) {
     module base_object() {
         top_height = thread_top_height + oversize;

+ 34 - 0
renders/platform.scad

@@ -3,3 +3,37 @@ include <../assets/platform.scad>
 $fn = 100;
 
 platform_mount_object();
+
+top_position_y 
+= platform_height / 2
++ platform_thickness / 2;
+
+top_position_z
+= platform_depth / 2
+- platform_full_support_depth() / 2;
+
+translate([0, top_position_y, top_position_z]) {
+    rotate([90, 0, 0]) {
+        platform_top_object();
+    }   
+}
+
+side_position_x
+= platform_width / 2
++ platform_thickness / 2;
+
+side_position_z
+= platform_depth / 2
+- platform_full_support_depth() / 2;
+
+translate([side_position_x, 0, side_position_z]) {
+    rotate([90, 0, 90]) {
+        platform_side_object();
+    }
+}
+
+translate([-side_position_x, 0, side_position_z]) {
+    rotate([90, 0, 90]) {
+        platform_side_object();
+    }
+}