-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualisation #239
Comments
You want to draw the actual items, not just an encapsulating cuboid? (where those things are different). I think your identified solution is probably the only feasible one, there is nothing in BoxPacker itself that stores that kind of information and I can't see an easy way of adding it. The data structures are arrays, but the keys are already used for deduplication and then assumed not to matter. Happy to take a look at PR in theory though if you think it could be done without regressing performance. The starting point would be here: https://github.com/dvdoug/BoxPacker/blob/3.x/src/OrientatedItemFactory.php#L226. |
@dvdoug at first glance it seems like rekeying the array to provide orientation information might be the starting point.
This assumes:
Just wanted to check this with you first before taking it further, I can see other sections of code that would need to be updated too. If I mange to make some changes, do you want me to use Notes to self(none of this has been tested) https://github.com/dvdoug/BoxPacker/blob/3.x/src/OrientatedItemFactory.php#L92 - https://github.com/dvdoug/BoxPacker/blob/3.x/src/OrientatedItemFactory.php#L121 - add key to https://github.com/dvdoug/BoxPacker/blob/3.x/src/OrientatedItemFactory.php#L177 - add key to https://github.com/dvdoug/BoxPacker/blob/3.x/src/OrientatedItemFactory.php#L96
|
Yes, 3.x please as it's easier to merge up than backport. X axis is width, Y is length, Z is depth. Thinking about it a bit now, the dimension comparison calculations you were looking as a fallback for your own application - maybe adding a new getter into |
Is it possible to know which rotation has been used when an item is packed?
Although we've started with a basic cuboid representation of the objects in the box (we've used Three.js before I noticed you already had a visualisation). We want to upgrade this to use simplified GLTF models of the items. At the moment the only thing I can think of is comparing the original dimensions to the final dimensions to determine it.
The text was updated successfully, but these errors were encountered: