chiark / gitweb /
pull-cord-keeper: fiddlings
[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,
78              hinnerrad/2 + houterrad/2 + blockdepth/2 + -cutmore*ribsgap,
79              0])
80     rotate([-90,0,90])
81     linear_extrude(height=100)
82     Ribs();
83 }
84
85 module SDemo(){
86   //difference(){
87   %  Positive();
88   //  Division(0);
89   //}
90   Division(-1);
91 }
92
93 module A(){
94   difference(){
95     Positive();
96     Division(+1);
97   }
98 }
99
100 module B(){
101   intersection(){
102     Positive();
103     Division(-1);
104   }
105 }
106
107 module Demo(){
108   color("red") A();
109   color("blue") B();
110 }
111
112 //Ribs();
113 //Demo();
114
115 //A();
116 //B();
117 //%Division(+1);
118
119 //Hoop();
120
121 Demo();