chiark / gitweb /
crossbar-computer-led-mount: wip tower
[reprap-play.git] / crossbar-computer-led-mount.scad
1 // -*- C -*-
2
3 led_dia = 5 + 0.6;
4 led_depth = 3.5;
5
6 led_tip_z = 70;
7 led_angle = -60;
8
9 vert_space_inside = 8;
10 backfront_space_inside = 12;
11
12 backfront_mate_size = 20;
13
14 // tuning
15
16 tower_over_angle = 45;
17 tower_wall_thick = 1.6;
18 tower_base_height = 5;
19
20 //--- tests ---
21
22 test_width = 24;
23 test_height = 24;
24
25 test_thicks = [9,14,21];
26
27 module Tests(){ ////toplevel
28   for (thicki=[0:len(test_thicks)-1]) {
29     translate([thicki*test_width-0.5, 0, 0]) {
30       difference(){
31         cube([test_width,
32               test_thicks[thicki] + led_depth,
33               test_height]);
34         translate([test_width/2, -1, test_height/2])
35           rotate([-90,0,0])
36           cylinder(r=led_dia/2, h=led_depth+1, $fn=30);
37       }
38     }
39   }
40 }
41
42 //Tests();
43
44 //--- real thing ---
45
46 tower_frontheight = 30; //fixme
47 tower_overhang = led_dia * 4;
48
49 tower_over_max_y = tower_overhang * sin(tower_over_angle);
50 tower_over_max_z = tower_frontheight + tower_overhang * cos(tower_over_angle);
51 tower_total_max_z = tower_over_max_z + vert_space_inside + led_depth;
52 tower_rearwall_y = -(backfront_space_inside + tower_wall_thick);
53
54 backfront_mate_extra = (backfront_mate_size - (-tower_rearwall_y))/2;
55
56 module TowerWallCrossSection(){
57   // generates a 2D shape - a polygon
58   // x is what is going to be -y
59   // y is what is going to be z
60   polygon([[0,                  0],
61            [0,                  tower_frontheight],
62            [-tower_over_max_y,  tower_over_max_z],
63            [-tower_over_max_y,  tower_total_max_z],
64            [-tower_rearwall_y,  tower_total_max_z],
65            [-tower_rearwall_y,  0],
66            [-tower_rearwall_y+backfront_mate_extra, -tower_base_height],
67            [                 -backfront_mate_extra, -tower_base_height]]);
68 }
69
70 TowerWallCrossSection();