V3
Version 3 of the Binacle.Net API builds upon Version 2โs Pack By Custom but only accepts an algorithm selection as a parameter.
It also introduces ViPaq, a protocol for encoding packing information efficiently.
๐ Learn more:
This API version is experimental and can change at any time.
๐ Contents
๐ฆ Pack by Custom
POST /api/v3/pack/by-custom
Performs the Packing function for all provided bins and items using the selected algorithm.
Request Example
{
"parameters": {
"algorithm": "FFD"
},
"bins": [
{ "id": "custom_bin_1", "length": 10, "width": 40, "height": 60 },
{ "id": "custom_bin_2", "length": 20, "width": 40, "height": 60 }
],
"items": [
{ "id": "box_1", "quantity": 2, "length": 2, "width": 5, "height": 10 },
{ "id": "box_2", "quantity": 1, "length": 12, "width": 15, "height": 10 },
{ "id": "box_3", "quantity": 1, "length": 12, "width": 10, "height": 15 }
]
}
Response Example
{
"result": "Success",
"data": [
{
"result": "FullyPacked",
"bin": { "id": "custom_bin_1", "length": 10, "width": 40, "height": 60 },
"packedItems": [
{ "id": "box_2", "length": 10, "width": 12, "height": 15, "x": 0, "y": 0, "z": 0 },
{ "id": "box_3", "length": 10, "width": 12, "height": 15, "x": 0, "y": 12, "z": 0 },
{ "id": "box_1", "length": 2, "width": 5, "height": 10, "x": 0, "y": 0, "z": 15 },
{ "id": "box_1", "length": 2, "width": 5, "height": 10, "x": 0, "y": 24, "z": 0 }
],
"unpackedItems": [],
"packedItemsVolumePercentage": 100,
"packedBinVolumePercentage": 15.83,
"viPaqData": "AAQACig8CgwPAAAACgwPAAwAAgUKAAAPAgUKABgA"
},
{
"result": "FullyPacked",
"bin": { "id": "custom_bin_2", "length": 20, "width": 40, "height": 60 },
"packedItems": [
{ "id": "box_2", "length": 12, "width": 15, "height": 10, "x": 0, "y": 0, "z": 0 },
{ "id": "box_3", "length": 12, "width": 10, "height": 15, "x": 0, "y": 15, "z": 0 },
{ "id": "box_1", "length": 2, "width": 5, "height": 10, "x": 12, "y": 0, "z": 0 },
{ "id": "box_1", "length": 2, "width": 5, "height": 10, "x": 0, "y": 0, "z": 10 }
],
"unpackedItems": [],
"packedItemsVolumePercentage": 100,
"packedBinVolumePercentage": 7.92,
"viPaqData": "AAQAFCg8DA8KAAAADAoPAA8AAgUKDAAAAgUKAAAK"
}
]
}
๐ฆ Packing Parameters
algorithm(string): Select the packing algorithm to use for this request.
๐ง Available Algorithms:
- โ๏ธ FFD (First Fit Decreasing): Fast and efficient heuristic.
- โ ๏ธ WFD (Worst Fit Decreasing): Spreads items, useful in niche scenarios.
- โ ๏ธ BFD (Best Fit Decreasing): More compact packing, slightly slower.