Data Groups
TonCut Engine 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.
Input and configuration validation
TonCut Engine validates known input and configuration properties when loading JSON, before optimization starts. A property that is present must have the documented JSON type and an accepted value. Invalid types, enum values, set members, units, or values outside the supported range cause a load error; they are not treated as omitted properties or silently replaced by defaults. Optional properties that are omitted keep their documented default or inherited behavior.
Related settings and geometry are checked together during loading. For
example, a negative device minCutSize is invalid, and enabling material
allowEdgeCuts while the associated device has a positive minCutSize or
minCutDistance is invalid. Positive trim edging must meet minCutSize.
Loading also checks that inherited
minEdgeDistance settings and edging are compatible with the usable stock
geometry. Correct the reported input or configuration and load it again
before starting optimization.
Identifiers and references are checked at load time too. The id of every
device, material, StockItem and piece must be greater than zero and unique
within its own list. A material must reference an existing device through
deviceId, and a StockItem or piece must reference an existing material
through materialId. A missing, unknown or duplicate identifier is a load
error: the object is never skipped silently, because that would also drop
everything that depends on it.
Numbers must be finite: NaN and infinite values are rejected, and so is a
negative length. Time limits must be non-negative and fit the supported
range. Configuration profiles are validated as well, see
Profile.
Pieces below minCutSize are accepted when loading JSON. Before optimization,
methods that enforce an individual-piece minimum exclude pieces whose effective
cutting length or width is below the device limit. For one-dimensional cutting,
only length is checked.
Excluded pieces remain in the input as unplaced demand. A dimension equal to
the limit is allowed. Effective dimensions include the configured additions
and edging adjustments. A method that supports smaller constituent pieces through
series or sets keeps those pieces eligible for optimization. This exception
concerns individual pieces only; minimum-size rules for edging, waste,
reusable waste, and remnants still apply.
For cutting with splices, loading checks the effective splice length for every piece and stock-item pairing whose structures permit them to be used together. An invalid pairing rejects the load and identifies the stock item and piece, even if another stock item or orientation could work. This check applies whether stock items or pieces are loaded first.
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.
All three data groups (configuration, input and output) are currently at version 4.
defaultUnits
The defaultUnits property specifies the default units for various measurements in the data group.
It contains several sub-properties:
Configuration
Config data group contains just a list of profiles to be used.
| Attributes |
|---|
versionint mandatoryVersion number of the data group.
Set it to
4, which is also the version the engine writes. Versions3and4share the same property layout and are loaded identically. Version2, which has flatlimits(maxCombinations,maxTimeSingle,maxTimeandgoodEnoughWastedirectly inlimits), is still read. A missingversionis read as version1. Newer configuration properties are additive, and loading rejects invalid values, see Common.defaultUnitsobjectDefault units specification as described in defaultUnits section.
profileslist(Profile)List of profile objects.
If no profiles are provided, the program will use the default ones.
Configuration data group
Input
Input data group contains input data.
| Attributes |
|---|
versionint mandatoryVersion number of the data group.
Set it to
4. The engine currently does not validate or branch on it.defaultUnitsobjectDefault units specification as described in defaultUnits section.
deviceslist(Device) mandatoryList of device objects.
materialslist(Material) mandatoryList of material objects.
veneerslist(Veneer)List of veneer objects.
pieceslist(Piece) mandatoryList of piece objects.
stocklist(StockItem) mandatoryList of StockItem objects.
Input data group
Output
Output data group contains optimization results.
| Attributes |
|---|
versionintVersion number of the data group.
Latest version is
4. Version1had no support forquantityin Cutting object. Version3replaced the piece'srotatedboolean with therotationangle, addedpieceId,shapeandbboxto piece entries,type(lineorcurve) with curve end points to cuts, andstackSizeto cuttings. Version4addedapplicationVersion,optimizationDateandoptimizationTimeMs; cuttingincomeandscore, withgain=income-cost; 2D statisticstechnologicalWasteField,edgingWasteFieldandkerfWasteField; cutshiftDistance; holes and reusable-waste defects on waste and rest entries; and cutting-levelcustomData(device, material, stock) and piececustomData. Several of the fields listed for version4were already emitted by later engines that still reported version3, so clients should detect fields by their presence rather than branch onversion.applicationVersionstringProduct version of the TonCut Engine executable that produced the result, in the
major.minor.release.buildform, for example"2.1.314.3286". Always present.optimizationDatedateThe moment the optimization finished, as an ISO 8601 date-time in UTC with a trailing
Z, for example"2026-10-06T14:42:38.452Z". It is set also when the optimization ended by a stop or a limit.nullwhen no optimization ran for the job.optimizationTimeMsintWall-clock duration of the optimization, always in milliseconds and not affected by
defaultUnits.time, from the optimization start until the best result was selected. Loading the input and writing the output are not included.nullwhen no optimization ran for the job.defaultUnitsobjectDefault units specification as described in defaultUnits section.
statisticsobjectGlobal statistics of the entire optimization.
Show Child Attributes
cuttingslist(Cutting)List of cutting objects.