Data Groups

TonCut for Automation uses 3 data groups:

  • Configuration – contains configuration, i.e. optimization profiles.
  • Input – contains input data, i.e. pieces, stock, veneers, material groups and devices.
  • Output – contains output data, i.e. piece locations, piece transformations and cuts.

Each of the data groups is described in JSON format.


Common

All the data groups must contain two properties that are used to decode the data.

That is version and defaultUnits.


version

The version property specifies the version of the format the data group is encoded in.

The version may be different for different data groups, as we are increasing it always when the format changes.

defaultUnits

The defaultUnits property specifies the default units for various measurements in the data group.

It contains several sub-properties:

    timedefault unit for time measurements.
    percentdefault unit for percentage measurements.
    lengthdefault unit for length measurements.
    fielddefault unit for field measurements.
    angledefault unit for angle measurements.
{
  "version": 2,
  "defaultUnits": {
    "time": "{s|m|h|d}",
    "percent": "{%}",
    "length": "{mm|cm|in}",
    "field": "{sqmm|sqcm|sqm|sqin|sqft}",
    "angle": "{rad|deg}"
  },
  // ...
}

Configuration

Config data group contains just a list of profiles to be used.

Attributes
  • version
    int mandatory

    Version number of the data group.

    For the moment it should be set to 2.

  • defaultUnits
    object

    Default units specification as described in defaultUnits section.

  • profiles
    list(Profile)

    List of profile objects.
    If no profiles are provided, the program will use the default ones.

Configuration data group

{
  "version": 2,
  "defaultUnits": {
    "time": "s",
    "percent": "%",
    "length": "mm",
    "field": "sqmm",
    "angle": "rad"
  },
  "profiles": [
    {
      "name": "fromSmall",
      "active": true,
      "algorithms": {
        "grouping": true,
        "deduction": true,
        "lastStockItem": true,
        "firstHit": true,
        "fast": false,
        "balance": false,
        "forking": {
          "enabled": false,
          "level": 1
        },
        "adaptive": {
          "enabled": true,
          "level": 5
        },
        "ai": {
          "enabled": false,
          "level": 0
        }
      },
      "limits": {
        "maxCombinations": {
          "enabled": false,
          "limit": 5000000
        },
        "maxTimeSingle": {
          "enabled": false,
          "limit": "5s"
        },
        "maxTime": {
          "enabled": false,
          "limit": "0s"
        },
        "goodEnoughWaste": {
          "enabled": false,
          "limit": "0.00%"
        }
      },
      // ...
    }
  ]
}

Input

Input data group contains input data.

Attributes
  • version
    int mandatory

    Version number of the data group.

    For the moment it should be set to 1.

  • defaultUnits
    object

    Default units specification as described in defaultUnits section.

  • devices
    list(Device) mandatory

    List of device objects.

  • materials
    list(Material) mandatory

    List of material objects.

  • veneers
    list(Veneer)

    List of veneer objects.

  • pieces
    list(Piece) mandatory

    List of piece objects.

  • stock
    list(StockItem) mandatory

    List of StockItem objects.

Input data group

{
  "version": 2,
  "defaultUnits": {
    "time": "s",
    "percent": "%",
    "length": "mm",
    "field": "sqmm",
    "angle": "deg"
  },
  "devices": [
    {
      "title": "Device 1D",
      "materialKind": "1d",
      "slants": {
        "supported": true,
        "leftMeasurement": "fromMiddleToRight",
        "rightMeasurement": "fromMiddleToLeft"
      },
      "minCutWidth": 0,
      "edgingCuts": "optimal",
      "maxCutLengthByLength": {
        "enabled": false,
        "limit": 10000
      },
      "id": 1
    }
  ],
  "pieces": [
    {
      "materialId": 3,
      "identifier": "",
      "length": 500,
      "shapeType": "linear",
      "quantity": 15,
      "priority": "normal",
      "description": "",
      "surplus": 0,
      "margin": 0,
      "shape": {
        "leftAngle": 45,
        "rightAngle": 25
      },
      "id": 1
    }
  ],
  "materials": [
    {
      "deviceId": 1,
      "title": "Material 1D",
      "kind": "1d",
      "width": 100,
      "thickness": 100,
      "canRotate": true,
      "canMirror": true,
      "surplus": 0,
      "surplusEditable": true,
      "margin": 0,
      "marginEditable": true,
      "defaultEdging": 0,
      "kerf": 0,
      "allowEdgeCuts": true,
      "reuseWaste": {
        "minLongerLength": 200,
        "edging": {
          "enabled": false,
          "default": 0
        }
      },
      "canBeVeneered": true,
      "id": 3
    }
  ],
  "stock": [
    {
      "materialId": 3,
      "identifier": "",
      "description": "",
      "priority": "normal",
      "length": 6000,
      "quantity": 10,
      "edging": {
        "left": 0,
        "right": 0
      },
      "id": 2
    }
  ],
  "veneers": []
}

Output

Output data group contains optimization results.

Attributes
  • version
    int

    Version number of the data group.

    Version 1 had no support for quantity in Cutting object. Latest version is 2.

  • defaultUnits
    object

    Default units specification as described in defaultUnits section.

  • statistics
    object

    Global statistics of the entire optimization.

    Show Child Attributes

  • cuttings
    list(Cutting)

    List of cutting objects.

Output data group

{
  "version": 2,
  "defaultUnits": {
      "length": "mm",
      "field": "sqmm",
      "angle": "rad"
  },
  "statistics": {
      "2d": {
        "field": 0,
        "usedField": 0,
        "wasteField": 0,
        "unusedField": 0,
        "cutCount": 0,
        "cutsLength": 0
      },
      "1d": {
        "length": 48000,
        "usedLength": 42582,
        "wasteLength": 5418,
        "unusedLength": 0,
        "cutCount": 114,
        "cutsLength": 12316.7744553597
      }
  },
  "cuttings": [
      {
        "stockItemId": 2,
        "quantity": 1,
        "statistics": {
            "1d": {
              "length": 6000,
              "usedLength": 5939.4,
              "wasteLength": 60.6,
              "unusedLength": 0,
              "cutCount": 8,
              "cutsLength": 817.64466576987
            }
        },
        "pieces": [
            {
              "pieceId": 3,
              "x": 0,
              "y": 0,
              "rotated": false,
              "mirrored": false
            },
            {
              "pieceId": 3,
              "x": 820,
              "y": 0,
              "rotated": true,
              "mirrored": false
            },
            {
              "pieceId": 3,
              "x": 1613.2,
              "y": 0,
              "rotated": false,
              "mirrored": false
            }
        ],
        "rest": [
            {
              "x": 0,
              "y": 0,
              "length": 0,
              "width": 100,
              "shapeType" :"linear",
              "shape": {
                  "leftAngle": "0.00rad",
                  "rightAngle": "0.00rad"
              },
              "identifier": "",
              "usable": false
            },
            {
              "x": 5952.8,
              "y": 0,
              "length": 74,
              "width": 100,
              "shapeType": "linear",
              "shape": {
                  "leftAngle": "0.26rad",
                  "rightAngle": "0.00rad"
              },
              "identifier": "",
              "usable": false
            }
        ],
        // ...
      }
  ]
}