Przeglądaj źródła

Continue working on hinge.

Cixo Develop 11 miesięcy temu
rodzic
commit
59f3017edb
4 zmienionych plików z 57 dodań i 40 usunięć
  1. 4 0
      assets/connector.scad
  2. 48 34
      assets/hinge.scad
  3. 2 2
      config/connector.scad
  4. 3 4
      config/hinge.scad

+ 4 - 0
assets/connector.scad

@@ -68,6 +68,10 @@ module connector_shape() {
     module final_holes() {
         holes(split = false);
 
+        if (connector_dual) {
+            holes(split = true);
+        }
+
         rotate(180 - connector_angle) {
             holes(split = true);
         }

+ 48 - 34
assets/hinge.scad

@@ -1,47 +1,61 @@
 include <../config/hinge.scad>
 
-module hinge_object() {
-    module mount_shape() {
-        height = hinge_height;
-        width = hinge_screw + hinge_walls * 2;
-        
-        radius = width / 2;
-        move_y = height / 2;
-
-        module mount_base() {
-            hull() {
-                translate([0, move_y]) {
-                    circle(r = radius);
-                }
-
-                translate([0, -move_y]) {
-                    circle(r = radius);
-                }
+function hinge_base_width() 
+    = hinge_connector_screw
+    + hinge_thickness * 2;
+
+module hinge_object_base() {
+    height = hinge_height;
+    connector_screw = hinge_connector_screw;
+    mount_screws = hinge_mount_screws;
+    thickness = hinge_thickness;
+    width = hinge_base_width();
+
+    module base_shape() {
+        rounding = width / 2;
+        move = height - rounding;
+
+        hull() {
+            translate([0, move]) {
+                square(rounding * 2, center = true);
             }
-        }
-
-        module mount_holes() {
-            space = height / (hinge_screws_count - 1);
 
-            for (count = [-move_y : space : move_y]) {
-                translate([0, count]) {
-                    circle(r = hinge_screw / 2);
-                }
+            translate([0, -move]) {
+                circle(r = rounding);
             }
         }
+    }
 
-        difference() {
-            mount_base();
-            mount_holes();
+    base_thickness = thickness;
+    
+    module base_object() {
+        linear_extrude(height = base_thickness) {
+            base_shape();
         }
     }
-    
-    module mount_object() {
-        linear_extrude(height = hinge_thickness, center = true) {
-            mount_shape();
-        }   
+
+    module connector_base_object() {
+        translate([0, height, width / 2]) {
+            rotate([90, 0, 0]) {
+                cylinder(
+                    h = connector_screw * 2, 
+                    r = width / 2, 
+                    center = false
+                );
+            }
+        }
     }
+   
+    hull() {
+        base_object();
+        
+        translate([0, 0, base_thickness]) {
+            connector_base_object();
+        }
+    }
+}
 
-    mount_object();
+module hinge_object() {
+    hinge_object_base();
 }
 

+ 2 - 2
config/connector.scad

@@ -1,8 +1,8 @@
-connector_angle = 120;
+connector_angle = 90;
 connector_hole = 3;
 connector_holes_in_x = 5;
 connector_holes_in_y = 2;
 connector_width = 150;
 connector_depth = 40;
 connector_thickness = 3;
-connector_dual = false;
+connector_dual = true;

+ 3 - 4
config/hinge.scad

@@ -1,5 +1,4 @@
-hinge_height = 50;
 hinge_thickness = 5;
-hinge_walls = 5;
-hinge_screw = 3;
-hinge_screws_count = 4;
+hinge_mount_screws = 3;
+hinge_connector_screw = 10;
+hinge_height = 70;