1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-23 20:18:52 +00:00

Optimize calculate_volumetric_multiplier

This commit is contained in:
Scott Lahteine 2015-02-23 18:10:35 -08:00
parent 3ba47ea277
commit 0cf0c20532

View File

@ -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() {