Skip to content

Commit

Permalink
Fix possibly wrong disallowed areas computation
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 9, 2023
1 parent eeb93cf commit d509747
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/sliceDataStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,14 @@ Polygons SliceDataStorage::getMachineBorder(int checking_extruder_nr) const

Polygons disallowed_areas = mesh_group_settings.get<Polygons>("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<bool>("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<bool> extruder_is_used = getExtrudersUsed();

Expand Down

0 comments on commit d509747

Please sign in to comment.