-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.scad
85 lines (71 loc) · 4.1 KB
/
frame.scad
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
78
79
80
81
82
83
84
85
use <hardware/profile.scad>
use <hardware/bracket.scad>
module frame(bed_size,frame_spacing) {
// Corners
corner_length=bed_size+((frame_spacing*2)+120);
corner_vector=(bed_size/2)+(frame_spacing+10);
translate([corner_vector,corner_vector,0]) profile(corner_length);
translate([-corner_vector,corner_vector,0]) profile(corner_length);
translate([corner_vector,-corner_vector,0]) profile(corner_length);
translate([-corner_vector,-corner_vector,0]) profile(corner_length);
side_length=bed_size+(frame_spacing*2);
// Bottom
rotate(90,[0,1,0]) translate([-50,corner_vector,-corner_vector +10]) profile(side_length);
rotate(90,[1,0,0]) translate([corner_vector,50,-corner_vector +10]) profile(side_length);
rotate(-90,[0,1,0]) translate([50,-corner_vector,-corner_vector +10]) profile(side_length);
rotate(-90,[1,0,0]) translate([-corner_vector,-50,-corner_vector +10])profile(side_length);
// Top
rotate(90,[0,1,0]) translate([-(corner_length-10),corner_vector,-corner_vector +10]) profile(side_length);
rotate(90,[1,0,0]) translate([corner_vector,(corner_length-10),-corner_vector +10]) profile(side_length);
rotate(-90,[0,1,0]) translate([(corner_length-10),-corner_vector,-corner_vector +10]) profile(side_length);
rotate(-90,[1,0,0]) translate([-corner_vector,-(corner_length-10),-corner_vector +10])profile(side_length);
// Rail
rotate(90,[1,0,0]) translate([corner_vector,(corner_length-50),-corner_vector +10]) profile(side_length);
rotate(-90,[1,0,0]) translate([-corner_vector,-(corner_length-50),-corner_vector +10])profile(side_length);
// Brackets
bracket_corner=(bed_size/2)+frame_spacing;
// Top Brackets
top_bracket_vector=[-bracket_corner,-bracket_corner,corner_length-18.5];
translate(top_bracket_vector) bracket();
rotate(90,[0,0,1]) translate(top_bracket_vector) bracket();
rotate(180,[0,0,1]) translate(top_bracket_vector) bracket();
rotate(270,[0,0,1]) translate(top_bracket_vector) bracket();
// Bottom Brackets
bottom_bracket_vector = [-bracket_corner,-bracket_corner,41.5];
translate(bottom_bracket_vector) bracket();
rotate(90,[0,0,1]) translate(bottom_bracket_vector) bracket();
rotate(180,[0,0,1]) translate(bottom_bracket_vector) bracket();
rotate(270,[0,0,1]) translate(bottom_bracket_vector) bracket();
// Front Brackets
translate([0,-(bed_size/2)-(frame_spacing+1.5),bracket_corner+60]) rotate(90,[1,0,0]) {
translate([-bracket_corner,-bracket_corner,0]) bracket();
rotate(90,[0,0,1]) translate([-bracket_corner,-bracket_corner,0]) bracket();
rotate(180,[0,0,1]) translate([-bracket_corner,-bracket_corner-40,0]) bracket();
rotate(270,[0,0,1]) translate([-bracket_corner-40,-bracket_corner,0]) bracket();
}
// Back Brackets
translate([0,(bed_size/2)+(frame_spacing+18.5),bracket_corner+60]) rotate(90,[1,0,0]) {
translate([-bracket_corner,-bracket_corner,0]) bracket();
rotate(90,[0,0,1]) translate([-bracket_corner,-bracket_corner,0]) bracket();
rotate(180,[0,0,1]) translate([-bracket_corner,-bracket_corner-40,0]) bracket();
rotate(270,[0,0,1]) translate([-bracket_corner-40,-bracket_corner,0]) bracket();
}
side_bracket_vector=[-bracket_corner,-bracket_corner,0];
side_bracket_height=(bed_size/2)+(60+frame_spacing);
side_bracket_move=(bed_size/2)+(frame_spacing+1.5);
// Right Brackets
translate([side_bracket_move,0,side_bracket_height]) rotate(90,[0,1,0]) {
translate(side_bracket_vector) bracket();
rotate(90,[0,0,1]) translate(side_bracket_vector) bracket();
rotate(180,[0,0,1]) translate(side_bracket_vector) bracket();
rotate(270,[0,0,1]) translate(side_bracket_vector) bracket();
}
// Left Brackets
translate([-side_bracket_move,0,side_bracket_height]) rotate(-90,[0,1,0]) {
translate(side_bracket_vector) bracket();
rotate(90,[0,0,1]) translate(side_bracket_vector) bracket();
rotate(180,[0,0,1]) translate(side_bracket_vector) bracket();
rotate(270,[0,0,1]) translate(side_bracket_vector) bracket();
}
}
frame(220);