Prerequisites

Acquire credentials for HTTP Basic access authentication. Please contact us for any inquiry.

How to use the service

The service works in two simple steps:

  1. Send the nesting order to the service. The data is sent using the JSON format at https://api.nesting.almacam.com/new and an order ID is returned.
  2. Once finished, fetch the result at https://api.nesting.almacam.com/result/{order_id}/full
  3. Done!

Transactions

Hello World

In the following example, we will nest a single 1x1 square in a single 5x10 sheet within 5.0 seconds.

Creating a nesting order

The following request creates the nesting order.

POST https://api.nesting.almacam.com/new
Authorization: Basic username:password
Content-Type: application/json

{
    "parts":
    [
        {
            "geometry": [[[0, 0], [1, 0], [1, 1], [0, 1]]],
            "instances":
            [
                {
                    "id": 42
                }
            ]
        }
    ],

    "sheets":
    [
        {
            "height": 5.0,
            "length": 10.0,
            "id": 123
        }
    ],

    "time": 5.0
}

The service returns back the following informations, in particular the order ID.

{
    "message": "Nesting order submitted",
    "nesting_order_id": 12345
}

See the post page for more details on how to create a nesting order.

Fetching a result

The result is fetched at https://api.nesting.almacam.com/result/12345/full, using the previous ID. A possible result for this example could be:

GET https://api.nesting.almacam.com/result/{order_id}/full
Authorization: Basic username:password

{
    "message": "successfully completed",
    "nestings": [
        {
            "length": 1.0,
            "sheet": 123,
            "nested_parts": [
                {
                    "id": 42,
                    "position": [0.0, 0.0],
                    "angle": 0.0,
                    "flip": false
                }
            ],
            "quantity": 1
        }
    ]
}

This result can be read as follow: The sheet 123 contains the part 42 nested at the position (0, 0), without rotation nor flip. The nesting length is 1 meaning that the offcut length is 9. Illustration:

Hello World

See the get page for more details on how to get a nesting result.

Advanced Example

  • 55 parts to nest
    • 10 parts with a complex shape
      • 5 which can be freely oriented (id = 1)
      • 5 others which must be flipped and then can be freely oriented (id = 2)
    • 45 triangles, which can all be nested in 4 different ways (id = 3):
      • in its current description (angle 0)
      • with a 180 degree rotation
      • flipped
      • with a 180 degree rotation and then flipped
  • 8 sheets
    • 5 6x7 sheets (id = 1)
    • 1 5x6 sheet with a border gap of 0.1 (id = 2)
    • 2 other 5x6 sheet with a border gap of 0.2 (id = 3)
  • 60 seconds of optimization
POST https://api.nesting.almacam.com/new
Authorization: Basic username:password
Content-Type: application/json

{
    "parts":
    [
        {
            "geometry": [[[0, 0], [1, -3], [5, 0.5], [1, 1], [0, 1]]],
            "instances":
            [
                {
                    "orientations": [{"min_angle": 0, "max_angle": 359.9}],
                    "quantity": 5,
                    "id": 1
                },
                {
                    "orientations": [{"min_angle": 0, "max_angle": 359.9, "flip": true}],
                    "quantity": 5,
                    "id": 2
                }
            ]
        },
        {
            "geometry": [[[0, 0], [4, 4], [0, 4]]],
            "protection_offset": 0.1,
            "instances":
            [
                {
                    "orientations": [{"angle": 0}, {"angle": 180}, {"angle": 0, "flip": true}, {"angle": 180, "flip": true}],
                    "quantity": 45,
                    "id": 3
                }
            ]
        }
    ],

    "sheets":
    [
        {
            "height": 6.0,
            "length": 7.0,
            "id": 1,
            "quantity": 5
        },
        {
            "height": 5.0,
            "length": 6.0,
            "border_gap": 0.1,
            "id": 2,
            "quantity": 1
        },
        {
            "height": 5.0,
            "length": 6.0,
            "border_gap": 0.2,
            "id": 3,
            "quantity": 2
        }
    ],

    "time": 60.0
}