-
Notifications
You must be signed in to change notification settings - Fork 18
/
enclosure.rb
78 lines (61 loc) · 2.21 KB
/
enclosure.rb
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
require_relative 'motors/NEMA17'
require_relative 'panels/DeckPanel'
extrusion :EnclosureFrontPanel do
# !@attribute [r] thickness
# @return [Number] the panel thickness (same as the extrusion length)
attr_reader thickness: ENCLOSURE_THICKNESS
attr_reader size: Size[ENCLOSURE_BOX.x, ENCLOSURE_BOX.z]
length thickness
rectangle size: size
# Orientation marker
translate FRAME_KLASS.width/2, FRAME_KLASS.width/2 do
circle diameter:5.mm
rectangle origin:[1.cm, 0], size:[1.cm, 1.mm]
rectangle origin:[0, 1.cm], size:[1.mm, 1.cm]
end
end
extrusion :EnclosureSidePanel do
# !@attribute [r] thickness
# @return [Number] the panel thickness (same as the extrusion length)
attr_reader thickness: ENCLOSURE_THICKNESS
attr_reader size: Size[ENCLOSURE_BOX.y, ENCLOSURE_BOX.z]
length thickness
rectangle size: size
# Orientation marker
translate FRAME_KLASS.width/2, FRAME_KLASS.width/2 do
circle diameter:5.mm
rectangle origin:[1.cm, 0], size:[1.cm, 1.mm]
rectangle origin:[0, 1.cm], size:[1.mm, 1.cm]
end
end
extrusion :TopPanel do
# !@attribute [r] thickness
# @return [Number] the panel thickness (same as the extrusion length)
attr_reader thickness: ENCLOSURE_THICKNESS
size = DECK_SIZE
length thickness
rectangle size: DECK_SIZE
# Orientation marker
translate FRAME_KLASS.width/2, FRAME_KLASS.width/2 do
circle diameter:5.mm
rectangle origin:[1.cm, 0], size:[1.cm, 1.mm]
rectangle origin:[0, 1.cm], size:[1.mm, 1.cm]
end
end
# extrusion :BackPanel do
# length PANEL_THICKNESS
# size = Size[12.cm, Z_RAIL_LENGTH + FRAME_KLASS.width]
# rectangle size:size
# # Bolt holes for mounting to the frame
# repeat center:size/2, step:size.inset(2.cm, FRAME_KLASS.width/2), count:2 do
# circle diameter:5.mm
# end
# # Motor driver board mounting holes
# repeat center:[size.x/2, 15.cm], step:10.cm, count:[2,2] do
# circle diameter:3.mm.cm
# end
# # Laser driver board mounting holes
# repeat center:[size.x/2, 5.5.cm], step:[67.75.mm, 72.75.mm], count:2 do
# circle diameter:2.5.mm
# end
# end