All Projects → markfink → nest2D

markfink / nest2D

Licence: LGPL-3.0 license
Nest2D is a 2D bin packaging tool for python.

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to nest2D

libnfporb
Implementation of a robust no-fit polygon generation in a C++ library using an orbiting approach
Stars: ✭ 85 (+102.38%)
Mutual labels:  bin-packing, nesting
pack
📦 lightweight rectangle packing algorithm
Stars: ✭ 31 (-26.19%)
Mutual labels:  bin-packing
arcade-pcb-case
Plans to build Arcade PCB cases
Stars: ✭ 29 (-30.95%)
Mutual labels:  laser-cutting
gallia-core
A schema-aware Scala library for data transformation
Stars: ✭ 44 (+4.76%)
Mutual labels:  nesting
bp3d
Golang package for 3d bin packing problem
Stars: ✭ 50 (+19.05%)
Mutual labels:  bin-packing
feathers-versionate
Create and work with nested services.
Stars: ✭ 29 (-30.95%)
Mutual labels:  nesting
Rectangle-Bin-Packing
👜 Haxe algorithms for 2D rectangular bin packing
Stars: ✭ 32 (-23.81%)
Mutual labels:  bin-packing
openscad-rpi-library
OpenSCAD library of various objects to use in Raspberry Pi-based projects
Stars: ✭ 30 (-28.57%)
Mutual labels:  laser-cutting
angularnestedformarrays
Angular 7 FormArrays nested within each other with FormGroups, dynamic, add, delete
Stars: ✭ 20 (-52.38%)
Mutual labels:  nesting
3dbinpacking
A python library for 3D Bin Packing
Stars: ✭ 203 (+383.33%)
Mutual labels:  bin-packing
vpsolver
Arc-flow Vector Packing Solver (VPSolver)
Stars: ✭ 86 (+104.76%)
Mutual labels:  bin-packing
Muuri
Infinite responsive, sortable, filterable and draggable layouts
Stars: ✭ 9,797 (+23226.19%)
Mutual labels:  bin-packing
bin-packing
😔 Failed to implement some kind layout in browser.
Stars: ✭ 53 (+26.19%)
Mutual labels:  bin-packing
LaserCut
LaserCut is an experimental, "Swiss Army Knife" type of program for creating 2D designs by combining primitive shapes using constructive geometry and then sending them to a laser cutter for vector cutting or vector engraving
Stars: ✭ 19 (-54.76%)
Mutual labels:  laser-cutting

Introduction

Nest2D is a 2D bin packaging tool for python.

Nest2D works with the C++ libnest2d backend for speed. For python C++ interoperability we use pybind11.

The library is written in a way that it should be usable out of the box with a very simple interface. The backend is reasonably fast and robust, being built on top of boost geometry and the polyclipping library.

Example

A simple example may be the best way to demonstrate the usage of the library.

from nest2D import Point, Box, Item, nest, SVGWriter

def add_shape1(n, items):
    for i in range(n):
        item = Item([
            Point(-5000000, 8954050),
            Point(5000000, 8954050),
            Point(5000000, -45949),
            Point(4972609, -568550),
            Point(3500000, -8954050),
            Point(-3500000, -8954050),
            Point(-4972609, -568550),
            Point(-5000000, -45949),
            Point(-5000000, 8954050)
        ])
        items.append(item)

def add_shape2(n, items):
    for i in range(n):
        item = Item([
            Point(-11750000, 13057900),
            Point(-9807860, 15000000),
            Point(4392139, 24000000),
            Point(11750000, 24000000),
            Point(11750000, -24000000),
            Point(4392139, -24000000),
            Point(-9807860, -15000000),
            Point(-11750000, -13057900),
            Point(-11750000, 13057900)
        ])
        items.append(item)

def main():
    box = Box(150000000, 150000000)
    input = []
    add_shape1(23, input)
    add_shape2(15, input)

    pgrp = nest(input, box)

    sw = SVGWriter()
    sw.write_packgroup(pgrp)
    sw.save()

It is worth to note that the type of the polygon carried by the Item objects is the type defined as a polygon by the geometry backend. In the example we use the clipper backend and clipper works with integer coordinates.

Example call

$ pip install nest2D
$ python examples/simple_sample.py

Example output

Alt text

License

Unfortunately libnest2d is provided with a contractible GPL type license so we can not release this with better license terms. Details can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].