Commit e1465c4e authored by MagoKimbra's avatar MagoKimbra

Fix

parent a74796c5
...@@ -6382,33 +6382,13 @@ bool setTargetedHotend(int code) ...@@ -6382,33 +6382,13 @@ bool setTargetedHotend(int code)
} }
float calculate_volumetric_multiplier(float diameter) float calculate_volumetric_multiplier(float diameter) {
{ if (!volumetric_enabled || diameter == 0) return 1.0;
float area = .0; float d2 = diameter * 0.5;
float radius = .0; 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() {
{ for (int i=0; i<EXTRUDERS; i++)
volumetric_multiplier[0] = calculate_volumetric_multiplier(filament_size[0]); volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
#if EXTRUDERS > 1
volumetric_multiplier[1] = calculate_volumetric_multiplier(filament_size[1]);
#if EXTRUDERS > 2
volumetric_multiplier[2] = calculate_volumetric_multiplier(filament_size[2]);
#if EXTRUDERS > 3
volumetric_multiplier[3] = calculate_volumetric_multiplier(filament_size[3]);
#endif //EXTRUDERS > 3
#endif //EXTRUDERS > 2
#endif //EXTRUDERS > 1
} }
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment