Skip to main content

Unofficial Python bindings for libnest2d — 2D bin packing / polygon nesting

Project description

python-libnest2d

Unofficial Python bindings for libnest2d — a library for 2D bin packing / polygon nesting.

Based on pynest2d by Ultimaker B.V., repackaged for easy pip install.

pip install python-libnest2d

Quick Start

from pynest2d import Point, Box, Item, nest

# Define items as polygons
square = Item([Point(0, 0), Point(100, 0), Point(100, 100), Point(0, 100)])
triangle = Item([Point(0, 0), Point(100, 0), Point(50, 100)])

# Define the bin (sheet)
bin_shape = Box(1000, 1000)

# Pack items into bins
num_bins = nest([square, triangle], bin_shape, distance=5)

# Read results
for item in [square, triangle]:
    t = item.translation()
    print(f"Bin {item.binId()}: ({t.x()}, {t.y()}) rot={item.rotation():.2f}")

API

Class Description
Point(x, y) 2D integer coordinate
Box(w, h) Rectangular bin
Item(vertices) Polygonal item to nest
NfpConfig() NFP placer configuration
nest(items, bin, distance, config) Main nesting function

Building from Source

Requires: CMake 3.20+, C++17 compiler, Python 3.8+

pip install .

License

LGPL-3.0-or-later — see LICENSE for full text.

Component License
pynest2d (bindings) LGPL-3.0 — © Ultimaker B.V.
libnest2d (engine) LGPL-3.0 — © Tamás Mészáros
Clipper BSL-1.0 — © Angus Johnson
Boost BSL-1.0
NLopt LGPL-2.1+ — © Steven G. Johnson
pybind11 BSD-3-Clause

This is NOT an official Ultimaker product. For the official version, see Ultimaker/pynest2d.

Source code: https://github.com/HamzaYslmn/python-libnest2d

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

python_libnest2d-0.1.3-cp313-cp313-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.13Windows x86-64

python_libnest2d-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_libnest2d-0.1.3-cp312-cp312-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.12Windows x86-64

python_libnest2d-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_libnest2d-0.1.3-cp311-cp311-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.11Windows x86-64

python_libnest2d-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_libnest2d-0.1.3-cp310-cp310-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.10Windows x86-64

python_libnest2d-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

python_libnest2d-0.1.3-cp39-cp39-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.9Windows x86-64

python_libnest2d-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file python_libnest2d-0.1.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b8e864651033a7497f466c56353e6d5c6e71f3b44220cfd7598cc38b535c7319
MD5 64a6e8235b47c7172742f0fc694c0b02
BLAKE2b-256 5d62c42b3d5fd8cf5174144788cd5fd5a17f0cc5f2cf60d7abb79ed659ee4708

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp313-cp313-win_amd64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ae839990bdd31f9b60c6e00f5d06eef055d03d3977cfe095cd68b1674a99531e
MD5 343c074d31c8522e050a955ca9b8f220
BLAKE2b-256 d32433ec7aa4b2ce557c71e41a66464eed31fcfaaea000e02dc3eee3a8b2a919

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0084e53383c215a5566703b953c4638aeade5ecb3250fd3ab44dab533b25f348
MD5 5627544bdb02caca1ef59145879e093b
BLAKE2b-256 bf9d4d128b6428d1cd2ef6f925270a74a669f831462d6b6ad5e8ac81a00fd384

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f7de467b5afd5451a861747b56e2e0ec4e0f2e07f453fc1802f003e0947b0e30
MD5 8cab0733480171f550998907ea48b61c
BLAKE2b-256 4f70ff657e7be57f000262e1002498e3cc4571c73d8c0f1dc30f26593500c27a

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8e6c802e757cc75a4134d8160f5c2afff2f22192f7337ca90831f825d006f906
MD5 60abf13f93b8567523729d4173b6f1d2
BLAKE2b-256 a17fb4089649e0dead34ce4473758ad922b7889d85482b1467fe057e4a5181cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp311-cp311-win_amd64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d452565ca44101e452529a35ff6ca58ac3015d3244c017eeb833f20a30d66e8c
MD5 ee7c36bd3d0dc20f6bb67272758e5f4b
BLAKE2b-256 ae05f2bdcf8ee4bd07622db0c4d495a8669db5b67ea0b48f779964a9109ad845

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 84ad58d2bde15d7ba4241897e8430b69880f222bfc3b1e34313591d124c921f8
MD5 611134743ffe04ee8595e3925cd204c5
BLAKE2b-256 b0744aa63d421e6a745fe4a051e175f7477398b5ed3c9fa82818a1fe9381a63a

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp310-cp310-win_amd64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7e25d406302d0080e93dcda6f5937a714944bed2062f2f63b7d1ba029f0da621
MD5 94f9218caa7e9da76b0fa2ba24c9b50e
BLAKE2b-256 926b616287af0afc6074c6ed4d40d71d6cac44c1e9ea697360cc72db9622adc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 49776fa7daba5821cd2b3b6fc059e5128c897876c256a55e38c7dca5f38baf6f
MD5 315ba3af7194fc220038447111d713f4
BLAKE2b-256 9b42db3a4eed73db19d3435fc01c6c6af3b7d8872df487b37d630b613e29bc87

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp39-cp39-win_amd64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file python_libnest2d-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d4b2ddfb41cb8033c3515202ea74e73733aced6a07825e026cbf426808116510
MD5 a2091cae3f05356ce9a7bb0e1b2f0512
BLAKE2b-256 561e08008e6d111a0cbf5ece06baa1ff9c6265e57d4d8f7212b5c5ccb0a94e12

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on HamzaYslmn/python-libnest2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page