Fix broken arrange from 2f65bcc83f

This commit is contained in:
tamasmeszaros 2020-11-24 18:44:59 +01:00
parent 77f845b0be
commit 5363dcb5bc

View File

@ -581,20 +581,6 @@ private:
using Shapes = TMultiShape<RawShape>; using Shapes = TMultiShape<RawShape>;
template<nfp::NfpLevel lvl>
static Shapes calcnfp(const Shapes &pile, const RawShape &orb)
{
Shapes ret; ret.reserve(2 * pile.size());
for (auto &stat : pile) {
Shapes subnfp = nfp::noFitPolygon<lvl>(stat, orb);
for (auto &nfp : subnfp)
ret.emplace_back(subnfp);
}
return nfp::merge(ret);
}
Shapes calcnfp(const Item &trsh, Lvl<nfp::NfpLevel::CONVEX_ONLY>) Shapes calcnfp(const Item &trsh, Lvl<nfp::NfpLevel::CONVEX_ONLY>)
{ {
using namespace nfp; using namespace nfp;
@ -927,11 +913,11 @@ private:
item.translation(final_tr); item.translation(final_tr);
item.rotation(final_rot); item.rotation(final_rot);
merged_pile_ = nfp::merge(merged_pile, item.transformedShape());
} }
if(can_pack) { if(can_pack) {
ret = PackResult(item); ret = PackResult(item);
merged_pile_ = nfp::merge(merged_pile_, item.transformedShape());
} else { } else {
ret = PackResult(best_overfit); ret = PackResult(best_overfit);
} }