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.2-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

python_libnest2d-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (988.1 kB view details)

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

python_libnest2d-0.1.2-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

python_libnest2d-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (988.2 kB view details)

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

python_libnest2d-0.1.2-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

python_libnest2d-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (988.8 kB view details)

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

python_libnest2d-0.1.2-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

python_libnest2d-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (987.8 kB view details)

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

python_libnest2d-0.1.2-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9Windows x86-64

python_libnest2d-0.1.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (988.2 kB 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.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 871f5db036e9965dba7f191bd243f5ad558f4c40abfcd18bd199de5f412e8172
MD5 6fb150c3056b05fefff2fbf1a759fb2c
BLAKE2b-256 30d47f62de9e0900c39c887725273213e42371b302349bdf229ac37f3f111f4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f8981d1a5c6b60a45ac6999f5b287a01dcd277460fa42679601e156146010d6
MD5 a84819cef3e6c11dbf902274057cb8ca
BLAKE2b-256 21c39e4d30414a48e19591e7ee1e1964db3b9bd2b80d0eba98e0e999275b38da

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a9bee13ab8439598025f56645f860e9e59c4ff9e624c4b5f5dd4a2198dfe2f42
MD5 82fb3067693b5d53f8105f6b5d4761a2
BLAKE2b-256 a7d005a31304449795ff517b5c763722bde0fb4fd06fd5c7818fd67dc71e2d16

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a5225fa9192d9cc180623a7fbe763e301133519c33cdb8d1586fc34c38a9d91
MD5 af38a21942a20ce0bf8a477383fd8f5e
BLAKE2b-256 a574f737e1eb0b95dbd51fa1b7909ec017900aa752aa115a7aa9fb6920f06f19

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 22e7944c9c4e8be62b86f58180132235e0e3b65ade297cc53bf363819bff7e6a
MD5 a2fc96a1537a0591afff2c42e28827cd
BLAKE2b-256 b140ffc2c50227eedf6264a0ec9f74dede0e283b2685274721b6f1277194c65b

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0c03edce9ec92497c5fd1549d52cfdff74019a63b224ac9da4918430cfc39a59
MD5 17f36c67f3e53644abec041cd4b4366f
BLAKE2b-256 ecbf1af4124ddf086c3b716492aae23385617a7b9f00e6d43f4e574b69c3a54e

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a7e68763eda4711b89ad9abd05b5454c7785751866d3951df689594c9ee45bfe
MD5 dc569a44d0411af3026255dd630011df
BLAKE2b-256 290a3405a48ce7f3dd052e953793c6db794ff8d503ad2b29f78e3e0a0edcf6b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8df6ebef658867cdd46b925190f4a74900de364825cc66738b6015c2037fe461
MD5 bb9a80e2487d1b0bba928d0f5754b00b
BLAKE2b-256 48b9d226497b426cea3739411fdff16981f9f44494b133e5bfdacd3cd3e7f4e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e596456f793d10e9f75eb1af8a2a17e1b0644f85edab9e294d99b55c3fb83a59
MD5 1883f40fd8b6531d59157187f21573ed
BLAKE2b-256 86ffb9fbe4f6c94cf555e00bb98503ea418b9683fad6e51d3be90946dba6dce3

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 03cd6a1f1d49dbf5956cddc408f3a55a973523d6a9993f9393d15cb7a7b5e990
MD5 6694db50bebd99e915bfeb06807811e3
BLAKE2b-256 7587e99ffcc15e69f973fb517930ae58dfaae4d3ae672179ac1ecf18ee1d29c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for python_libnest2d-0.1.2-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