// -*- C -*-
+include <funcs.scad>
+
wall = 0.75 * [1,1,1];
phone = [ 76.40, 30.96, 6.26 ];
phone_button_z = 6.58;
button_dy_inner = 19.05;
button_dy_centre = 5.65;
-phone_slop = [1,1,1] * 0.5;
+phone_slop = 0.5 * [1,1,0]
+ + 0.5 * [0,0,1];
+
+led = [25.9, 9.44]; // y is from edge
+led_dia = 4.4;
+
+// next values include slop
+plug_maxw = 10.95 + 0.35;
+plug_minw= 6.53 + 0.35;
+plug_sllen= 6.50;
+plug_totlen = 84.90; // to maxw, including phone
+
+keeper_prong = 2;
// calculated
phone_button_z + minwall )
+ phone_slop[2];
+plugkeeper_x_maxw = phone[0] - plug_totlen;
+
module MainProfileInnerHalf(){
p = phone + phone_slop;
pb = phone_button_z + phone_slop[2];
}
}
-module Box(){
- mirror([0,1,0]) rotate([90,0,0]) {
- linear_extrude(height = phone[0] + wall[0])
+module BoxMain(){
+ rotate([0,0,90]) rotate([90,0,0]) {
+ linear_extrude(height = phone[0] + wall[0], convexity=20)
MainProfile();
translate([0,0, phone[0]])
- linear_extrude(height = wall[0])
+ linear_extrude(height = wall[0], convexity=20)
hull() MainProfile();
}
}
+module PlugKeeperProfile(){
+ p_max = [ 0, plug_maxw/2 ];
+ p_min = [ -plug_sllen, plug_minw/2 ];
+ d = unitvector2d(clockwise2d(vecdiff2d(p_min, p_max))) * keeper_prong;
+
+ translate([ plugkeeper_x_maxw, 0 ]) {
+ polygon([ p_min,
+ p_max,
+ p_max + d,
+ p_min + d ]);
+ }
+}
+
+module Box(){
+ difference(){
+ BoxMain();
+
+ translate([ led[0], phone[1]/2 - led[1], 1 ])
+ cylinder(r = led_dia/2, h= phone[2]*2, $fn=20);
+ }
+}
+
//MainProfileInner();
Box();
+linear_extrude(h=1) PlugKeeperProfile();