chiark / gitweb /
brompton-computer-guard: rotate
[reprap-play.git] / brompton-computer-guard.scad
index b720bf1d879a30cc17e7e662d4afad57dad561de..8b1fcb239b3ca5828ea8aa71810aa9c1bc04feb4 100644 (file)
@@ -10,6 +10,9 @@ arch_breadth = 25;
 
 hole_dia = 3 + 0.5;
 
+pbase_tab = 15;
+pbase_thick = 2;
+
 // computed
 
 arch_alpha = atan(arch_height / (arch_width/2));
@@ -23,21 +26,27 @@ end_thick = arch_thick;
 holes = [[[  5  , 5  ], [16  , 21]], // left
         [[ 18.5, 4.5], [ 4.5, 22]]]; // right
 
-module ArchProfile(){
+module ArchCircle(rad){
+  translate([0,-arch_to_chord])
+    circle(rad, $fa=0.1);
+}
+
+module ArchProfile(pbase){
   intersection(){
     translate([-200,0])
       square([400,200]);
-    union(){
-      translate([0,-arch_to_chord]){
-       difference(){
-         circle(arch_in_rad + arch_thick, $fa=0.1);
-         circle(arch_in_rad, $fa=0.1);
-       }
+    difference(){
+      union(){
+       ArchCircle(arch_in_rad + arch_thick);
+       for (m=[0,1])
+         mirror([m,0])
+           translate([arch_width/2,0])
+           multmatrix([[1,pbase ? -0.75 : 0,0,0],
+                       [0,1,0,0],
+                       [0,0,1,0],
+                       [0,0,0,1]])
+           square([end_width, pbase ? pbase_tab : end_thick]);
       }
-      for (m=[0,1])
-       mirror([m,0])
-         translate([arch_width/2,0])
-         square([end_width, end_thick]);
     }
   }
 }
@@ -56,10 +65,21 @@ module Holes(){
 
 module Arch(){
   difference(){
-    rotate([0,0,180])
-      linear_extrude(height=arch_breadth) ArchProfile();
+    rotate([0,0,180]){
+      difference(){
+       union(){
+         linear_extrude(height=arch_breadth) ArchProfile(false);
+         linear_extrude(height=pbase_thick) hull(){
+           ArchProfile(true);
+           ArchProfile(false);
+         }
+       }
+       translate([0,0,-1]) linear_extrude(height=100)
+         ArchCircle(arch_in_rad);
+      }
+    }
     Holes();
   }
 }
 
-Arch();
+rotate([0,0,45]) Arch();