Data Objects
Learn about usage of Data Object in Toncut, using examples and clearly readable tables.
Profile
Profile refers to an optimization profile.
It describes the configuration for algorithms to be used and optimization limits, such as maximum time, maximum number of combination, etc.
An optimization profile allows users to specify the parameters and constraints for an optimization process, ensuring that the algorithms used are tailored to their specific needs and requirements.
The user can define up to 20 profiles, allowing them to test different optimization strategies to achieve the best results.
Attributes |
---|
name
string mandatoryThe name of the optimization profile.
active
bool mandatorySet it to
true
, to activate the profile. It will be used only if it is active.algorithms
object mandatoryConfiguration of algorithms to be used by the profile.
Show Child Attributes
Each algorithm is ignored if
ai
algorithm is enabled.limits
objectHere we can define the conditions for early termination of global and/or single optimization.
Show Child Attributes
stockOrder
objectHere we can specify the stock sequence strategy. This is of great importance and can significantly affect the quality of the results.
These settings apply to all algorithms except
ai
.Show Child Attributes
advanced
objectHere we can change some advanced settings.
Before you change anything here, make sure you understand what you are doing, as these settings may significantly change the quality of results and also time of the optimization process.
Show Child Attributes
The profile object config
Device
Device object represents a cutting device.
It specifies the features and limitations of the device.
Attributes |
---|
id
int mandatoryUnique device id.
title
string mandatoryDevice title.
materialKind
mandatoryMaterialKind
enum Material kind device's made for
Allowed values
1d
1D materials like profiles, pipes, rods, beams, etc.
2d
2D materials like glass, panels, fabric, aluminum, cardboard, etc.
Specifies the material kind this device is made for.
slants
object 1D onlySpecifies support for miter cuts in 1D materials.
Show Child Attributes
canCrossCuts
bool 2D onlydef: falseSet it to
true
if the device allows the cuts to cross each other.fullCutsOnly
bool 2D onlydef: trueSet it to
true
if only full cuts (from edge to edge) are allowed.stripCutting
2D onlydef: noneStripCutting
enum Strip cutting direction
Allowed values
none
No strip cutting.
byLength
Horizontal strips.
byWidth
Vertical strips.
Set it to
byLength
orbyWidth
if the device cuts in strips (e.g. for panel saw).It makes sense only if
fullCutsOnly
option is set totrue
.
It may be used together withmaxCutDepth
option.minCutWidth
lengthdef: 0The minimum distance between two cuts.
Setting this value makes sense when cutting glass – you don't want to have two parallel cuts too close to each other, because then breaking off can be significantly more difficult.Please note that this is not a kerf that can be set in the material group settings.
edgingCuts
2D onlydef: optimalEdgingCuts
enum Specifies the edging method
Allowed values
optimal
An optimal edging method ensures precise and accurate cutting of edges, resulting in clean, smooth, and well-defined boundaries while minimizing any unintended removal or distortion of the desired elements.
horizontalFirst
A "HorizontalFirst" edging method involves cutting off the horizontal edges first, followed by the vertical edges.
verticalFirst
A "VerticalFirst" edging method refers to a technique where the vertical edges are cut off before the horizontal edges.
Edging method.
originEdgingCuts
2D onlydef: defaultOriginEdgingCuts
enum Edging method for the top and left edges.
Allowed values
default
Nothing changes and edges will be cut off as described in
edgingCuts
property description.twoFullCuts
Top and left edges will be cut off as full cuts (from edge to edge)
Edging method for the top and left edges.
firstCutDirection
Specifies whether the first cut will be done horizontally or vertically. Note that it is overwritten if strip cutting is turned on.
It's important to note that setting the correct
firstCutDirection
can be crucial when used in conjunction with themaxCutDepth
option.maxCutDepth
object 2D onlySpecifies maximum cut depth level the device is supporting.
The picture below shows what is the cut depth level:It makes sense only if
fullCutsOnly
is set totrue
.Show Child Attributes
maxCutLengthByLength
objectMaximum horizontal cut length.
It can also be used when cutting in strips - then it allows to limit the width of the strip.This option is especially useful when the device is a guillotine.
Show Child Attributes
maxCutLengthByWidth
object 2D onlyMaximum vertical cut length.
It can also be used when cutting in strips - then it allows to limit the width of the strip.This option is especially useful when the device is a guillotine.
Show Child Attributes
StandardStockItem
The StandardStockItem object is used to define standard dimensions and default characteristics of stock items.
For each material you can define list of standard stock items.
Attributes |
---|
id
int mandatoryUnique id of a StandardStockItem.
title
stringTitle of a StandardStockItem.
length
length mandatoryLength of a StandardStockItem.
width
length mandatory 2D onlyWidth of a StandardStockItem.
structure
2D onlydef: []Structures
set The structure of the StandardStockItem
Allowed values
none
The material has no structure.
byLength
The structure is horizontal (along length).
byWidth
The structure is vertical (along width).
The structure of the StandardStockItem.
edging
objectEdging configuration.
Show Child Attributes
Material
The Material object defines material group.
Each piece or StockItem must belong to a material group.
Thanks to this, the program knows which pieces are to be placed on which stock items.
Attributes |
---|
id
int mandatoryUnique id of a material group.
deviceId
int mandatoryId of a cutting device used to cut this material group.
title
string mandatoryTitle of the material group.
kind
mandatoryMaterialKind
enum Type of the material
Allowed values
1d
1D materials like profiles, pipes, rods, beams, etc.
2d
2D materials like glass, panels, fabric, aluminum, cardboard, etc.
Specifies the type of the material.
width
length mandatory 1D onlySpecifies the width of the material.
thickness
length mandatorySpecifies the thickness of the material.
canHaveStructure
bool 2D onlydef: falseSpecifies whether the material group can have a structure.
colorable
booldef: falseSpecifies whether the pieces can have different colors. It doesn't influence the optimization process.
canRotate
bool 1D onlydef: falseSpecifies whether the pieces of this material group can be rotated.
canMirror
bool 1D onlydef: falseSpecifies whether the pieces of this material group can be reversed (back to front).
surplus
lengthdef: 0This setting defines the default surplus for pieces, meaning the amount by which each cut element will be enlarged on all sides.
For instance, if a piece is 300x200 and the surplus is set to 2, the optimizer will use a size of 304x204.In the case of 1D materials, this applies, of course, only to the length.
surplusEditable
booldef: trueThis setting determines whether the surplus can be adjusted in the piece configuration.
If set tofalse
, any surplus specified by the piece will be disregarded and the one defined in material group will be used.margin
lengthdef: 0This setting determines the default margin for pieces, which is the amount by which each cut element will be reduced on all sides.
For instance, if a piece is 300x200 and the margin is set to 2, the optimizer will use 296x196.In the case of 1D materials, this applies, of course, only to the length.
marginEditable
booldef: trueThis setting determines whether the margin can be adjusted in the piece configuration.
If set to false, any margin specified by the piece will be disregarded and the one defined in material group will be used.defaultEdging
lengthdef: 0Specifies default edging for new stock items.
cuttingDimensions
mandatory2D onlyDimensions
enum Piece size used for cutting
Allowed values
net
The size specified by length & width of the piece will be used.
Note that surplus and margin may be applied if they are specified.gross
The size of the piece will be increased by the thickness of the veneers used.
Specifies what should be the piece size that will be used for cutting.
canBeVeneered
bool 2D onlydef: falseSpecifies whether pieces of the material group can be veneered.
kerf
length mandatorySpecifies the size of the kerf, i.e. the width of the waste line left by the cutting device.
allowEdgeCuts
booldef: falseSpecifies whether it is possible to do something that we call the “edge cutting”.
If you have 2mm to cut off and the kerf is 3mm, then you kind of have to "take off" those 2mm with just the saw blade - that's edge cutting.It is ignored if
minCutWidth
property of used cutting device is greater than zero.reuseWaste
objectIt defines the criterion for qualifying waste as usable.
Usable waste is one that goes to the warehouse for later use.Show Child Attributes
stackCutting
objectIt defines the stack cutting rules.
Show Child Attributes
standardStockItems
list(StandardStockItem)The list of standardStockItems for the material group.
Veneer
The Veneer object specifies characteristics of a veneer.
Attributes |
---|
id
int mandatoryUnique id of the veneer.
title
string mandatoryTitle of the veneer.
width
length mandatoryWidth of the veneer.
thickness
length mandatoryThickness of the veneer.
surplus
length mandatoryThe surplus is automatically added when the demand for the amount of veneer is calculated. Please note that the surplus is added twice.
maxMaterialThickness
length mandatoryThe maximum thickness of the material for which this veneer can be used.
2D input
Piece
The Piece object describes piece.
Attributes |
---|
id
int mandatoryUnique piece id.
materialId
int mandatoryThe ID of the material group from which this piece will be cut.
identifier
stringThe user defined identifier of the piece. It must be Code128 barcode compatible.
color
stringColor of the piece.
description
stringDescription of the piece.
length
length mandatoryThe net length of the piece.
Keep in mind that for 1D shapes, it is always the total length, including slants:width
length mandatory 2D onlyThe net width of the piece.
shapeType
def: noneShapeType
enum Shape of the piece
Allowed values
none
No shape, the same as rectangle.
rectangle
Just rectangle, so no additional shape definition is necessary.
linear
1D shape with slants. The shape property contains slant values.
Type of the shape of the piece.
shape
objectDepending on
shapeType
it may contain different format.For the moment only LinearShape is supported.
quantity
int mandatorySpecifies quantity of pieces.
structure
2D onlydef: [none,byLength,byWidth]Structures
set Structure of the piece
Allowed values
none
The material has no structure.
byLength
The structure is horizontal (along length).
byWidth
The structure is vertical (along width).
Specifies acceptable structures of the piece.
Usually you want to specify only one value here, e.g.byLength
.
But, sometimes you don’t care what structure a piece will have – then you can set it to “none,byLength,byWidth”.priority
int def: 1Priority of the piece. It can be any positive integer number. TonCut will use higher-priority pieces even if they cause larger waste.
The priority can also be expressed as a string, where:
normal
corresponds to priority1
.high
corresponds to priority10
.critical
corresponds to priority100
.
surplus
lengthdef: 0Specifies the surplus, meaning the amount by which the piece size will be enlarged on all sides.
For instance, if a piece is 300x200 and the surplus is set to 2, the optimizer will use a size of 304x204.In the case of 1D materials, this applies, of course, only to the length.
margin
lengthdef: 0Specifies the margin, which is the amount by which the piece size will be reduced on all sides.
For instance, if a piece is 300x200 and the margin is set to 2, the optimizer will use 296x196.In the case of 1D materials, this applies, of course, only to the length.
veneers
object 2D onlySpecifies which veneers should be used.
Show Child Attributes
LinearShape
The LinearShape object describes slant angles for the linear (1D) pieces or waste.
The angles given here are always measured in the same way, regardless of the cutting device settings.
leftAngle
angle mandatoryLeft slant angle measured from middle to right.
rightAngle
angle mandatoryRight slant angle measured from middle to left.
StockItem
The StockItem object describes a StockItem.
Attributes |
---|
id
int mandatoryUnique StockItem id.
materialId
int mandatoryThe ID of the material group the StockItem is made from.
identifier
stringThe user defined identifier of the StockItem.
It must be Code128 barcode compatible.description
stringDescription of the StockItem.
priority
def: normalStockPriority
enum Priority of the StockItem
Allowed values
normal
The StockItem is handled normally.
low
The stock is handled with lower priority – the program will try to avoid it.
Priority of the StockItem.
length
length mandatoryLength of the StockItem.
width
length mandatory 2D onlyWidth of the StockItem.
quantity
int mandatoryIf stack cutting is enabled for the Material, it specifies the quantity of stacks. Otherwise, it indicates the quantity of stock items.
The meaning of the
quantity
property varies depending on whether stack cutting is enabled or disabled.stackSize
intThe stack size. Note that stack cutting applies only to stock items with standard dimensions.
Applies only to material groups with enabled stack cutting. See the
stackCutting
property of the Material data object.structure
2D onlydef: noneStructure
enum Structure of the StockItem
Allowed values
none
The material has no structure.
byLength
The structure is horizontal (along the length).
byWidth
The structure is vertical (along the width).
Specifies the structure of the StockItem.
edging
objectEdging configuration.
Show Child Attributes
ResultPiece
This object describes location and transformation of a piece
that was placed on a cutting.
Here is how 2D piece is positioned depending on its transformation:
Linear pieces are positioned in a different way. Besides that they have additional transformation (mirror).
Attributes |
---|
pieceId
intID of the piece.
x
lengthX position of the piece.
y
lengthY position of the piece.
rotated
boolSpecifies if the piece was rotated.
mirrored
boolSpecifies if the piece was reversed (back to front).
Temporarily 1D only.
Waste
The Waste object describes a waste item.
Attributes |
---|
x
lengthX position of the waste.
y
lengthY position of the waste.
length
lengthLength of the waste.
width
lengthWidth of the waste.
identifier
stringAutomatically generated identifier string.
usable
boolSpecifies whether the waste is usable.
shapeType
ShapeType
enum Shape of the waste
Allowed values
none
No shape, the same as rectangle.
rectangle
Just rectangle, so no additional shape definition is necessary.
linear
1D shape with slants. The shape CustomProperty contains slant values.
Type of the shape of the waste.
shape
objectDepending on
shapeType
it may contain different format.For the moment only LinearShape is supported.
Cut
Cut object describes a cut to be made.
At the moment, we only support straight cuts in the form of segments.
Attributes |
---|
startX
lengthStart X position of the cut.
startY
lengthStart Y position of the cut.
endX
lengthEnd X position of the cut.
endY
lengthEnd Y position of the cut.
Cutting
The Cutting object describes single cutting.
Attributes |
---|
stockItemId
intID of the StockItem for which this cut is made.
quantity
intIf stack cutting is enabled for the material, it indicates the number of stacks the cutting should be performed for. Otherwise, it indicates the number of times the cutting should be performed.
The meaning of the
quantity
property varies depending on whether stack cutting is enabled or disabled.statistics
objectStatistics of the entire cutting.
Show Child Attributes
pieces
list(ResultPiece)A list of all pieces placed on the cutting, including their positions and transformations.
rest
list(Waste)A list of all Waste items, including their positions and sizes.
cuts
list(Cut)A list of Cut objects.