Documentation

Last update: June 16, 2024

circlePackMetrics

Pack circular items in a two dimensional bin.

This endpoint is specialized in packing circular-shaped items inside either a circular, or rectangular bin. This endpoint works with two-dimensional data. The circlePackMetrics endpoint requires bin size and item information as input and provides detailed information about how many bins are needed to pack all the items. It provides detailed information per item in each bin, such as the coordinates of the item.


Connectivity

URL https://www.packing-optimizer.com/api/circlePack/metrics
Method POST

Headers

Authorization Basic-Auth
API credentials as found on your Account Settings page.
Content-Type application/json

Query string options

Optional
includeBins If false, the individual bins will not be included in the response and only header information will be transmitted.
Default: true
Options: true or false
Example: api/circlePack/metrics?includeBins=false
includeItems If false, the individual item information per bin will not be included in the response.
Default: true
Options: true or false
Example: api/circlePack/metrics?includeItems=false
responsePrecision Sets the decimal precision of the response body.
Default: 3
Example: api/circlePack/metrics?responsePrecision=5

Request body

Bin

Information about the bin that will be used for packing.

Information: A bin can either be a circle, or a rectangle. If your bin is a rectangle, the diameter should be omitted. If your bin is a circle, the width and depth should be omitted.
Field Type Description
bin.type string Type of bin that is used for packing.
Example: sheet
bin.width numeric Width of the bin.
Example: 1.2
bin.depth numeric Depth of the bin.
Example: 0.80
bin.diameter numeric The diameter of the bin.
Example: 1.5
bin.maxWeight numeric Max weight that a single bin can carry.
Example: 1500
bin.sortMethod string Optional Allows you to enforce that the heaviest items will be packed first. diameter will generally result in a faster response and a higher space utilization.
Default: diameter
Options: weight or diameter
bin.packingPattern string Optional The pattern that will be used to place items onto the bin.
Default: bottomUp
Options: spiral, bottomUp, insideOut

Items

Information about the items that have to be packed.

Field Type Description
items[].id string id to identify individual items.
Example: ITEM001
items[].diameter numeric The diameter of the item.
Example: 0.20
items[].margin numeric A margin that must be between this item and another item.
This can be used if items are not allowed to be too tightly packed.
Example: 0.05
items[].weight numeric Weight of the item.
Example: 10
items[].consolidationKey string Optional Items with the same consolidation key will be separated from the other items and grouped in their own bin. Items with different consolidation key values will never be grouped in the same bin. Items with no key will group together by default.
Default:  None
Example: customerX

{
    "bin": {
        "type": "sheet"
        "maxWeight": 1500
        "diameter": 3
        "packingPattern": "bottomUp"
    },
    "items": [
        {
            "id": "circleXL1"
            "weight": 10
            "diameter": 0.9
        },
        {
            "id": "circleXL2"
            "weight": 10
            "diameter": 0.9
        },
        {
            "id": "circleM1"
            "weight": 10
            "diameter": 0.4
            "margin": 0.1
        },
        {
            "id": "circleM2"
            "weight": 10
            "diameter": 0.4
            "margin": 0.1
        },
        {
            "id": "circleM3"
            "weight": 10
            "diameter": 0.4
            "margin": 0.1
        },
        {
            "id": "circleM4"
            "weight": 10
            "diameter": 0.4
            "margin": 0.1
        },
        {
            "id": "circleS1"
            "weight": 10
            "diameter": 0.2
        },
        {
            "id": "circleS2"
            "weight": 10
            "diameter": 0.2
        },
        {
            "id": "circleS3"
            "weight": 10
            "diameter": 0.2
        }
    ]
}


Response body

The packing response body follows a certain hierarchy, this hierarchy can be categorized in 3 sections.

  1. Header information - These details reason across all the bins that have been packed.
  2. Bin information - These details are about a particular bin that has been packed.
  3. Item information - These are details about a particular item. Items are nested inside bins.

Header

Contains header information about the complete packing request.

Field Type Description
requiredNrOfBins numeric The total number of bins it requires to pack all items.
totalSurfaceAreaUtil numeric The total surface area utilization in percentage points.
totalWeightUtil numeric The total weight utilization in percentage points.
unfittedItems[] array Array of items that did not fit. Items in this array have the same attributes as items in packedBins[].fittedItems[].

PackedBins

Contains information about each bin that has been packed.

Field Type Description
packedBins[] array Contains the bins that have been packed.
packedBins[].id numeric Incrementing counter starting from 1. Generated by Packing Optimizer.
packedBins[].type string The type of bin as provided by the caller in the request body.
packedBins[].width numeric The maximum width of the bin as provided by the caller in the request body.
packedBins[].depth numeric The maximum depth of the bin as provided by the caller in the request body.
packedBins[].diameter numeric The diameter of the bin as provided by the caller in the request body.
packedBins[].surfaceArea numeric The maximum surface area of the bin.
packedBins[].coveredSurfaceArea numeric Total surface area of the items packed in the bin.
packedBins[].surfaceAreaUtil numeric coveredSurfaceArea expressed in percentage points relative to the surfaceArea attribute.
packedBins[].maxWeight numeric The maximum weight of the bin as provided by the caller in the request body.
packedBins[].actualWeight numeric Total weight of the items packed in the bin.
packedBins[].actualWeightUtil numeric actualWeight expressed in percentage points relative to the maxWeight attribute.
packedBins[].nrOfItems numeric The total number of items packed inside the bin.

FittedItems

Contains information about each item that has been packed in the bin.

Field Type Description
packedBins[].fittedItems[] array Contains the items inside the bin.
packedBins[].fittedItems[].id string Item identifier as provided by the caller in the request body.
packedBins[].fittedItems[].diameter numeric The diameter of the item.
packedBins[].fittedItems[].weight numeric Weight of the item.
packedBins[].fittedItems[].surfaceArea numeric The surface area of the item.
packedBins[].fittedItems[].consolidationKey string Item consolidation key used during packing.
packedBins[].fittedItems[].xCoordinate numeric X coordinate of the item inside the bin.
packedBins[].fittedItems[].yCoordinate numeric Y coordinate of the item inside the bin.
packedBins[].fittedItems[].margin numeric The margin that was taken into account while placing the item.

{
    "packedBins": [
        {
            "actualWeight": 90
            "actualWeightUtil": 6
            "coveredSurfaceArea": 1.869248
            "diameter": 3
            "fittedItems": [
                {
                    "diameter": 0.9
                    "id": "circleXL2"
                    "margin": 0
                    "surfaceArea": 0.6361725
                    "weight": 10
                    "xCoordinate": 1.5
                    "yCoordinate": 0.45
                },
                {
                    "diameter": 0.9
                    "id": "circleXL1"
                    "margin": 0
                    "surfaceArea": 0.6361725
                    "weight": 10
                    "xCoordinate": 2.308915
                    "yCoordinate": 0.844534
                },
                {
                    "diameter": 0.4
                    "id": "circleM4"
                    "margin": 0.1
                    "surfaceArea": 0.1256637
                    "weight": 10
                    "xCoordinate": 1.630236
                    "yCoordinate": 1.188606
                },
                {
                    "diameter": 0.4
                    "id": "circleM3"
                    "margin": 0.1
                    "surfaceArea": 0.1256637
                    "weight": 10
                    "xCoordinate": 1.136393
                    "yCoordinate": 1.105965
                },
                {
                    "diameter": 0.4
                    "id": "circleM2"
                    "margin": 0.1
                    "surfaceArea": 0.1256637
                    "weight": 10
                    "xCoordinate": 0.8046121
                    "yCoordinate": 0.7309549
                },
                {
                    "diameter": 0.4
                    "id": "circleM1"
                    "margin": 0.1
                    "surfaceArea": 0.1256637
                    "weight": 10
                    "xCoordinate": 2.695193
                    "yCoordinate": 1.48741
                },
                {
                    "diameter": 0.2
                    "id": "circleS3"
                    "margin": 0
                    "surfaceArea": 0.03141593
                    "weight": 10
                    "xCoordinate": 1.985621
                    "yCoordinate": 0.1917906
                },
                {
                    "diameter": 0.2
                    "id": "circleS2"
                    "margin": 0
                    "surfaceArea": 0.03141593
                    "weight": 10
                    "xCoordinate": 0.9583557
                    "yCoordinate": 0.3544935
                },
                {
                    "diameter": 0.2
                    "id": "circleS1"
                    "margin": 0
                    "surfaceArea": 0.03141593
                    "weight": 10
                    "xCoordinate": 2.822384
                    "yCoordinate": 1.041636
                }
            ]
            "id": 1
            "maxWeight": 1500
            "nrOfItems": 9
            "surfaceArea": 7.068583
            "surfaceAreaUtil": 26.44444
            "type": "sheet"
        }
    ],
    "requiredNrOfBins": 1
    "totalSurfaceAreaUtil": 26.44444
    "totalWeightUtil": 6
}