chiark / gitweb /
sleepphone-cable-box: wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Sep 2018 22:47:45 +0000 (23:47 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Sep 2018 22:47:45 +0000 (23:47 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
sleepphone-cable-box.scad [new file with mode: 0644]

diff --git a/sleepphone-cable-box.scad b/sleepphone-cable-box.scad
new file mode 100644 (file)
index 0000000..a5a28db
--- /dev/null
@@ -0,0 +1,57 @@
+// -*- C -*-
+
+wall = 0.75 * [1,1,1];
+phone = [ 76.40, 30.96, 6.26 ];
+phone_button_z = 6.58;
+minwall = 0.25;
+
+button_dy_outer = 28.42;
+button_dy_inner = 19.05;
+button_dy_centre = 5.65;
+
+phone_slop = [1,1,1] * 0.5;
+
+// calculated
+
+top_z = max( phone[2] + wall[2],
+            phone_button_z + minwall )
+  + phone_slop[2];
+
+module MainProfileInnerHalf(){
+  p = phone + phone_slop;
+  pb = phone_button_z + phone_slop[2];
+  polygon([[ -2,                 0    ],
+          [ p[1]/2,             0    ],
+          [ p[1]/2,             p[2] ],
+          [ button_dy_outer/2,  p[2] ],
+          [ button_dy_outer/2,  pb   ],
+          [ button_dy_inner/2,  pb   ],
+          [ button_dy_inner/2,  p[2] ],
+          [ button_dy_centre/2, p[2] ],
+          [ button_dy_centre/2, pb   ],
+          [ -2,                 pb   ]]);
+}
+
+module MainProfile(){
+  p = phone + phone_slop;
+  for (m=[0,1]) mirror([m,0]) {
+      difference(){
+       translate([-1, -wall[2] ])
+         square([ p[1]/2 + wall[1] + 1, top_z + wall[2] ]);
+       MainProfileInnerHalf();
+      }
+    }
+}
+
+module Box(){
+  mirror([0,1,0]) rotate([90,0,0]) {
+    linear_extrude(height = phone[0] + wall[0])
+      MainProfile();
+    translate([0,0, phone[0]])
+      linear_extrude(height = wall[0])
+      hull() MainProfile();
+  }
+}
+
+//MainProfileInner();
+Box();