Fix: the generation of the skirt does not take the wipe_tower into account.

jira: STUDIO-10381
Change-Id: I523d366d6d569696de48f872be827d73710cb526
(cherry picked from commit 939b405c35809dbceb65e5efdc65622407065b65)
This commit is contained in:
jiangkai.zhao
2025-02-17 16:38:36 +08:00
committed by Noisyfox
parent 501388d29f
commit d1d04d395e
3 changed files with 7 additions and 6 deletions

View File

@@ -642,9 +642,9 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
// We want to rotate and shift all extrusions (gcode postprocessing) and starting and ending position
float alpha = m_wipe_tower_rotation / 180.f * float(M_PI);
auto transform_wt_pt = [&alpha, this](const Vec2f& pt) -> Vec2f {
auto transform_wt_pt = [&alpha, this](const Vec2f& pt,bool rib_offset=true) -> Vec2f {
Vec2f out = Eigen::Rotation2Df(alpha) * pt;
out += m_wipe_tower_pos + m_rib_offset;
out += m_wipe_tower_pos + (rib_offset? m_rib_offset:Vec2f(0.f,0.f));
return out;
};
@@ -877,7 +877,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
avoid_bbx = scaled(m_wipe_tower_bbx);
Polygon avoid_points = avoid_bbx.polygon();
for (auto& p : avoid_points.points) {
Vec2f pp = transform_wt_pt(unscale(p).cast<float>());
Vec2f pp = transform_wt_pt(unscale(p).cast<float>(),false);
p = wipe_tower_point_to_object_point(gcodegen, pp + plate_origin_2d);
}
avoid_bbx = BoundingBox(avoid_points.points);

View File

@@ -191,6 +191,7 @@ public:
BoundingBoxf get_bbx() const {
BoundingBox box = get_extents(m_outer_wall.front());
BoundingBoxf res = BoundingBoxf(unscale(box.min), unscale(box.max));
res.translate(m_rib_offset.cast<double>());
return res;
}
Polylines get_outer_wall() const {

View File

@@ -2550,9 +2550,9 @@ Points Print::first_layer_wipe_tower_corners(bool check_wipe_tower_existance) co
if (check_wipe_tower_existance && (!has_wipe_tower() || m_wipe_tower_data.tool_changes.empty()))
return corners;
{
double width = m_config.prime_tower_width + 2*m_wipe_tower_data.brim_width;
double depth = m_wipe_tower_data.depth + 2*m_wipe_tower_data.brim_width;
Vec2d pt0(-m_wipe_tower_data.brim_width, -m_wipe_tower_data.brim_width);
double width = m_wipe_tower_data.bbx.max.x() - m_wipe_tower_data.bbx.min.x();
double depth = m_wipe_tower_data.bbx.max.y() -m_wipe_tower_data.bbx.min.y();
Vec2d pt0 = m_wipe_tower_data.bbx.min;
// First the corners.
std::vector<Vec2d> pts = { pt0,