mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 14:32:36 +00:00
A raft is not a reason to reserve a tower. Print::apply runs normalize_fdm_2, which clears enable_prime_tower for a plate that purges one filament unless smooth timelapse or wrapping detection is on, so a single-filament plate with a raft prints no tower at all and the estimate was reserving bed area for one. Drop the input; need_wipe_tower is now exactly the two exceptions normalize_fdm_2 honours, named there so the next reason added has to be checked against it. The GUI preview and the validation containment check each re-derived "is a tower printed here" from the filament count instead of reading the estimate, so both missed the towers printed with no tool change to purge for. They now take the answer from the footprint, which is the drift this shared estimate exists to remove. A tower that is not printed estimates to zero, so its hull is degenerate and every check on it passes trivially - the containment check needs no gate of its own. WipeTowerData::width was written only by the pre-generation estimate and left at zero for the whole post-generation life of the Print, while its neighbour depth held the real value. Set it from the generator in both branches. The plate's height scan transformed every model part's full mesh per instance on each scene reload, discarding all but the z extent. The cached convex hull has the same z extent. A plate loaded from a sliced .gcode.3mf holds no objects and its filaments live in slice_filaments_info; the config-taking get_extruders overload returned an empty list for it, which sized the tower for a placeholder two filaments. It now answers the way the wx overload does, without reaching the plater. Also drop estimate_wipe_tower_size, which has no callers.
30 lines
1.4 KiB
C++
30 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
|
|
namespace Slic3r {
|
|
|
|
class ConfigBase;
|
|
|
|
// Pre-slice footprint of the wipe tower, shared by validation (Print), the GUI's placement
|
|
// clamp/preview/arrange and the CLI placement. The arithmetic is shared; the inputs below are
|
|
// not, so a change to how one caller derives them has to be mirrored in the others.
|
|
struct WipeTowerFootprint
|
|
{
|
|
double width = 0.; // effective width: equals depth for a rib wall, which squares the tower
|
|
double depth = 0.; // 0 when these inputs imply no tower
|
|
double height = 0.; // tallest object; drives the stability floor and the auto brim
|
|
double brim_width = 0.; // configured width, auto (-1) resolved by height
|
|
};
|
|
|
|
// filaments_cnt: filaments purged on the plate. The config cannot see custom G-code tool
|
|
// changes, so a count derived from the model must include them
|
|
// (Print::extruders(true)) or a real tower is sized as if it were never built.
|
|
// layer_height: thinnest layer the tower will be planned at.
|
|
//
|
|
// A raft is deliberately not a reason: normalize_fdm_2 clears enable_prime_tower for a plate
|
|
// purging one filament unless smooth timelapse or wrapping detection is on.
|
|
WipeTowerFootprint estimate_wipe_tower_footprint(const ConfigBase &config, size_t filaments_cnt, double layer_height, double max_object_height);
|
|
|
|
} // namespace Slic3r
|