|
|
@@ -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();
|
|
|
}
|
|
|
|