summaryrefslogtreecommitdiff
path: root/entry.scad
blob: c02ec11da2db1180da53abd1f71e2c963ef94ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
include <parameters.scad>

use <side.scad>

function as(x, d) = (x-d)/x;

function inflow_outline(i, k=0.1) = (i > 0)
  ? concat(
      [[i, (1 - exp(-i))/(1 - exp(-1))/2]],
      inflow_outline(i-k),
      [[i, (1 - exp(-i))/(1 - exp(-1))/-2]]
    )
  : [[0, 0]];

module inflow(W, R) {
    rotate([90, 0, 0])
    rotate([0, 90, 0])
    linear_extrude(height = W, center=true)
    scale(R)
    polygon(inflow_outline(1));
}

module inflow_grid(W, H, RW, RH, offset) {
    for (i = [1:num_hdd_y-1])
    translate([0, 0, i*(hrail_height + hdd_height) + hdd_height/2 + offset])
    difference() {
	inflow(W, RW);

	translate([0, 2.1, 0])
	inflow(W, RW-2);
    }

    for (i = [-1,1])
    translate([i*W/2, 0, H/2])
    scale([RH/RW, 1, 1])
    rotate([0, 90, 0])
    difference() {
	inflow(H, RW);

	translate([0, 2.1, 0])
	inflow(H-2, RW-2);
    }
}

module entry(capped_bottom=true) {
    W = hdd_length - hdd_standout;
    O = capped_bottom ? 4 : hrail_height;
    H = num_hdd_y * (hrail_height + hdd_height) + O;
    D = vrail_width * 5 / 8;
    S = 10;
    R = hdd_height;
    offset = 4;

    difference() {
	union() {
	    side_frame(W, D, H, S, capped_bottom, reinforce=false);
	    
	    intersection() {
		translate([0, -R + D/2, 0])
		inflow_grid(W, H, R, (support_bar_width + front_depth/4)*2 + 2, offset);
		
		ccube([W, large, large]);
	    }
	}

	ccube([2*W, large, 2*(hrail_height + hdd_height) + offset]);

	// add joins ... a second time as they got lost somewhere on
	// the way :-(
	translate([0,D/20,0])
	scale([1, 1.2, 1])
	# joins(W, D);
    }
}

rotate([-90, 0, 0])
entry();
contact: Jan Huwald // Impressum