/IP-bin-packing

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

IP-bin-packing

bin packing for irregular polygons in irregular comtainers using 0-1 integer programming

result using Abeysooriya et al., 2018

1. input

simple polygon via double array (example).
polygon with holes via 3dm file (example), in princeple boundary curves from any CAD drawing, but different libraries are required.

2. output

the result would be a list of Layout instances
obtain the placement index for each layout via

int[][] ps = layout.result;

it is a 2d array, the first dimension indicates how many polygons are in the layout, the second are the detailed information. for example assume we have the first polygon as

int[] p = ps[0];

we can access this polygon via

DiscreteGeometry geo = layout.templates[p[0]].discreteShape[p[1]];

and access its position (translation) within the container via

Vec translation = layout.domain.getTranslationInDomain(geo, p[2], p[3]);

Then the final geometry would be the original geometry

geo.g

plus the obtained translation.

3. results

on random geometries 1 result using Abeysooriya et al., 2018

on random geometries 2 result using Abeysooriya et al., 2018

on dataset swim (Oliveira et al., 2000) result using Abeysooriya et al., 2018

on polygon with holes