mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fix arrange crash with incorrect geometries. Guard the case with tests.
This commit is contained in:
parent
4aec14ddab
commit
a6f5fe7bea
6 changed files with 92 additions and 120 deletions
|
@ -618,19 +618,21 @@ void arrange(ArrangePolygons & arrangables,
|
|||
items.reserve(arrangables.size());
|
||||
|
||||
// Create Item from Arrangeable
|
||||
auto process_arrangeable =
|
||||
[](const ArrangePolygon &arrpoly, std::vector<Item> &outp)
|
||||
auto process_arrangeable = [](const ArrangePolygon &arrpoly,
|
||||
std::vector<Item> & outp)
|
||||
{
|
||||
Polygon p = arrpoly.poly.contour;
|
||||
const Vec2crd & offs = arrpoly.translation;
|
||||
double rotation = arrpoly.rotation;
|
||||
Polygon p = arrpoly.poly.contour;
|
||||
const Vec2crd &offs = arrpoly.translation;
|
||||
double rotation = arrpoly.rotation;
|
||||
|
||||
if (p.is_counter_clockwise()) p.reverse();
|
||||
|
||||
clppr::Polygon clpath(Slic3rMultiPoint_to_ClipperPath(p));
|
||||
|
||||
auto firstp = clpath.Contour.front();
|
||||
clpath.Contour.emplace_back(firstp);
|
||||
|
||||
if (!clpath.Contour.empty()) {
|
||||
auto firstp = clpath.Contour.front();
|
||||
clpath.Contour.emplace_back(firstp);
|
||||
}
|
||||
|
||||
outp.emplace_back(std::move(clpath));
|
||||
outp.back().rotation(rotation);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue