From d5097479ba10903be9c7f2f9a6fb5bdb6f7bd277 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 9 Nov 2023 14:24:17 +0100 Subject: [PATCH] Fix possibly wrong disallowed areas computation CURA-11293 --- src/sliceDataStorage.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sliceDataStorage.cpp b/src/sliceDataStorage.cpp index fbd4a5d1a9..2d45da94f2 100644 --- a/src/sliceDataStorage.cpp +++ b/src/sliceDataStorage.cpp @@ -560,9 +560,14 @@ Polygons SliceDataStorage::getMachineBorder(int checking_extruder_nr) const Polygons disallowed_areas = mesh_group_settings.get("machine_disallowed_areas"); disallowed_areas = disallowed_areas.unionPolygons(); // union overlapping disallowed areas - for (PolygonRef poly : disallowed_areas) - for (Point& p : poly) - p = Point(machine_size.max.x / 2 + p.X, machine_size.max.y / 2 - p.Y); // apparently the frontend stores the disallowed areas in a different coordinate system + + // The disallowed areas are always expressed in buildplate-centered coordinates + if (! mesh_group_settings.get("machine_center_is_zero")) + { + for (PolygonRef poly : disallowed_areas) + for (Point& p : poly) + p = Point(machine_size.max.x / 2 + p.X, machine_size.max.y / 2 - p.Y); + } std::vector extruder_is_used = getExtrudersUsed();