Optimize calculate_volumetric_multiplier
This commit is contained in:
parent
3ba47ea277
commit
0cf0c20532
@ -4695,18 +4695,9 @@ bool setTargetedHotend(int code){
|
||||
|
||||
|
||||
float calculate_volumetric_multiplier(float diameter) {
|
||||
float area = .0;
|
||||
float radius = .0;
|
||||
|
||||
radius = diameter * .5;
|
||||
if (! volumetric_enabled || radius == 0) {
|
||||
area = 1;
|
||||
}
|
||||
else {
|
||||
area = M_PI * pow(radius, 2);
|
||||
}
|
||||
|
||||
return 1.0 / area;
|
||||
if (!volumetric_enabled || diameter == 0) return 1.0;
|
||||
float d2 = diameter * 0.5;
|
||||
return 1.0 / (M_PI * d2 * d2);
|
||||
}
|
||||
|
||||
void calculate_volumetric_multipliers() {
|
||||
|
Loading…
Reference in New Issue
Block a user