chiark / gitweb /
de224850b3161c883f1725f5663a2e1d6501c282
[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   MultiplySolidifyPlan(spike_web_thick) NegativePlan();
55 }
56
57 module PlanTest(){
58   linear_extrude(height=2.0){
59     difference(){
60       PositivePlan();
61       NegativePlan();
62     }
63     difference(){
64       circle(r = spike_botpos_width/2 + 5);
65       circle(r = spike_botpos_width/2);
66       translate([-50, 0]) square([100,50]);
67     }
68   }
69   linear_extrude(height=4.0){
70     difference(){
71       translate([ -main_width/2, 0 ]) square([ main_width, 2 ]);
72       NegativePlan();
73     }
74   }
75 }
76
77 //PlanTest();
78 Main();