mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-22 14:10:50 +08:00
Don't arrange items if the bed has negative area
Also interpret a bounding box with maxCorner lower then minCorner as a negative area box
This commit is contained in:
parent
3e53abf9bd
commit
6197acf576
@ -200,7 +200,8 @@ public:
|
||||
|
||||
template<class Unit = TCompute<P>>
|
||||
inline Unit area() const BP2D_NOEXCEPT {
|
||||
return Unit(width())*height();
|
||||
Unit s = std::signbit(width()) || std::signbit(height()) ? Unit(-1) : Unit(1);
|
||||
return s * libnest2d::abs(width() * height());
|
||||
}
|
||||
|
||||
static inline _Box infinite(const P ¢er = {TCoord<P>(0), TCoord<P>(0)});
|
||||
|
@ -528,7 +528,13 @@ void _arrange(
|
||||
}
|
||||
}
|
||||
|
||||
if (sl::area(corrected_bin) > 0)
|
||||
arranger(inp.begin(), inp.end());
|
||||
else {
|
||||
for (Item &itm : inp)
|
||||
itm.binId(BIN_ID_UNSET);
|
||||
}
|
||||
|
||||
for (Item &itm : inp) itm.inflate(-infl);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user