purge tower additional compensation

This commit is contained in:
harrierpigeon
2026-08-08 16:35:55 -05:00
parent 7cc50d750c
commit 79c93733d3
+13 -8
View File
@@ -9074,15 +9074,20 @@ bool Plater::priv::ensure_belt_purge_tower()
return false; // already up to date — do not touch the model return false; // already up to date — do not touch the model
// --- Position ---------------------------------------------------------- // --- Position ----------------------------------------------------------
// Belt-travel axis: anchor the bar at the parts' belt-axis MINIMUM and span // Belt-travel axis: span the parts' belt band, extended at BOTH tilted ends
// just the parts' belt extent (+ small margin). Filament changes happen // by the ramp allowance. The bar's tilted ends are triangular ramps where a
// over the parts' belt band, so the bar must sit there to absorb them; // slicing plane cuts less than the full height, so those layers can't hold a
// extending it far up the belt moves its body away from the toolchange // full purge. Pull the leading edge toward Y=0 below the parts' minimum and
// layers and the purge goes unabsorbed (empirically, moving the tower // push the trailing edge past the parts' maximum, each by height/sin(theta)
// toward the parts' Y-min clears the "cannot absorb" warning). // (= sqrt(2)*height at 45 deg), so the full-cross-section region covers the
// whole parts' band and every toolchange layer gets a full slice of the bar.
// (Filament changes happen over the parts' belt band — empirically the tower
// must sit there, anchored near the parts' Y-min, to clear the "cannot
// absorb" warning.)
const double margin = 5.; const double margin = 5.;
const double belt_start = belt_min; // parts' belt-axis minimum const double ramp_compensation = height / sin_t;
const double belt_end = belt_max + margin; // just past the parts — stay low / near the parts const double belt_start = std::max(0.0, belt_min - ramp_compensation); // leading ramp, toward Y=0
const double belt_end = belt_max + margin + ramp_compensation; // trailing ramp, past the parts
const double length = std::max(belt_end - belt_start, 10.); const double length = std::max(belt_end - belt_start, 10.);
const double belt_center = 0.5 * (belt_start + belt_end); const double belt_center = 0.5 * (belt_start + belt_end);