chiark / gitweb /
f4d21c0c9ea9a34842b0129dd87d58080ec4d082
[reprap-play.git] / pull-cord-keeper.scad
1 // -*- C -*-
2
3 hoopthick = 3;
4
5 hinnerrad = 15;
6 houterrad = hinnerrad + hoopthick;
7 hcentredist = 10;
8
9 blockdepth = 5;
10 blockwidth = hcentredist*2 + 6;
11
12 height = 20;
13
14 ziglen = hcentredist/2;
15
16 feedxgap = 5;
17 feedzgap = 5;
18 ribsgap = 1;
19
20 ribdepth = 3;
21 ribheight = 4;
22
23 blockoverlapcnr = 5;
24
25 module Oval(centredist, rad) {
26   hull() {
27     translate([-centredist/2,0,0]) circle(r=rad);
28     translate([+centredist/2,0,0]) circle(r=rad);
29   }
30 }  
31
32 module Hoop(){
33   difference(){
34     hull(){
35       Oval(hcentredist, houterrad);
36       translate([0, (blockdepth + hoopthick)/2 + hinnerrad])
37         square([blockwidth,
38                 blockdepth + hoopthick],
39                center=true);
40     }
41     Oval(hcentredist, hinnerrad);
42   }
43 }
44
45 module Positive(){
46   translate([0,0, -height/2])
47     linear_extrude(height=20)
48     Hoop();
49 }
50
51 module Ribs(){
52   imax = ceil(height*2 / ribheight);
53   for (i=[-imax:imax]) {
54     hull(){
55       translate([-ribdepth/2,
56                  ribheight*i,
57                  0])
58         polygon([[0,          0],
59                  [ribdepth, -ribheight],
60                  [ribdepth, +ribheight]]);
61       translate([50, 0])
62         square([1, height*2], center=true);
63     }
64   }
65 }           
66
67 module Division(cutmore) {
68   mirror([0,0,1]) {
69     translate([0, 0, -cutmore*feedzgap/2]) {
70       translate([-ziglen + -cutmore*feedxgap/2, -100, 0])
71         cube([100, 100, 50]);
72     }
73   }
74   translate([blockwidth/2 - blockoverlapcnr, -50, -50])
75     cube([100, 100, 100]);
76
77   translate([50, houterrad + blockdepth/2 + -cutmore*ribsgap, 0])
78     rotate([-90,0,90])
79     linear_extrude(height=100)
80     Ribs();
81 }
82
83 module SDemo(){
84   //difference(){
85   %  Positive();
86   //  Division(0);
87   //}
88   Division(-1);
89 }
90
91 module A(){
92   difference(){
93     Positive();
94     Division(+1);
95   }
96 }
97
98 module B(){
99   intersection(){
100     Positive();
101     Division(-1);
102   }
103 }
104
105 module Demo(){
106   color("red") A();
107 //  color("blue") B();
108 }
109
110 //Ribs();
111 //Demo();
112
113 A();
114 //B();
115 //%Division(+1);
116
117 //Demo();