-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implement maxrects packer #10
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Frizi
reviewed
Jun 28, 2019
torkleyy
reviewed
Jun 28, 2019
bors r+ |
bors bot
added a commit
that referenced
this pull request
Jul 13, 2019
10: Implement maxrects packer r=happenslol a=happenslol This implements the MAXRECTS algorithm (using the best short side fit heuristic), as detailed in the paper [A thousand ways to pack the bin](https://github.com/juj/RectangleBinPack) by Jukka Jylänki. Since this code was ported pretty much directly from the CPP version, there's probably still improvements that can be made here and there, both in readability and safety. To facilitate more complicated algorithms, the interface has been changed to allow returning multiple sprite sheets instead of just one, and adding options for a packer. The simple packer will behave exactly the same, and will output an arbitrarily big spritesheet as the first element. What's still missing: - [x] Some tests to make sure this always behaves as we want it to - [x] A good CLI interface to use maxrects - [x] More documentation - [x] Bump version Co-authored-by: Hilmar Wiegand <me@hwgnd.de>
Build succeeded |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements the MAXRECTS algorithm (using the best short side fit heuristic), as detailed in the paper A thousand ways to pack the bin by Jukka Jylänki. Since this code was ported pretty much directly from the CPP version, there's probably still improvements that can be made here and there, both in readability and safety.
To facilitate more complicated algorithms, the interface has been changed to allow returning multiple sprite sheets instead of just one, and adding options for a packer. The simple packer will behave exactly the same, and will output an arbitrarily big spritesheet as the first element.
What's still missing: