/
Extruder.pde
58 lines (49 loc) · 1.1 KB
/
Extruder.pde
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
// Extruder Class
import java.lang.Math;
class Extruder {
int ToolNum;
Material Filament;
float ZThick;
float Diameter;
float FlowRate;
Extruder() {
ToolNum=0;
Filament=new Material("ABS");
Diameter=0.6;
ZThick=0.37;
}
Extruder(int anInt) {
ToolNum=anInt;
Filament=new Material("ABS");
Diameter=0.6;
ZThick=0.37;
}
Extruder(int anInt, String aString) {
ToolNum=anInt;
Filament=new Material(aString);
Diameter=0.6;
ZThick=0.37;
}
void setDiameter(float aFloat) {
Diameter=aFloat;
if(ZThick>Diameter) {
println("Z thickness greater than extruded diameter. Setting Z thickness to half diameter.");
ZThick=Diameter/2;
}
}
void setZThick(float aFloat) {
if(aFloat<Diameter) {
ZThick=aFloat;
} else {
println("Z thickness greater than extruded diameter. Setting Z thickness to half diameter.");
ZThick=Diameter/2;
}
}
void setFlowRate(float aFloat) {
FlowRate=aFloat;
}
float calcWallWidth() {
float freespace_area=PI*pow(Diameter/2,2);
return(freespace_area/ZThick);
}
}