mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Reduce artifacts from short travel moves before external perimeters (#10722)
Accel to extloop Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -6851,21 +6851,37 @@ std::string GCode::travel_to(const Point& point, ExtrusionRole role, std::string
|
|||||||
// Orca: we don't need to optimize the Klipper as only set once
|
// Orca: we don't need to optimize the Klipper as only set once
|
||||||
double jerk_to_set = 0.0;
|
double jerk_to_set = 0.0;
|
||||||
unsigned int acceleration_to_set = 0;
|
unsigned int acceleration_to_set = 0;
|
||||||
|
|
||||||
if (this->on_first_layer()) {
|
if (this->on_first_layer()) {
|
||||||
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) {
|
if (m_config.default_acceleration.value > 0 && m_config.initial_layer_acceleration.value > 0) {
|
||||||
acceleration_to_set = (unsigned int) floor(m_config.initial_layer_acceleration.value + 0.5);
|
acceleration_to_set = (unsigned int) floor(m_config.initial_layer_acceleration.value + 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) {
|
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) {
|
||||||
jerk_to_set = m_config.initial_layer_jerk.value;
|
jerk_to_set = m_config.initial_layer_jerk.value;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_config.default_acceleration.value > 0 && m_config.travel_acceleration.value > 0) {
|
if (m_config.default_acceleration.value > 0) {
|
||||||
acceleration_to_set = (unsigned int) floor(m_config.travel_acceleration.value + 0.5);
|
if (role == erExternalPerimeter && travel.length() < scale_(EXTRUDER_CONFIG(retraction_minimum_travel))) {
|
||||||
|
if (m_config.outer_wall_acceleration.value > 0)
|
||||||
|
acceleration_to_set = (unsigned int) floor(m_config.outer_wall_acceleration.value + 0.5);
|
||||||
|
} else {
|
||||||
|
if (m_config.travel_acceleration.value > 0)
|
||||||
|
acceleration_to_set = (unsigned int) floor(m_config.travel_acceleration.value + 0.5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (m_config.default_jerk.value > 0 && m_config.travel_jerk.value > 0) {
|
|
||||||
jerk_to_set = m_config.travel_jerk.value;
|
if (m_config.default_jerk.value > 0) {
|
||||||
|
if (role == erExternalPerimeter && travel.length() < scale_(EXTRUDER_CONFIG(retraction_minimum_travel))) {
|
||||||
|
if (m_config.outer_wall_jerk.value > 0)
|
||||||
|
jerk_to_set = m_config.outer_wall_jerk.value;
|
||||||
|
} else {
|
||||||
|
if (m_config.travel_jerk.value > 0)
|
||||||
|
jerk_to_set = m_config.travel_jerk.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_writer.get_gcode_flavor() == gcfKlipper) {
|
if (m_writer.get_gcode_flavor() == gcfKlipper) {
|
||||||
gcode += m_writer.set_accel_and_jerk(acceleration_to_set, jerk_to_set);
|
gcode += m_writer.set_accel_and_jerk(acceleration_to_set, jerk_to_set);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user