mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-25 09:04:26 +08:00
fix negative area from elephant foot reduction
assert was screaming, with reason.
This commit is contained in:
parent
055794f822
commit
4ea2fc1482
@ -1228,6 +1228,11 @@ ExPolygons variable_offset_inner_ex(const ExPolygon &expoly, const std::vector<s
|
||||
holes.reserve(expoly.holes.size());
|
||||
for (const Polygon& hole : expoly.holes)
|
||||
append(holes, fix_after_outer_offset(mittered_offset_path_scaled(hole.points, deltas[1 + &hole - expoly.holes.data()], miter_limit), ClipperLib::pftNegative, false));
|
||||
for (auto it = holes.begin(); it != holes.end();)
|
||||
if (ClipperLib::Area(*it) < 0.) {
|
||||
it = holes.erase(it);
|
||||
}
|
||||
else ++it;
|
||||
#ifndef NDEBUG
|
||||
for (auto &c : holes)
|
||||
assert(ClipperLib::Area(c) > 0.);
|
||||
|
Loading…
x
Reference in New Issue
Block a user