### Nesting layout

The Nesting Center API produces nesting layouts from selected parts and material. Optimally all parts are placed in the material and minimal area of material is used. In the general case some parts may not be nested because there is not enough material. The nesting layout which is a result of nesting computations contains the list of used material sheets and list of the nested parts with their locations. Additionally, the result contains statistical information like total area used, nested mass, scrap ratio.

### Nesting result data

A nesting result is a JSON object that describes the result produced during layout computations.

Property | Description |
---|---|

JobId |
The ID of the computation job. |

Result |
The nesting result data with lists of used material and nested parts. |

ResultVersion |
The version of the result. |

### Result example

```
{
"JobId": "17576-8361a14a-51b7-4903",
"Result": {},
"ResultVersion": 1
}
```

### Nesting layout data

The nesting layout object is placed under the “Result” property. Nesting layout data contains information about used material and nested parts.

Property | Description |
---|---|

AreaPartsNested |
The total area of all nested parts. |

AreaPartsUnnested |
The total area of all unnested parts. |

LengthPartContours |
The total length of the contours (including holes) of all nested parts. |

NM |
Nested mass: The total nested mass of all nested parts divided by the total mass of all input parts. |

NRPA |
Nested raw plates area: The total area of the raw plates used in this result. |

NRPC |
Nested raw plates cost: The total cost of the raw plates used in this result. |

RawPlateNestedLast |
The index in RawPlatesNested array indicating the raw plate which was filled as the last one. |

RawPlatesNested |
The array of nested raw plates. |

Scrap |
The scrap value, with the rest plate in the last raw plate taken into account. The total area of nested parts divided by the total area of the raw plates used reduced by the rest plate area in the last raw plate. |

Scrap2 |
The scrap value, with the rest plate in the last raw plate not taken into account. The total area of nested parts divided by the total area of the raw plates used. |

SequentialData |
Additional data associated with this result. |

Time |
The timestamp of this result, in milliseconds. |

### Nesting layout example

```
{
"Result": {
"AreaPartsNested": 9685.84,
"AreaPartsUnnested": 0,
"LengthPartContours": 745.67,
"NM": 1,
"NRPA": 15000,
"NRPC": 15000,
"RawPlateNestedLast": 0,
"RawPlatesNested": [],
"Scrap": 0.031,
"Scrap2": 0.35,
"SequentialData": {},
"Time": 432
}
}
```

### Nested raw plate

A nested raw plate is a JSON object that describes a nested raw plate.

Property | Description |
---|---|

AreaRawPlateTotal |
The area of the raw plate. |

AreaRawPlateUsed |
The used area of the raw plate (the rest plate excluded). |

AreaPartsNested |
The total area of all parts nested in this raw plate. |

LengthPartContours |
The total length of the contours (including holes) of all parts nested in this raw plate. |

LengthUsed |
The length of this raw plate used by the nested parts. |

PartsNested |
The array of parts nested in this raw plate. |

RawPlateIndex |
The index of the used raw plate in the input array of raw plates. |

StripsNested |
Optional property specific to “Strips” nesting mode. The array of strips defined as boxes with the X, Y coordinates. |

Scrap |
The scrap value with the rest plate taken into account. |

Scrap2 |
The scrap value with the rest plate not taken into account. |

UsedLengthIndication |
The coordinates for the used length indication segment. |

### Nested raw plate example

```
{
"RawPlatesNested": [
{
"AreaRawPlateTotal": 15000,
"AreaRawPlateUsed": 10000,
"AreaPartsNested": 9685.84,
"LengthPartContours": 745.67,
"LengthUsed": 100.00,
"PartsNested": [],
"RawPlateIndex": 0,
"Scrap": 0.031,
"Scrap2": 0.35
}
]
}
```

### Nested part

A nested part is a JSON object that describes a single nested part.

Property | Description |
---|---|

PartIndex |
The index of the part in the input array of parts. |

Transformation |
The transformation of this nested part. The order of the base transformations is mirroring, then rotation, then translation. |

InsertionPt |
The insertion point of the part, specifies the position of the reference point of the input part in the nested raw plate. |

Mirror |
A value specifying whether the part is mirrored. Mirroring means horizontal reflection (by the Y axis). Mirroring is performed with respect to the reference point of the part. |

Rotation |
The CCW rotation of the part in radians. The original (input) rotation of the part corresponds to 0.0. The order of the base transformations is mirroring, then rotation, then translation. (Thus, rotation is always performed CCW, even if mirroring is on.) Rotation is performed with respect to the reference point of the part. |

### Nested part example

```
{
"PartsNested": [
{
"PartIndex": 0,
"Transformation": {
"InsertionPt": {
"X": 0.00,
"Y": 100.00
},
"Mirror": false,
"Rotation": 4.71
}
}
]
}
```

### Complete nesting layout

### Nesting layout example

```
{
"JobId": "17576-8361a14a-51b7-4903-9a68",
"Result": {
"AreaPartsNested": 9685.84,
"AreaPartsUnnested": 0,
"LengthPartContours": 745.67,
"NM": 1,
"NRPA": 15000,
"NRPC": 15000,
"RawPlateNestedLast": 0,
"RawPlatesNested": [
{
"AreaRawPlateTotal": 15000,
"AreaRawPlateUsed": 10000,
"AreaPartsNested": 9685.84,
"LengthPartContours": 745.67,
"LengthUsed": 100.00,
"PartsNested": [
{
"PartIndex": 0,
"Transformation": {
"InsertionPt": {
"X": 0.00,
"Y": 100.00
},
"Mirror": false,
"Rotation": 4.71
}
},
{
"PartIndex": 1,
"Transformation": {
"InsertionPt": {
"X": 0,
"Y": 0
},
"Mirror": false,
"Rotation": 0
}
}
],
"RawPlateIndex": 0,
"Scrap": 0.031,
"Scrap2": 0.35
}
],
"Scrap": 0.031,
"Scrap2": 0.35,
"SequentialData": {},
"Time": 432
},
"ResultVersion": 1
}
```