mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-05 23:01:17 +00:00
Belt: stop the purge prism printing plastic no toolchange needs
Two independent leaks of filament on the belt purge prism, plus the replan safety net the second one needs. 1. The early-truncation scan bounded itself with the prism's own toolchanges. ToolOrdering covers the whole print and the prism is a printed object in it, so the "last toolchange" the scan found was on the prism's own top layers -- it runs past every model object by design -- and the truncation cancelled nothing. Bound the scan at the tallest non-prism object (support layers included; on a belt they can top the object). On MCTEST5 that was 197 toolchanges over 39.4 mm of tower that no swap ever needed. 2. On a layer with no toolchange, the prism's entire fill printed as solid infill in its own filament. Drop the fills no toolchange claimed, right after the purge marking and before ensure_perimeters_infills_order() force-overrides whatever is left. Perimeters stay so the bar keeps a continuous wall. An earlier version of this deleted the entities and had to be reverted: psWipeTower can rerun without regenerating infill, and a later tool ordering may claim what this one did not. The entities are now stashed with their layer, region and index and put back exactly, the same reversibility contract layer truncation already had. 3. Both stashes go stale if an object step reruns: make_fills() clears and regenerates fills over m_layers only, so a stale stash would put old fills back next to new ones, and truncated layers would keep old perimeters/fills. Undo the plan's edits at the top of Print::process() whenever psWipeTower is not done. Every object-step invalidation also invalidates psWipeTower, so that condition is exactly "some object step may rerun"; when it is done nothing regenerates and the edits must stay. This also covers a prism left behind after belt mode is turned off, which previously stayed truncated forever. WipingExtrusions::is_entity_overridden() becomes public so the prism can tell claimed fills from unclaimed ones. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SsuY8Laiyh7q2zPVVKV3HZ
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
1b6fb2a81f
commit
1bcfe58064
@@ -2490,6 +2490,19 @@ void Print::process(long long *time_cost_with_cache, bool use_cache)
|
||||
if (m_objects.empty())
|
||||
return;
|
||||
|
||||
// Belt purge prism: _plan_belt_purge() (psWipeTower) truncates the prism's
|
||||
// layers and drops its unclaimed fills, stashing both so a replan can undo
|
||||
// them. The object steps below regenerate per-layer content over m_layers
|
||||
// ONLY, so if any of them is about to rerun the stashes must go back first;
|
||||
// otherwise truncated layers keep stale perimeters/fills and dropped fills
|
||||
// are re-inserted next to freshly generated ones. Every object-step
|
||||
// invalidation also invalidates psWipeTower, so "psWipeTower not done" is
|
||||
// exactly "some object step may rerun" -- and when it IS done nothing below
|
||||
// regenerates, and the plan's edits have to stay.
|
||||
if (!this->is_step_done(psWipeTower))
|
||||
for (PrintObject *obj : m_objects)
|
||||
obj->belt_undo_purge_plan();
|
||||
|
||||
for (PrintObject *obj : m_objects)
|
||||
obj->clear_shared_object();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user