mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-04 17:44:46 -07: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:
parent
e5f7722f57
commit
36fcf17358
1 changed files with 20 additions and 4 deletions
|
|
@ -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
|
||||
double jerk_to_set = 0.0;
|
||||
unsigned int acceleration_to_set = 0;
|
||||
|
||||
if (this->on_first_layer()) {
|
||||
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);
|
||||
}
|
||||
|
||||
if (m_config.default_jerk.value > 0 && m_config.initial_layer_jerk.value > 0) {
|
||||
jerk_to_set = m_config.initial_layer_jerk.value;
|
||||
}
|
||||
} else {
|
||||
if (m_config.default_acceleration.value > 0 && m_config.travel_acceleration.value > 0) {
|
||||
acceleration_to_set = (unsigned int) floor(m_config.travel_acceleration.value + 0.5);
|
||||
if (m_config.default_acceleration.value > 0) {
|
||||
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) {
|
||||
gcode += m_writer.set_accel_and_jerk(acceleration_to_set, jerk_to_set);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue