chiark / gitweb /
earring-stand: TestBase good
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Jul 2016 13:33:36 +0000 (14:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Jul 2016 13:33:36 +0000 (14:33 +0100)
earring-stand.scad

index 08f0701ebc0d5281e7efc655c37e415f4bca7fc4..abca4e1342972966e93eabca8190c0fe88955a11 100644 (file)
@@ -9,8 +9,13 @@ eclip_inner_xstrt = 0.5;
 eclip_ult_angle = 44;
 eclip_base_epsilon = 0.5;
 
+eclip_each_len = 6;
+eclip_each_every = 15;
+
 test_alpha = 10;
 test_main_th = 1.5;
+test_eclips = 5;
+test_base_th = 2.5;
 
 // calculated
 
@@ -27,6 +32,8 @@ ppxl = -(r0 / sqrt(2)) + (eclip_inner_strt / sqrt(2));
 
 rgap = eclip_gap_rad;
 
+eclip_base_offset = r1;
+
 $fn=70;
 
 module EclipLPlanCore(alpha){
@@ -71,6 +78,32 @@ module EclipPPlan(main_th){
   translate([ppxl, 0]) square([main_th, r2]);
 }
 
-color("red") EclipLPlan(test_alpha);
-color("blue") rotate(test_alpha) EclipPPlan(test_main_th);
-color("green") EclipRPlan(test_alpha, test_main_th);
+module TestBase(){
+  translate([0,0, eclip_base_offset]){
+    for (i=[0 : 2: test_eclips-1]) {
+      translate([0, i*eclip_each_every])
+       rotate([90,0,0])
+       linear_extrude(height=eclip_each_len)
+       EclipLPlan(test_alpha);
+    }
+    for (j=[1 : 2: test_eclips-2]) {
+      translate([0, j*eclip_each_every])
+       rotate([90,0,0])
+       linear_extrude(height=eclip_each_len)
+       EclipRPlan(test_alpha, test_main_th);
+    }
+  }
+  translate([-r2, -eclip_each_len, -test_base_th])
+    cube([r2*2,
+         eclip_each_len + eclip_each_every*(test_eclips-1),
+         test_base_th]);
+}
+
+module PlanDemo(){
+  color("red") EclipLPlan(test_alpha);
+  color("blue") rotate(test_alpha) EclipPPlan(test_main_th);
+  color("green") EclipRPlan(test_alpha, test_main_th);
+}
+
+//PlanDemo();
+TestBase();