Documentation
Last update: June 16, 2024circlePackMetrics
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
OptionalincludeBins |
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.
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.
- Header information - These details reason across all the bins that have been packed.
- Bin information - These details are about a particular bin that has been packed.
- 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.
FittedItems
Contains information about each item that has been packed in the bin.
{
"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
}