Skip to content

Strange "starting_point" behavior in NfpPlacer #52

@Daniil-SV

Description

@Daniil-SV

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions