Merge remote-tracking branch 'origin/master' into feature_arrange_with_libnest2d

This commit is contained in:
tamasmeszaros 2018-07-27 17:37:33 +02:00
commit 4e901a9db7
39 changed files with 5598 additions and 3029 deletions

View file

@ -611,14 +611,13 @@ bool arrange(Model &model, coordf_t dist, const Slic3r::BoundingBoxf* bb,
// The score is a weighted sum of the distance from pile center
// and the pile size
score = GRAVITY_RATIO * dist + DENSITY_RATIO * density;
std::cout << "big " << std::endl;
} else if(itemnormarea < BIG_ITEM_TRESHOLD && bigs.empty()) {
// If there are no big items, only small, we should consider the
// density here as well to not get silly results
auto bindist = pl::distance(ibb.center(), bin.center()) / norm;
auto density = std::sqrt(fullbb.width()*fullbb.height()) / norm;
score = GRAVITY_RATIO* bindist + DENSITY_RATIO * density;
score = GRAVITY_RATIO * bindist + DENSITY_RATIO * density;
} else {
// Here there are the small items that should be placed around the
// already processed bigger items.