10000 About Solution.x_max and y_max in Irregular problem type · Issue #198 · fontanf/packingsolver · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

About Solution.x_max and y_max in Irregular problem type #198

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

Open
bbeaulant opened this issue May 3, 2025 · 7 comments
Open

About Solution.x_max and y_max in Irregular problem type #198

bbeaulant opened this issue May 3, 2025 · 7 comments
Labels
enhancement New feature or request

Comments

@bbeaulant
Copy link
Contributor

Hello,

In irregular problem type, the solution propose 2 computed values : x_max and y_max. These values represents the max x and y of the last bin.

But these values ​​are only usable if the placement direction chosen by the algorithm is from Left to Right and from Bottom to Top. Otherwise, these maximums are set to bin max.

Several questions:

  • Can't these values ​​be adapted to the direction? x_min and y_min ?
  • Wouldn't it be interesting to have control over the possible directions?
@fontanf
Copy link
Owner
fontanf commented May 3, 2025

Hi,

Can't these values ​​be adapted to the direction? x_min and y_min ?

It's easy to add x_min and y_min values inside the Solution class. The question is "is it useful?". Considering how the bin-packing-with-leftovers objective is currently defined, solutions almost always have x_min = 0 and y_min = 0.

Wouldn't it be interesting to have control over the possible directions?

I don't know. Are enough people interested in this to make it worth adding and maintaining such an option?

@bbeaulant
Copy link
Contributor Author

The question is "is it useful?"

Yes, it could be. If min represents the min coord of items in bin space as max does.
These values can be used to display the last bin items bounding box or compute its compactness. And with only maximums it can only be done if direction is LeftToRightAndBottomToTop.

Are enough people interested in this to make it worth adding and maintaining such an option?

Yes. Most of concurrent tools always align result in the same corner or offer the ability to configure it.
This could be useful for the operator on a CNC if the cut parts are always in the same corner. Even if this may degrade the surface optimization a little.

@fontanf fontanf added the enhancement New feature or request label May 5, 2025
@fontanf
Copy link
Owner
fontanf commented May 7, 2025

One possibility is to add a parameter to the Instance that indicates how the leftover is computed with the BinPackingWithLeftover objective: right/top/left/bottom rectangle, top-right/top-left/bottom-right/bottom-left L-shape (current is top-right L-shape)

@bbeaulant
Copy link
Contributor Author

That seems like an interesting idea.
So it would only change the alignment "direction" for the last bin?
Is this a complex idea to implement?

@bbeaulant
Copy link
Contributor Author

Here is one example where x_min of forcing direction could be useful 😉

Image

@fontanf
Copy link
Owner
fontanf commented May 9, 2025

I added the x_min and x_max methods in 6d83c0e

@bbeaulant
Copy link
Contributor Author

Nic, I will check that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants
0