-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemp-tower.scad
135 lines (115 loc) · 4.26 KB
/
temp-tower.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/** Small temperature tower.
©2023 Neale Pickett <neale@woozle.org>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. The software is provided "as
is", without warranty of any kind, express or implied, including but not limited
to the warranties of merchantability, fitness for a particular purpose and
noninfringement. In no event shall the authors or copyright holders be liable
for any claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the software or
the use or other dealings in the software.
*/
/* [Main Options] */
// Temperature at the bottom
TempBase = 220; // [100:300]
// Temperature increase at each tier
TempIncrease = -10; // [-20:20]
// How many tiers
Tiers = 7;
// Print a full tower? If false, you just get two poles.
FullTower = true;
// Text to engrave on the side
SideText = "PLA";
/* [Hidden] */
PlateHeight = 0.8;
Font = "Liberation Sans:style=bold";
EngraveDepth = 0.3;
$fn = 90;
module FullTier(temperature) {
difference() {
cube([25, 5, 5]);
translate([12, -1, 0]) cube([12, 10, 5 - PlateHeight]); // Inner cavity
translate([0, 2.5, 0]) rotate([0, 45, 0]) rotate([0, 0, 90]) cube(5*sqrt(2), center=true); // Overhang
translate([2.5, 2.5, 0.1]) cylinder(r=1, h=5); // Overhang hole
translate([4.4, EngraveDepth, 0.8])
rotate([90, 0, 0])
linear_extrude(EngraveDepth + 0.1)
text(str(temperature), size=3.2, font=Font);
}
translate([22, 2.5, 0]) cylinder(r=1, h=3); // Cylinder
translate([14, 2.5, 0]) cylinder(r1=1, r2=0.2, h=3); // Cone
translate([5, 0.5, 0.4]) cube([6, 5, 0.2]); // Rear protrusion: y translate = protrusion depth
}
module Posts(temperature) {
difference() {
translate([4, 0, 0]) cube([8, 5, 5]);
translate([4.4, EngraveDepth, 0.8])
rotate([90, 0, 0])
linear_extrude(EngraveDepth + 0.1)
text(str(temperature), size=3.2, font=Font);
}
translate([22, 2.5, 0]) cylinder(r=2, h=5);
}
module Tier(temperature) {
if (FullTower) {
FullTier(temperature);
} else {
Posts(temperature);
}
}
module EngraveText(text) {
linear_extrude(EngraveDepth + 0.1)
text(text, size=3.2, valign="center", font=Font);
}
// Ouptut special code to add to 3mf file
module ZCodeWrite(text) {
echo(str(
"#",
"#CUSTOM",
"#3mf",
"#Metadata/Prusa_Slicer_custom_gcode_per_print_z.xml",
"#", text,
"##"
));
}
module main() {
ZCodeWrite("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
ZCodeWrite("<custom_gcodes_per_print_z>");
difference() {
union() {
cube([25, 5, PlateHeight]); // Floor plate
for (tier = [0 : 1 : Tiers-1]) {
z = PlateHeight + (5 * tier);
temp = TempBase + (TempIncrease * tier);
ZCodeWrite(str(
"<code print_z=\"", z, "\"",
" type=\"4\"",
" extruder=\"1\"",
" color=\"\"",
" extra=\"M104 S", temp, "\"",
" gcode=\"M104 S", temp, "\"/>",
""
));
translate([0, 0, z]) Tier(temp);
}
}
if (FullTower) {
translate([25 - EngraveDepth, 2.5, 1+PlateHeight])
rotate([90, -90, 90])
EngraveText(SideText);
} else {
translate([4 + EngraveDepth, 2.5, 1+PlateHeight])
rotate([90, -90, -90])
EngraveText(SideText);
}
}
ZCodeWrite("<mode value=\"SingleExtruder\"/>");
ZCodeWrite("</custom_gcodes_per_print_z>");
}
main();