fixed last commit for single plate
[clinton/prusa3.git] / box_frame / y-axis-bracket.scad
CommitLineData
1ab13332
DR
1include <configuration.scad>
2
5b158621 3module bolt_track(width, length, height) {
dd937f63
VAH
4 hwidth = width / 2;
5 hdiff = hwidth - height;
6 union() {
7 difference() {
8 rotate([90, 0, 0])
9 translate([hwidth, height, -length])
10 cylinder(h=length, r=hwidth, $fn=$fn);
11
12 if (height < hwidth) {
13 translate([0, -1, height - hwidth - 1])
14 cube([width, length + 2, hdiff + 1]);
15 }
16 }
17 cube([width, length, height]);
18 }
1ab13332
DR
19}
20
e107833f 21function bracket_width(screw_area) = screw_area * 2 + y_threaded_rod_long_r * 2;
5b158621 22function bracket_depth(lip_thickness, screw_area) = screw_area * 2 + lip_thickness;
e107833f 23function bracket_height(lip_length=0) = y_threaded_rod_long_r * 2 + 6 * layer_height + lip_length;
1ab13332 24
5b158621 25module yrodbracket(screw_area, lip_thickness, lip_length, bevel_size=2.0) {
dd937f63
VAH
26 inner_radius = threaded_rod_diameter / 2;
27 screw_center = screw_area / 2;
1ab13332 28
dd937f63
VAH
29 width = bracket_width(screw_area);
30 depth = bracket_depth(lip_thickness, screw_area);
31 height = bracket_height(lip_length);
1ab13332 32
dd937f63
VAH
33 difference() {
34 translate([0, 0, -lip_length])
6d09bb8e 35 cube_fillet([width, depth, height], bevel_size, top=[2, 2, 2, 2]);
dd937f63 36 translate([screw_area, -1, -lip_length - lip_thickness])
e107833f 37 bolt_track(y_threaded_rod_long_r * 2, depth + 2, lip_length + lip_thickness + inner_radius);
1ab13332 38
dd937f63
VAH
39 translate([-1, lip_thickness, -lip_length - 1])
40 cube([width + 2, depth, lip_length + 1]);
1ab13332 41
dd937f63
VAH
42 // screw holes
43 for (x = [screw_center, width - screw_center]) {
44 for (y = [lip_thickness + screw_center, screw_area + lip_thickness + screw_center]) {
e107833f 45 translate([x, y, bracket_height() + 0.1])
dd937f63 46 rotate([180, 0, 0])
6d09bb8e 47 screw(head_drop=3, r_head=4.5);
dd937f63
VAH
48 }
49 }
50 }
1ab13332
DR
51}
52
5b158621 53rotate([90, 0, 0]) {
dd937f63
VAH
54 for (x = [0, bracket_width(12) + 5]) {
55 for (y = [0, bracket_height(3) + 5]) {
56 translate([x, 0, y])
57 yrodbracket(12, 3, 3);
58 }
59 }
5b158621 60}