Browse Source

Optimize calculate_volumetric_multiplier

pull/1/head
Scott Lahteine 10 years ago
parent
commit
0cf0c20532
  1. 15
      Marlin/Marlin_main.cpp

15
Marlin/Marlin_main.cpp

@ -4695,18 +4695,9 @@ bool setTargetedHotend(int code){
float calculate_volumetric_multiplier(float diameter) { float calculate_volumetric_multiplier(float diameter) {
float area = .0; if (!volumetric_enabled || diameter == 0) return 1.0;
float radius = .0; float d2 = diameter * 0.5;
return 1.0 / (M_PI * d2 * d2);
radius = diameter * .5;
if (! volumetric_enabled || radius == 0) {
area = 1;
}
else {
area = M_PI * pow(radius, 2);
}
return 1.0 / area;
} }
void calculate_volumetric_multipliers() { void calculate_volumetric_multipliers() {

Loading…
Cancel
Save