Fix missing seam markers in the preview on overhanging outer walls (#16296)

* Fix missing seam markers in the preview on overhanging outer walls

An outer wall that starts on an overhang is labelled "Overhang wall" in
G-code, like the overhanging part of an inner wall, so the preview's seam
detector never opened a candidate for it.

The G-code generator now writes one comment, OUTER_OVERHANG_WALL, before
such a wall. The detector reads it and treats that wall as an outer wall
for seam detection only, so extrusion roles, legend and colours stay the
same. Markers also appear in G-code opened from a file.

* Share the outer wall check and drop the sloped seam test variant

A loop that starts on an overhang never gets a scarf seam, so the tagged
stream with a sloped start could not be generated. The outer wall check
used by the G-code generator and SeamPlacer moves to is_outer_wall(), and
the generator runs it last, after the cheap conditions.
This commit is contained in:
Damir Galeev authored and GitHub committed 2026-11-13 02:55:16 +08:00
1 parent 4b21b29cd2
commit 97bf1f4d1d
8 files changed
+274 -14

No files matched your search

+11
View File
@@ -8706,6 +8706,11 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_
m_multi_flow_segment_path_average_mm3_per_mm = weighted_sum_mm3_per_mm / total_multipath_length;
// Orca: end of multipath average mm3_per_mm value calculation
// Orca: the G-code labels the overhanging part of any wall "Overhang wall", so the preview cannot
// tell an outer wall that starts on an overhang from an inner one. Only outer walls need the tag.
m_outer_overhang_tag_pending = description == "perimeter" && !m_config.spiral_mode &&
paths.front().role() == erOverhangPerimeter && is_outer_wall(loop_ref);
if (!enable_seam_slope) {
for (const ExtrusionPath& path : paths) {
gcode += this->_extrude(path, description, speed_for_path(path));
@@ -9873,6 +9878,12 @@ std::string GCode::_extrude_piece(const ExtrusionPath &path, const std::string &
gcode += buf;
}
// Orca: must stay before the PA_CHANGE tag: Adaptive PA reads the line right after that tag.
if (m_outer_overhang_tag_pending) {
m_outer_overhang_tag_pending = false;
gcode += ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Outer_Overhang_Wall) + "\n";
}
if (last_was_wipe_tower || m_last_width != path.width) {
m_last_width = path.width;
sprintf(buf, ";%s%g\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Width).c_str(), m_last_width);