chiark / gitweb /
fairphone-case: break out Struts (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Jan 2018 22:53:32 +0000 (22:53 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Jan 2018 22:53:32 +0000 (22:53 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
fairphone-case.scad

index 532d6982e72a59ef2bf52734d953a67f78e240ac..b29207d96b841441403f846dd4b75aba83266e76 100644 (file)
@@ -240,6 +240,18 @@ module AroundEdges(fill_zstart, fill_th, fill_downwards=0){
               [phone_width, -phone_height] + [-1,+1] * phone_cnr_rad);
 }
 
+module Struts(z_min, th){
+  for (i= [1 : 1 : case_struts_count]) {
+    translate([0,
+              -phone_height * i / (case_struts_count+1),
+              z_min + case_struts_solid_below])
+      linear_extrude(height= th
+                    -(case_struts_solid_below+case_struts_solid_above))
+      rectfromto([               epp2i[0], -0.5 * case_struts_width ],
+                [ phone_width - epp2i[0], +0.5 * case_struts_width ]);
+  }
+}
+
 module CaseBase(){
   AroundEdges(epp3[1], case_th_bottom, 1)
     EdgeProfile();
@@ -285,15 +297,7 @@ module Case(){ ////toplevel
       rectfromto(camera_pos_tl, camera_pos_br);
 
     // struts (invisible, because they're buried in the case)
-    for (i= [1 : 1 : case_struts_count]) {
-      translate([0,
-                -phone_height * i / (case_struts_count+1),
-                epp2i[1] - case_th_bottom + case_struts_solid_below])
-       linear_extrude(height= case_th_bottom
-                      -(case_struts_solid_below+case_struts_solid_above))
-       rectfromto([               epp2i[0], -0.5 * case_struts_width ],
-                  [ phone_width - epp2i[0], +0.5 * case_struts_width ]);
-    }
+    Struts(epp2i[1] - case_th_bottom, case_th_bottom);
   }
 }