chiark / gitweb /
sprinkler-spike-receptacle: MainFitTest
[reprap-play.git] / sprinkler-spike-receptacle.scad
index 2c8534f467034ad20b817ddbddeaee602ff44aec..0d735df3cf6d6cb55522d1e7f0b63c4d908203c8 100644 (file)
@@ -2,6 +2,8 @@
 
 main_height = 95;
 
+spike_web_thick = 2.52 + 0.5;
+
 spike_top_width = 21.04;
 
 spike_botpos_height = 9.5;
@@ -9,6 +11,17 @@ spike_botpos_width = 11.68;
 
 topwall_width = 1.5;
 
+mount_dist = 20;
+mount_width = 10;
+mount_height = 5;
+mount_hole_dia = 4.5;
+mount_head_dia = 7.5;
+mount_hole_th = 2.5;
+
+// calculated
+
+main_width = spike_top_width + topwall_width*2;
+
 module NegativePlan(){
   x4z =
     (spike_top_width - spike_botpos_width) /
@@ -21,16 +34,93 @@ module NegativePlan(){
   polygon([[ x0, -5],
           [ x0, 0],
           [ x1, z1],
+          [ x1, z1+5],
+          [-x1, z1+5],
           [-x1, z1],
           [-x0, 0],
           [-x0, -5]]);
 }
 
 module PositivePlan(){
-  w = spike_top_width + topwall_width*2;
+  w = main_width;
   translate([ -w/2, 0 ])
     square([ w, main_height ]);
 }
 
-PositivePlan();
-//NegativePlan();  
+module MultiplySolidifyPlan(th){
+  for (r=[0,90]) {
+    rotate([0,0,r])
+      rotate([90,0,0])
+      translate([0,0,-th/2])
+      linear_extrude(height=th)
+      children(0);
+  }
+}
+
+module MultiplyForMount(){
+  for (r=[0:90:270])
+    rotate([0,0,r])
+    children(0);
+}
+
+module Mount(){
+  translate([ -1,
+             -mount_width/2,
+             0 ])
+    cube([ mount_dist + mount_width/2 + 1,
+          mount_width,
+          mount_height ]);
+}
+
+module MountHole(){
+  translate([ mount_dist, 0,0 ]) {
+    translate([0,0, -1])
+      cylinder(r= mount_hole_dia/2, h= 20, $fn=20);
+    translate([0,0, mount_hole_th])
+      cylinder(r = mount_head_dia/2, h=20, $fn=20);
+  }
+}
+
+module Main(){
+  difference(){
+    union(){
+      MultiplySolidifyPlan(spike_web_thick + topwall_width*2) PositivePlan();
+      MultiplyForMount() Mount();
+    }
+    MultiplySolidifyPlan(spike_web_thick) NegativePlan();
+    MultiplyForMount() MountHole();
+  }
+}
+
+module PlanTest(){
+  linear_extrude(height=2.0){
+    difference(){
+      PositivePlan();
+      NegativePlan();
+    }
+    difference(){
+      circle(r = spike_botpos_width/2 + 5);
+      circle(r = spike_botpos_width/2);
+      translate([-50, 0]) square([100,50]);
+    }
+  }
+  linear_extrude(height=4.0){
+    difference(){
+      translate([ -main_width/2, 0 ]) square([ main_width, 2 ]);
+      NegativePlan();
+    }
+  }
+}
+
+module MainFitTest(){
+  intersection(){
+    translate([0,0, -main_height + 0.5])
+      Main();
+    translate([-50,-50,0])
+      cube([100,100,100]);
+  }
+}
+
+//PlanTest();
+//Main();
+MainFitTest();