mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Accumulate the total estimated print in doubles instead of floats.
Because total print time is typically a big floating point number and the time of trapezoid is typically a small number, summing those numbers leads to a loss in precision. Switching to doubles reduces the loss of precision. (cherry picked from commit c5982f40196c178bd824c556ac11e8c6f67d5e7a)
This commit is contained in:
@@ -459,7 +459,7 @@ class Print;
|
||||
AxisCoords axis_feedrate; // mm/s
|
||||
AxisCoords abs_axis_feedrate; // mm/s
|
||||
|
||||
//BBS: unit vector of enter speed and exit speed in x-y-z space.
|
||||
//BBS: unit vector of enter speed and exit speed in x-y-z space.
|
||||
//For line move, there are same. For arc move, there are different.
|
||||
Vec3f enter_direction;
|
||||
Vec3f exit_direction;
|
||||
@@ -508,7 +508,9 @@ class Print;
|
||||
// hard limit for the travel acceleration, to which the firmware will clamp.
|
||||
float max_travel_acceleration; // mm/s^2
|
||||
float extrude_factor_override_percentage;
|
||||
float time; // s
|
||||
// We accumulate total print time in doubles to reduce the loss of precision
|
||||
// while adding big floating numbers with small float numbers.
|
||||
double time; // s
|
||||
struct StopTime
|
||||
{
|
||||
unsigned int g1_line_id;
|
||||
|
||||
Reference in New Issue
Block a user