chiark / gitweb /
pin-hinge: adjust from test master
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 16 Sep 2020 12:41:44 +0000 (13:41 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 16 Sep 2020 12:41:44 +0000 (13:41 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
itx-aperture-grommet.scad [new file with mode: 0644]
pin-hinge.scad [new file with mode: 0644]

diff --git a/itx-aperture-grommet.scad b/itx-aperture-grommet.scad
new file mode 100644 (file)
index 0000000..53f74fa
--- /dev/null
@@ -0,0 +1,56 @@
+// -*- C -*-
+
+include <utils.scad>
+include <threads.scad>
+
+ap_width = 21.30;
+ap_height = 16.45;
+tot_height = 22.74 + 1.0;
+screw_ctr_to_tr = [ 7.89, 3.87 ];
+
+tab_th = 2.5;
+wall_th = 1;
+wall_h = 2;
+
+app_slop = 0.60; // total across both sides
+
+// calculated
+
+tab_h = tot_height - ap_height;
+
+real_main_sz = [ ap_width, ap_height ] - app_slop * [ 1,1 ];
+real_all_sz = real_main_sz + tab_h * [0,1];
+real_inner_sz = real_main_sz - wall_th * [ 2,1 ];
+
+screw_pos = real_all_sz - (screw_ctr_to_tr - 0.5 * app_slop * [1,1]);
+
+module GapPlan() {
+  rectfromto([ wall_th, -1 ],
+            real_main_sz - wall_th * [1,1]);
+}
+
+module MainPlan() {
+  rectfromto([0,0],
+            real_main_sz);
+}
+
+module AllPlan() {
+  rectfromto([0,0], real_all_sz);
+}
+
+module Grommet(){ ////toplevel
+  difference(){
+    union(){
+      linextr(0, tab_th + wall_h) MainPlan();
+      linextr(0, tab_th) AllPlan();
+    }
+    linextr(-1, tab_th + wall_h + 1) GapPlan();
+    translate(concat(screw_pos, [-1]))
+      english_thread(diameter = 0.1380,
+                    threads_per_inch = 32,
+                    length = tab_th + 2,
+                    internal = true);
+  }
+}
+
+Grommet();
diff --git a/pin-hinge.scad b/pin-hinge.scad
new file mode 100644 (file)
index 0000000..81d527e
--- /dev/null
@@ -0,0 +1,100 @@
+// -*- C -*-
+
+include <utils.scad>
+
+$hinge_pin_dia = 0.795 + 0.75;
+$hinge_main_dia = 4.0;
+$hinge_inter_gap = 0.50;
+$hinge_prong_minwidth = 3.0;
+$hinge_noncrit_gap = 1.0;
+
+$fa = 3;
+$fs = 0.05;
+
+module HingePinPlan(){
+  circle(r= $hinge_pin_dia/2);
+}
+
+module HingeProngPlan(behind){
+  hull(){
+    circle(r= $hinge_main_dia/2);
+    polygon([[0,0],
+            [-$hinge_main_dia/2, -behind],
+            [+$hinge_main_dia/2, -behind]]);
+  }
+}
+
+module HingeGapPlan() {
+  circle(r = $hinge_main_dia/2 + $hinge_inter_gap);
+}
+
+module PlanDemo(){
+  HingeProngPlan(5);
+  %HingeGapPlan();
+  translate([0,0,1]) color("red") HingePinPlan();
+}
+
+module HingePinUnitCell(l) {
+  eff_l = l + $hinge_inter_gap;
+  pairs = floor(eff_l / (2*($hinge_prong_minwidth + $hinge_inter_gap)));
+  stride = eff_l / pairs;
+  $hinge__prong_width = stride/2 - $hinge_inter_gap;
+  for (i=[0:pairs-1]) {
+    translate(stride * i * [1,0,0])
+      children(0);
+  }
+}
+
+module HingePositive(l, behind){
+  HingePinUnitCell(l){
+    linextr_x_yz(0, $hinge__prong_width)
+      HingeProngPlan(behind);
+  }
+}
+
+module HingeNegative(l){
+  linextr_x_yz(-0.1, l+0.1)
+    HingePinPlan();
+  HingePinUnitCell(l){
+    linextr_x_yz($hinge__prong_width,
+                $hinge__prong_width*2 + 2*$hinge_inter_gap)
+      HingeGapPlan();
+  }
+}
+
+test_l = 30;
+test_wb = 12;
+test_h = 12;
+
+test_face_gap = 0.75;
+
+module Demo(){
+  difference(){
+    HingePositive(test_l, test_h/2);
+    %HingeNegative(test_l);
+  }
+}
+
+module TestBody(){
+  linextr_x_yz(0, test_l){
+    offset(delta = -test_face_gap/2)
+      polygon([[0,0],
+              [-test_wb/2, -test_h],
+              [+test_wb/2, -test_h]]);
+  }
+}
+
+module Test(){
+  difference(){
+    union(){
+      TestBody();
+      HingePositive(test_l, test_h/2);
+    }
+    HingeNegative(test_l);
+  }
+}
+
+//PlanDemo();
+//Demo();
+//TestBody();
+Test();