mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 02:35:54 +08:00
Fixed an out-of-bound situation in SLA support generator
This commit is contained in:
parent
20a4593ee1
commit
f288af0b5e
@ -254,12 +254,11 @@ std::vector<Vec3d> SLAAutoSupports::uniformly_cover(const std::pair<ExPolygon, c
|
|||||||
// In case there is just one point to place, we'll place it into the polygon's centroid (unless it lies in a hole).
|
// In case there is just one point to place, we'll place it into the polygon's centroid (unless it lies in a hole).
|
||||||
if (num_of_points == 1) {
|
if (num_of_points == 1) {
|
||||||
Point out(island.first.contour.centroid());
|
Point out(island.first.contour.centroid());
|
||||||
out(2) = island.second;
|
|
||||||
|
|
||||||
for (const auto& hole : island.first.holes)
|
for (const auto& hole : island.first.holes)
|
||||||
if (hole.contains(out))
|
if (hole.contains(out))
|
||||||
goto HOLE_HIT;
|
goto HOLE_HIT;
|
||||||
return std::vector<Vec3d>{unscale(out(0), out(1), out(2))};
|
return std::vector<Vec3d>{unscale(out(0), out(1), island.second)};
|
||||||
}
|
}
|
||||||
|
|
||||||
HOLE_HIT:
|
HOLE_HIT:
|
||||||
@ -296,10 +295,8 @@ HOLE_HIT:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (add_it) {
|
if (add_it)
|
||||||
out(2) = island.second;
|
|
||||||
island_new_points.emplace_back(unscaled_out);
|
island_new_points.emplace_back(unscaled_out);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return island_new_points;
|
return island_new_points;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user