chiark / gitweb /
sprinkler-spike-receptacle: wip
[reprap-play.git] / sprinkler-spike-receptacle.scad
1 // -*- C -*-
2
3 main_height = 95;
4
5 spike_web_thick = 2.52 + 0.5;
6
7 spike_top_width = 21.04;
8
9 spike_botpos_height = 9.5;
10 spike_botpos_width = 11.68;
11
12 topwall_width = 1.5;
13
14 // calculated
15
16 main_width = spike_top_width + topwall_width*2;
17
18 module NegativePlan(){
19   x4z =
20     (spike_top_width - spike_botpos_width) /
21     (main_height - spike_botpos_height);
22
23   x0 = (spike_botpos_width - x4z * spike_botpos_height)/2;
24   x1 =  spike_top_width/2;
25   z1 = main_height;
26
27   polygon([[ x0, -5],
28            [ x0, 0],
29            [ x1, z1],
30            [ x1, z1+5],
31            [-x1, z1+5],
32            [-x1, z1],
33            [-x0, 0],
34            [-x0, -5]]);
35 }
36
37 module PositivePlan(){
38   w = main_width;
39   translate([ -w/2, 0 ])
40     square([ w, main_height ]);
41 }
42
43 module MultiplySolidifyPlan(th){
44   for (r=[0,90]) {
45     rotate([0,0,r])
46       rotate([90,0,0])
47       translate([0,0,-th/2])
48       linear_extrude(height=th)
49       children(0);
50   }
51 }
52
53 module Main(){
54   difference(){
55     union(){
56       MultiplySolidifyPlan(spike_web_thick + topwall_width*2) PositivePlan();
57     }
58     MultiplySolidifyPlan(spike_web_thick) NegativePlan();
59   }
60 }
61
62 module PlanTest(){
63   linear_extrude(height=2.0){
64     difference(){
65       PositivePlan();
66       NegativePlan();
67     }
68     difference(){
69       circle(r = spike_botpos_width/2 + 5);
70       circle(r = spike_botpos_width/2);
71       translate([-50, 0]) square([100,50]);
72     }
73   }
74   linear_extrude(height=4.0){
75     difference(){
76       translate([ -main_width/2, 0 ]) square([ main_width, 2 ]);
77       NegativePlan();
78     }
79   }
80 }
81
82 //PlanTest();
83 Main();