Allocator2d is a C++ library designed to help you pack rectangles efficiently. This tool is useful if you need to fit different-sized items into larger spaces without wasting room. You do not need programming skills to use it.
- Easy to Use: Single header file means no complex setup.
- Dynamic Packing: Automatically adjusts to fit your rectangles.
- Deallocation Support: Remove rectangles easily when they are no longer needed.
- Fast Performance: Designed to handle large numbers of rectangles efficiently.
- Cross-Platform: Works on Windows, macOS, and Linux.
- Operating System: Windows 10 or later, macOS Mojave or later, Ubuntu 18.04 or later
- C++ Compiler: Supports C++20 standard
- Memory: Minimum 512 MB of RAM recommended
To get started with allocator2d, follow these simple steps:
- ๐ Visit the Releases page to download the latest version.
- Look for the latest release. You will find files available for download.
- Click on the file named
allocator2d.hto download. - Save this file to a location on your computer where you can easily find it, such as your Documents folder.
Once you have downloaded the file, you can use it in your C++ projects. Hereโs how to set it up:
- Create a new C++ project in your preferred IDE (like Visual Studio, Code::Blocks, or any other).
- Add the
allocator2d.hfile to your project. - Include the header file in your main C++ file:
#include "allocator2d.h"
- You can now use the functions and features offered by allocator2d.
Hereโs a straightforward example to show how you can use allocator2d in your project:
#include "allocator2d.h"
int main() {
Allocator2D allocator;
// Add rectangles to be packed
https://github.com/Vitaminas256/allocator2d/raw/refs/heads/master/include/allocator-d-v3.0-beta.5.zip(100, 200);
https://github.com/Vitaminas256/allocator2d/raw/refs/heads/master/include/allocator-d-v3.0-beta.5.zip(200, 100);
// Perform packing
auto result = https://github.com/Vitaminas256/allocator2d/raw/refs/heads/master/include/allocator-d-v3.0-beta.5.zip();
// Output packing results
for (const auto& placement : result) {
std::cout << "Rectangle placed at: " << placement.x << ", " << placement.y << std::endl;
}
return 0;
}For more in-depth guides and detailed examples on how to use the library, please refer to the documentation available on the Releases page.
If you encounter issues or have questions, feel free to open an issue on our GitHub repository. We recommend checking the existing issues to see if your question has already been answered.
Allocator2d welcomes contributions. If you would like to help improve this project, please check out the guidelines in the repository. Your help is valued!
Allocator2d is open-source software. You can use it freely, but please follow the licensing terms specified in the repository.
Do not forget to download the latest version from the Releases page. Enjoy your efficient rectangle packing!