chiark / gitweb /
air-hockey-puck: wip
[reprap-play.git] / chimney-cable-retainer.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 inrear_d_real = 20;
6 inrear_d = 15;
7 bar_th = 5;
8 general_th = 5;
9 between_cables = 150;
10 around_cables = 20;
11 cable_dia = 15;
12
13 total_d = 40;
14 above_h = 40;
15
16 // calculated
17
18 cable_x = around_cables + cable_dia/2;
19 total_x = cable_x * 2 + between_cables;
20
21 below_h = above_h;
22
23 sit_angle = atan2(inrear_d_real - inrear_d, below_h);
24
25 module CoreElevation(){
26   rotate(-sit_angle)
27     rectfromto([ 0, 0 ],
28                [ total_d, general_th ]);
29   rectfromto([ 0, 0 ],
30              [ general_th, above_h ]);
31   translate([ inrear_d, -above_h ])
32     rectfromto([ 0,0 ],
33                [ -bar_th, bar_th ]);
34 }
35
36 module BarMountElevation(){
37   hull(){
38     rotate(-sit_angle)
39       rectfromto([ 0, 0 ],
40                  [ inrear_d, general_th ]);
41     translate([ 0, -below_h ])
42       rectfromto([ 0,0 ],
43                  [ inrear_d, bar_th ]);
44   }
45 }
46
47 module Retainer(){ ////toplevel
48   difference(){
49     union(){
50       linextr_x_yz(0, total_x)
51         mirror([1,0])
52         CoreElevation();
53
54       for (x = [0, 0.5, 1] * (total_x - general_th))
55         translate([ x, 0,0 ])
56         linextr_x_yz(0, general_th)
57         mirror([1,0])
58         BarMountElevation();
59     }
60
61     for (x = [cable_x, total_x - cable_x])
62       translate([x, 0, 0])
63       linextr(-below_h/2, 100)
64       hull(){
65         translate([ 0, -(general_th + cable_dia/2) ])
66           circle(r = cable_dia/2);
67         translate([ 0, -(total_d + 1)])
68           square([ cable_dia, 1], center=true);
69       }
70   }
71 }