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);