enzoruiz/3dbinpacking

Pivot being summed with the wrong dimension when the item is rotated

bellini666 opened this issue · 0 comments

Just notice a problem where when an item in the bin is rotated, the calculation for the pivot will use its dimensions as if the rotation was WHD which produces the wrong pivot.

e.g. we have a (1, 2, 3) WHD item already in the bin at position (0, 0, 0).

If the item is in the WHD rotation, that means that a pivot in the width axis for that item would be (1, 0, 0).

But if this item is rotated to, lets say, HWD, the same pivot for the width axis for that item would have to be (2, 0, 0).

The fix is easy, the dimensions need to be converted to the default WHD system, which you already have a function for (the get_dimensions).

I'm sending a PR in a few minutes with the fix.