chiark / gitweb /
sprinkler-spike-receptacle: wip
[reprap-play.git] / sprinkler-spike-receptacle.scad
1 // -*- C -*-
2
3 main_height = 95;
4
5 spike_top_width = 21.04;
6
7 spike_botpos_height = 9.5;
8 spike_botpos_width = 11.68;
9
10 topwall_width = 1.5;
11
12 // calculated
13
14 main_width = spike_top_width + topwall_width*2;
15
16 module NegativePlan(){
17   x4z =
18     (spike_top_width - spike_botpos_width) /
19     (main_height - spike_botpos_height);
20
21   x0 = (spike_botpos_width - x4z * spike_botpos_height)/2;
22   x1 =  spike_top_width/2;
23   z1 = main_height;
24
25   polygon([[ x0, -5],
26            [ x0, 0],
27            [ x1, z1],
28            [ x1, z1+5],
29            [-x1, z1+5],
30            [-x1, z1],
31            [-x0, 0],
32            [-x0, -5]]);
33 }
34
35 module PositivePlan(){
36   w = main_width;
37   translate([ -w/2, 0 ])
38     square([ w, main_height ]);
39 }
40
41 module PlanTest(){
42   linear_extrude(height=2.0){
43     difference(){
44       PositivePlan();
45       NegativePlan();
46     }
47     difference(){
48       circle(r = spike_botpos_width/2 + 5);
49       circle(r = spike_botpos_width/2);
50       translate([-50, 0]) square([100,50]);
51     }
52   }
53   linear_extrude(height=4.0){
54     difference(){
55       translate([ -main_width/2, 0 ]) square([ main_width, 2 ]);
56       NegativePlan();
57     }
58   }
59 }
60
61 PlanTest();