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

Strange "starting_point" behavior in NfpPlacer #52

Open
Daniil-SV opened this issue Jun 30, 2023 · 0 comments
Open

Strange "starting_point" behavior in NfpPlacer #52

Daniil-SV opened this issue Jun 30, 2023 · 0 comments

Comments

@Daniil-SV
Copy link

Hey, I'm trying to pack polygons into one or several tight square bins.
I had a problem that result contained a lot of free space in corners, an example is below.
image

I started experimenting with NfpPlacer settings and found that "starting_point" parameter contains the most suitable result but at the same time it has a very strange bug.
For some reason first few items are placed "wrong" and then a square zone starts that seems normal, example and code used below.
NestConfig<NfpPlacer> cfg;
cfg.placer_config.alignment = NfpPlacer::Config::Alignment::BOTTOM_LEFT;
cfg.placer_config.starting_point = NfpPlacer::Config::Alignment::BOTTOM_LEFT;
size_t bins = nest( items, Box(2048, 2048, { 1024 , 1024 }), 2 cfg, {} );
`
image

From very beginning of my adventure with this library, I tried BottomLeftPlacer algorithm, but it also leaves a lot of space in some cases, so I decided to try NfpPlacer and here I am

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

No branches or pull requests

1 participant