Fix wipe tower rotation in the clearance check

The pre-generation square was rotated by degrees through the radians API
around the bed origin, and the post-slice mesh bottom was never rotated;
rotate both around the tower anchor via deg2rad. Exact no-op at angle 0.
This commit is contained in:
SoftFever
2026-08-03 15:31:06 +08:00
parent 4d81f0c181
commit 132086933f

View File

@@ -1040,13 +1040,14 @@ static StringObjectException layered_print_cleareance_valid(const Print &print,
wipe_tower_convex_hull.points.emplace_back(scale_(x + width), scale_(y));
wipe_tower_convex_hull.points.emplace_back(scale_(x + width), scale_(y + depth));
wipe_tower_convex_hull.points.emplace_back(scale_(x), scale_(y + depth));
wipe_tower_convex_hull.rotate(a);
wipe_tower_convex_hull.rotate(Geometry::deg2rad(a), Point(scale_(x), scale_(y)));
convex_hulls_temp.push_back(wipe_tower_convex_hull);
} else {
//here, wipe_tower_polygon is not always convex.
Polygon wipe_tower_polygon;
if (print.wipe_tower_data().wipe_tower_mesh_data)
wipe_tower_polygon = print.wipe_tower_data().wipe_tower_mesh_data->bottom;
wipe_tower_polygon.rotate(Geometry::deg2rad(a));
wipe_tower_polygon.translate(Point(scale_(x), scale_(y)));
convex_hulls_temp.push_back(wipe_tower_polygon);
}