New approach to big items with calculating the best alignment with other big items.

This commit is contained in:
tamasmeszaros
2018-08-02 17:51:11 +02:00
parent 66d1eb9b9d
commit c8370b5408
3 changed files with 56 additions and 23 deletions

View File

@@ -314,8 +314,8 @@ inline RawPoint _Box<RawPoint>::center() const BP2D_NOEXCEPT {
using Coord = TCoord<RawPoint>;
RawPoint ret = {
static_cast<Coord>( (getX(minc) + getX(maxc))/2.0 ),
static_cast<Coord>( (getY(minc) + getY(maxc))/2.0 )
static_cast<Coord>( std::round((getX(minc) + getX(maxc))/2.0) ),
static_cast<Coord>( std::round((getY(minc) + getY(maxc))/2.0) )
};
return ret;

View File

@@ -590,7 +590,8 @@ public:
[this, &merged_pile](
Nfp::Shapes<RawShape>& /*pile*/,
const Item& item,
double occupied_area, double norm,
double occupied_area,
double norm,
double /*penality*/)
{
merged_pile.emplace_back(item.transformedShape());