Using the nesting result service

Step 1: Upload the PWS job and result files

In order to upload files to our service you must use the attachment endpoint (POST /attachments). Create an attachment by providing the filename of the file you wish to upload. With the url and fields returned in response to the previous request, you do a further POST request to upload the file from a local path.

Do this for both the PWS job json file and the PWS result json file, you will use their attachment IDs to create the nesting result.

Step 2: Create shapes

If you have generated shapes using the service in the last hour then you can skip this step and go straight to step 3.

If not, for each shape associated with a part or imported sheet you will need to upload the .cpf file using the attachment endpoint (POST /attachments). For each attachment, you must create a shape (POST /shapes) simply by providing the attachment ID and the unit system.

Then check that the status of each shape is 'Ok' before proceeding to the next step.

Step 3: Create the nesting result

For the nesting request body, you will now provide the attachment IDs for the PWS job and result json files that you created earlier.

For the parts you will provide a mapping between the ID of the part in the PWS job and the shape ID associated with that part. You may also provide a name for each part which will be used to label it in the nesting result if that option is selected.

If you are using imported sheets, you must provide a mapping between the ID of the sheet in PWS job and the shape ID.

If you are using rectangle sheets, you must provide a mapping between the ID of the sheet in PWS job and the height and length information.

Options

The unit system uses 'metric' by default. The alternative option is 'imperial'.

The option use_origin_layer_names is 'False' by default. If set to 'True', the layer information in the part shapes will be kept in the nesting result.

The option add_part_names is 'False' by default. If set to 'True', the part name provided in the body of the create nesting request will be added as a label to that part in the nesting layout.

The option draw_offcut is 'False' by default. If set to 'True', the offcut of a layout will be drawn as a part in the layout. This part could be used as an imported sheet in a future nesting.

The option remove_sheet_layer is 'False' by default. If set to 'True', then the sheet layer will not be exported in the layout .dxf files.

When you have created the nesting using POST /nestings, use the returned ID to fetch the nesting and the associated layout files using GET /nestings/{nesting_id}.

The status of the nesting will be updated to 'Ok' when all layout files have been processed and are available for you to download. Once processed, the layouts listed will contain all the statistical information related to each layout along with the links to donwload the files. The statistics of the nesting result are updated after the layouts have all been processed and represent the overall statistics for the whole nesting result.

A note on statistics

The offcut of a layout is always computed based on a vertical front.

The efficiency of a layout is calculated using the total nested surface and the total useful surface of the sheet. If the layout has an offcut, the total useful surface of the sheet is considered to be the surface of the sheet - the surface of the offcut. The efficiency of an entire nesting result is calculated from the sum of total nested surface and the sum of total useful sheet surface of all layouts.

The number of contours is considered to be the number of stop/starts required for a given part. In the layout object we distinguish two types of contours, internal being any contours for holes within a part and external being the outline of the part. The total number of contours for a given layout can therefore be calculated by summing the nb_ext_contours and nb_int_contours.