Fix out of bed items after arrange.

Disabled outline decimation for arrange and added very small (EPSILON) safety offset to bed detection boundaries.
This commit is contained in:
tamasmeszaros 2020-12-03 12:00:12 +01:00
parent 0a33aedc3a
commit 844ea89432
5 changed files with 17 additions and 16 deletions

View file

@ -1846,7 +1846,7 @@ void ModelInstance::transform_polygon(Polygon* polygon) const
arrangement::ArrangePolygon ModelInstance::get_arrange_polygon() const
{
static const double SIMPLIFY_TOLERANCE_MM = 0.1;
// static const double SIMPLIFY_TOLERANCE_MM = 0.1;
Vec3d rotation = get_rotation();
rotation.z() = 0.;
@ -1860,11 +1860,11 @@ arrangement::ArrangePolygon ModelInstance::get_arrange_polygon() const
// this may happen for malformed models, see:
// https://github.com/prusa3d/PrusaSlicer/issues/2209
if (!p.points.empty()) {
Polygons pp{p};
pp = p.simplify(scaled<double>(SIMPLIFY_TOLERANCE_MM));
if (!pp.empty()) p = pp.front();
}
// if (!p.points.empty()) {
// Polygons pp{p};
// pp = p.simplify(scaled<double>(SIMPLIFY_TOLERANCE_MM));
// if (!pp.empty()) p = pp.front();
// }
arrangement::ArrangePolygon ret;
ret.poly.contour = std::move(p);