Refine wipe tower size estimates, fit checks, and travel-path code

- Account the SEMM flush-matrix volume in the rib tower size estimate,
  reading its gate from the plate config: m_print may not have been
  applied yet on fresh plates or in the CLI. Rectangle output is
  unchanged.
- Drop the brim growth from the printable-area tower check — the mesh
  bottom already includes the brim, and the pre-slice auto-brim
  estimate can overshoot the generated brim by several mm, so prints
  that physically fit hard-errored. Skip the check when no tower will
  be printed.
- Test the rotated tower body polygon in the gap-route early-out; at
  off-axis angles the body rect's bounding box covers most of the brim
  ring, defeating the tightening.
- Regenerate the wipe tower when it is moved or rotated while
  wait_for_temp_on_wipe_tower is active: the temperature-wait park
  bakes a bed-relative side choice into the cached tower gcode, so a
  re-slice after dragging the tower could park off the bed. Adds a
  regression test.
- Clean up: reuse OozePrevention::_get_temp for the deferred preheat,
  park and route against the exact printable-area polygon, fold the
  bed clamp into generate_path_to_wipe_tower, and take ConfigBase in
  the flush estimators so PartPlate passes the plate config directly.
This commit is contained in:
SoftFever
2026-08-04 13:53:55 +08:00
parent 4303d723a1
commit 8d2196d4a6
7 changed files with 192 additions and 77 deletions

View File

@@ -17,6 +17,7 @@ namespace Slic3r
class WipeTowerWriter2;
class PrintRegionConfig;
class ConfigBase;
class WipeTower2
{
@@ -26,7 +27,10 @@ public:
// in WipeTowerIntegration::append_tcr2 does not strip it.
static const std::string wait_for_temp_tag() { return ";_WAIT_FOR_TEMP_ON_WIPE_TOWER"; }
static std::pair<double, double> get_wipe_tower_cone_base(double width, double height, double depth, double angle_deg);
static std::vector<std::vector<float>> extract_wipe_volumes(const PrintConfig& config);
static std::vector<std::vector<float>> extract_wipe_volumes(const ConfigBase& config);
// Estimated total flush volume of a SEMM print with the given number of filaments,
// used to reserve wipe tower space before the tower is generated.
static float estimate_semm_flush_volume(const ConfigBase& config, size_t filaments_cnt);
// Construct ToolChangeResult from current state of WipeTower2 and WipeTowerWriter2.
@@ -272,8 +276,7 @@ private:
} m_bed_shape;
float m_bed_width; // width of the bed bounding box
Vec2f m_bed_bottom_left; // bottom-left corner coordinates (for rectangular beds)
BoundingBoxf m_bed_bbox; // bounding box of the printable area
Polygon m_bed_polygon; // printable_area contour (scaled), for beds neither rectangular nor circular
Polygon m_bed_polygon; // printable_area contour (scaled)
float m_perimeter_width = 0.4f * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_extrusion_flow = 0.038f; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter.