Part 2.7: Add G-code back-transform and tree support belt floor clipping

- Add BeltBackTransform class that inverts the shear/scale matrix and
  applies it in GCodeWriter::to_machine_coords() so G-code outputs in
  the machine's physical coordinate space, gated by new
  belt_gcode_back_transform config option
- Extend belt floor clipping to all three tree support pipelines
  (Prusa-style, Orca organic, TreeModelVolumes) with per-layer polygon
  clipping, anti-overhang integration, and belt raft extension layers
- Fix tree drop_nodes() belt termination, organic support global Z
  offset, collision calculation index bug, and first-layer brim/empty
  layer checks for belt printers

two-shot - first build built but didn't plumb to UI.  Woah.

add pre-slice axis remap, because Y needs to be Z

going to change tactic and move based on bbox min

switch to per axis snapping

per axis swap snap now per object

build plate tilt wasn't invalidating slicer settings

support upper bound now correct, need to get lower bound corrected

axis swapped support termination corrected

Z Shear works with and without pre-slice remap now
This commit is contained in:
harrierpigeon
2026-04-09 23:07:07 -05:00
parent ea5c6776b3
commit 9bbac19de4
20 changed files with 767 additions and 36 deletions
+22
View File
@@ -3128,6 +3128,28 @@ void GCodeProcessor::process_tags(const std::string_view comment, bool producers
if (boost::starts_with(comment, " belt_scale_z_angle = ")) {
try { m_result.belt_scale_z_angle = std::stof(std::string(comment.substr(22))); } catch (...) {} return;
}
// Pre-slice axis remap
auto parse_remap_axis = [](const std::string &s) -> BeltRemapAxis {
if (s == "pos_x") return BeltRemapAxis::PosX;
if (s == "pos_y") return BeltRemapAxis::PosY;
if (s == "pos_z") return BeltRemapAxis::PosZ;
if (s == "neg_x") return BeltRemapAxis::NegX;
if (s == "neg_y") return BeltRemapAxis::NegY;
if (s == "neg_z") return BeltRemapAxis::NegZ;
if (s == "rev_x") return BeltRemapAxis::RevX;
if (s == "rev_y") return BeltRemapAxis::RevY;
if (s == "rev_z") return BeltRemapAxis::RevZ;
return BeltRemapAxis::PosX;
};
if (boost::starts_with(comment, " belt_preslice_remap_x = ")) {
m_result.belt_preslice_remap_x = parse_remap_axis(trim(std::string(comment.substr(25)))); return;
}
if (boost::starts_with(comment, " belt_preslice_remap_y = ")) {
m_result.belt_preslice_remap_y = parse_remap_axis(trim(std::string(comment.substr(25)))); return;
}
if (boost::starts_with(comment, " belt_preslice_remap_z = ")) {
m_result.belt_preslice_remap_z = parse_remap_axis(trim(std::string(comment.substr(25)))); return;
}
}
// wipe start tag
if (boost::starts_with(comment, reserved_tag(ETags::Wipe_Start))) {