Skip to content
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

Added cutting layout style strictMax support and improved strategy for maximum widths #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BenJamesBen
Copy link

@BenJamesBen BenJamesBen commented May 20, 2023

This PR contains code changes discussed in freesewing/freesewing#3909 to improve the packing strategy for fabric cutting layout applications.

  • Use a different strategy when there is a maximum width: fill the bin to the maximum width before increasing the height.
  • Retain the original strategy when there isn't a maximum width: fill the bin in a way that forms a roughly square shape.

It also implements strictMax in a way that:

  • Still packs items wider than the maximum width. It does this by placing the item at the left edge of the bin.
  • Does not increase the width of the bin even if a wider-than-maximum item has been packed. (Narrower-than-maximum items are still packed inside the maximum width.)

(The previous developers seemed to intend that strictMax functionality, when implemented, would reject items wider than the maximum width. I've left these intentions intact in the comments and the test stub, even though their intentions may be no longer relevant to this fork of the project.)

I bumped the version number to 1.0.2 in package.json. I am not sure if that was appropriate or if the version should be changed to 1.1.0.

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

Successfully merging this pull request may close these issues.

1 participant