From f49f1385b50da2cbef205d2a3588f9512e257c6c Mon Sep 17 00:00:00 2001 From: "salt.wei" Date: Fri, 25 Nov 2022 15:44:54 +0800 Subject: [PATCH] ENH: fix error acceleration in Gcode processor When travel in x-y-z move, the acceleration should be limited by trivector rather than one axis. Signed-off-by: salt.wei Change-Id: If8e5d394cf5d8772d324b9c851c047d9235d9b6b --- src/libslic3r/GCode/GCodeProcessor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 7c53cf59b..11b7fec67 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -2710,10 +2710,11 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line) get_retract_acceleration(static_cast(i)) : get_acceleration(static_cast(i))); + //BBS for (unsigned char a = X; a <= E; ++a) { float axis_max_acceleration = get_axis_max_acceleration(static_cast(i), static_cast(a)); if (acceleration * std::abs(delta_pos[a]) * inv_distance > axis_max_acceleration) - acceleration = axis_max_acceleration; + acceleration = axis_max_acceleration / (std::abs(delta_pos[a]) * inv_distance); } block.acceleration = acceleration;