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

Uploaded CPython 3.13Windows x86-64

python_libnest2d-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (987.0 kB view details)

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

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

Uploaded CPython 3.12Windows x86-64

python_libnest2d-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (987.1 kB view details)

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

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

Uploaded CPython 3.11Windows x86-64

python_libnest2d-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (987.7 kB view details)

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

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

Uploaded CPython 3.10Windows x86-64

python_libnest2d-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (986.6 kB view details)

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

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

Uploaded CPython 3.9Windows x86-64

python_libnest2d-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (987.1 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.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cfd3d7b922e29e9a6b97b9f6a7a5934e8e06e29c44ba8b2b2121378b6e7d7a15
MD5 4d085082cc42be95ef9e2ad4bcefb455
BLAKE2b-256 6cce1250a1dee9bd98814c992ac8e6351d90945b4944d42ba22b64cabbfc3500

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 622024fdbc786a368f73f9a2642015235edd3bac6832a70a578a3aea6df78def
MD5 fa2d5ec456583a5d159cb19a2b62a95a
BLAKE2b-256 4b02fc122e31e5014f1f1d75770e348485fb290173b5253ee53c840a3d978ad2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 53e587b904fd25abab1c18a62dd19140c58902d1a4cfa37afcad33d1708232f6
MD5 53e0a5c719f499b62d421e1fc2dca8c6
BLAKE2b-256 30d0b80325fa10c7e374ed1e6bd2f845065cfb439ae3056852ee46b7781e9a7f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5f0371e99badd4d6e1547562eb22f8f1887f79e8065a32c886eb0ea7b10fa617
MD5 dc2446aee3ab0ea48d1488484a910236
BLAKE2b-256 451c5bfe654fe0b645b9e37fe9f3649da04f28d935617b1156bcd3d88c46dff7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f77b6cb285c41279222b096030851ad3aed21e3f4cad44e4e2fe3726792c7171
MD5 a8edfbd9f6a882c4fdfe5eb10e516fcb
BLAKE2b-256 91d05bbc5aed9539bc09d765fcf24bc7255977414213fabcba2b83c0aaf74a29

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bb53477819fa499f0c4ef5e45bd434d130765ca7c0ec760a4c898ae8e9346b06
MD5 1c5d7678fcf3b5adfe33c79bf16d3312
BLAKE2b-256 f073cee5e5884f312809a2e7ad2c80c4249783f78db707941deecf4232636da1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ca6e81d7d1d6209b62a851ed4988f45dfb7a90c40b90a46fa6d71928059e8a1
MD5 0b572d60375b63c43ac4eab288a709d3
BLAKE2b-256 a9d5085a6d01ab6169457203fe6e8119f2c59f48722674ff05fa7ee101e4e411

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a780afe257fb1269f097736a2166637c5dd0232f733dca337f5abcda0ca05ebf
MD5 3ae68f2c07d4b1a41843fa90c232edc4
BLAKE2b-256 2760fc4a47fb6baf9c63be27c61f626563914fd29ea41f48aa53792dd83abb65

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0bf26a23d3a2611f6e8d5b36d2eb790c5fa54eabd80b6808693b02a9b0a0d8ae
MD5 c60300af4fd32ffa0d5d9331403d9395
BLAKE2b-256 96517c1198437a051f28530022660d01f68663b6e577ea66159b94f03b3b4715

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for python_libnest2d-0.1.1-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eb3c16a3f9f03d52ca44c465b3e41eec7d485892e59438a7080118d8a51af4de
MD5 d4a7c5c0f9c3aedcd049bf8714304c30
BLAKE2b-256 306cc8acca610b2ba47ac838b23ff0c982c87c4e7cc39ed9ff6609fc21082e8c

See more details on using hashes here.

Provenance

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