Skip to content

Nesting result in a circle but not a rectangle #28

@jindili

Description

@jindili

I try to Nesting some random Items (100 rectangle of random size), and get this result:
image

But supposed to get something like this:
image

I use pynest2d.pyd from UltiMaker Cura 5.4.0.

main part of code related:

from pynest2d import *

volume = Box(2000, 2000)

config = NfpConfig()
config.accuracy = 1.0

# config.alignment = NfpConfig.Alignment.BOTTOM_LEFT
# config.alignment = NfpConfig.Alignment.BOTTOM_RIGHT
# config.alignment = NfpConfig.Alignment.CENTER
# config.alignment = NfpConfig.Alignment.DONT_ALIGN
config.alignment = NfpConfig.Alignment.TOP_LEFT
# config.alignment = NfpConfig.Alignment.TOP_RIGHT

# config.starting_point = NfpConfig.Alignment.BOTTOM_LEFT
# config.starting_point = NfpConfig.Alignment.BOTTOM_RIGHT
# config.starting_point = NfpConfig.Alignment.CENTER
# config.starting_point = NfpConfig.Alignment.DONT_ALIGN
config.starting_point = NfpConfig.Alignment.TOP_LEFT
# config.starting_point = NfpConfig.Alignment.TOP_RIGHT

spacing = 1

num_bins = nest(List_Items, volume, spacing, config)

Had tried all options of alignment, starting_point, get some strange result:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions