mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Fix in seams detection (restore detection after wiping)
This commit is contained in:
parent
a4ad4ff4a9
commit
405a7e84d6
1 changed files with 5 additions and 0 deletions
|
@ -2672,6 +2672,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||||
const Vec3f new_pos = m_result.moves.back().position - m_extruder_offsets[m_extruder_id];
|
const Vec3f new_pos = m_result.moves.back().position - m_extruder_offsets[m_extruder_id];
|
||||||
const std::optional<Vec3f> first_vertex = m_seams_detector.get_first_vertex();
|
const std::optional<Vec3f> first_vertex = m_seams_detector.get_first_vertex();
|
||||||
// the threshold value = 0.0625f == 0.25 * 0.25 is arbitrary, we may find some smarter condition later
|
// the threshold value = 0.0625f == 0.25 * 0.25 is arbitrary, we may find some smarter condition later
|
||||||
|
|
||||||
if ((new_pos - *first_vertex).squaredNorm() < 0.0625f) {
|
if ((new_pos - *first_vertex).squaredNorm() < 0.0625f) {
|
||||||
set_end_position(0.5f * (new_pos + *first_vertex));
|
set_end_position(0.5f * (new_pos + *first_vertex));
|
||||||
store_move_vertex(EMoveType::Seam);
|
store_move_vertex(EMoveType::Seam);
|
||||||
|
@ -2681,6 +2682,10 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
|
||||||
m_seams_detector.activate(false);
|
m_seams_detector.activate(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type == EMoveType::Extrude && m_extrusion_role == erExternalPerimeter) {
|
||||||
|
m_seams_detector.activate(true);
|
||||||
|
m_seams_detector.set_first_vertex(m_result.moves.back().position - m_extruder_offsets[m_extruder_id]);
|
||||||
|
}
|
||||||
|
|
||||||
// store move
|
// store move
|
||||||
store_move_vertex(type);
|
store_move_vertex(type);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue