mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-20 23:09:18 -07:00
Fix of [2.3.0-alpha4] Crash - several models cause crash when slicing #5208
Fixed some issues in internal anchors of the Adaptive Cubic infill. The ugly and dangerous implicit casting operators in Line, MultiPoint, Polyline and Polygon were made explicit.
This commit is contained in:
@@ -350,23 +350,10 @@ void ExPolygon::get_trapezoids2(Polygons* polygons) const
|
||||
// find trapezoids by looping from first to next-to-last coordinate
|
||||
for (std::vector<coord_t>::const_iterator x = xx.begin(); x != xx.end()-1; ++x) {
|
||||
coord_t next_x = *(x + 1);
|
||||
if (*x == next_x) continue;
|
||||
|
||||
// build rectangle
|
||||
Polygon poly;
|
||||
poly.points.resize(4);
|
||||
poly[0](0) = *x;
|
||||
poly[0](1) = bb.min(1);
|
||||
poly[1](0) = next_x;
|
||||
poly[1](1) = bb.min(1);
|
||||
poly[2](0) = next_x;
|
||||
poly[2](1) = bb.max(1);
|
||||
poly[3](0) = *x;
|
||||
poly[3](1) = bb.max(1);
|
||||
|
||||
// intersect with this expolygon
|
||||
// append results to return value
|
||||
polygons_append(*polygons, intersection(poly, to_polygons(*this)));
|
||||
if (*x != next_x)
|
||||
// intersect with rectangle
|
||||
// append results to return value
|
||||
polygons_append(*polygons, intersection({ { { *x, bb.min.y() }, { next_x, bb.min.y() }, { next_x, bb.max.y() }, { *x, bb.max.y() } } }, to_polygons(*this)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user