Data Model & Units

TonCut Desktop exposes its shared data model through the plugin interfaces. A plugin does not need every implementation detail, but it must use the host's units, rotation conventions, and naming exactly, or imported and exported data will be wrong by a factor of 100 or rotated.

Units

Every length and position in the plugin API is an integer in hundredths of a millimeter (0.01 mm). Convert with cLengthMultiplier (100) from uICommon: 18 mm is 18 * cLengthMultiplier = 1800.

This does not depend on the unit the user has chosen. (ITonCut.Units) and ITonCut.Precision only control how TonCut displays values; use the ITonCut formatting helpers (FormatLength, HumanReadableLength, FormatField, HumanReadableField, FormatDegrees, FormatRadians) when your own user interface must show a value the way TonCut does.

Kind of valueType and unitConstants
Length, positionCardinal or Integer, 0.01 mmcLengthMultiplier = 100 per mm
AreaTField (Int64), (0.01 mm)²cFieldMultiplier = 10000 per mm²
Piece rotationTRotation (Word), 0.1°cRotationUnit = 0.1, cRotation90 = 900, cRotation180, cRotation270, cRotation360
Solution sheet rotationInteger, whole degreesonly 0, 90, 180, 270
Counts, quantities, priorities, weightsnot scaled

Units by property

PropertyUnit
IFormat Length, Width, Surplus, Margin, TotalLength, TotalWidth0.01 mm
IFormat Rotation, RotationStep0.1° (TRotation)
IFormat Quantity, Priority, Weightnot scaled
IMaterial Thickness, Width, Kerf0.01 mm
IMaterial recycle sizes (MinShorterRecycleSize, MaxLongerRecycleSize, and the others)0.01 mm
IMaterial StackSize, CutShiftHorzLimit, CutShiftVertLimit, CutShiftTotalLimitnot scaled
ISheet Length, Width, Edging sides0.01 mm
ISheet Quantity, StackSize, CutShiftHorzLimit, CutShiftVertLimitnot scaled
MinEdgeDistance sides-1 means inherited
ISolutionFormat X, Y0.01 mm, native sheet frame
ISolutionFormat Rotation0.1° (TRotation)
ISolutionSheet Rotationwhole degrees: 0, 90, 180, 270
ISolutionCut PosX, PosY, TarX, TarY, PosXp, PosYp, TarXp, TarYp0.01 mm, output frame
ISolutionWaste X, Y, Length, Width0.01 mm, native sheet frame
Field properties, waste fields (TechnologicalWasteField and others)(0.01 mm)² (TField)
ISolutionSheet.CalcEffectiveLayout outputs0.01 mm
ISolutionSheet.CalcCutsInfo length0.01 mm (Double)

The two frames used by solution geometry are explained under Coordinate frames.

Material width. A 2D material has Width 0. A 1D material's Width is its bar width, and IFormat.Width of a 1D piece is always its material's width.

Names and priorities

  • IFormat.Description is the piece name the user sees. IFormat.Identifier is a code; TonCut shows it in some label modes and encodes it in barcodes (see ).
  • IFormat.Priority is an Integer: cPiecePriorityDefault (0) inherits the project's priority, cPiecePriorityNormal (1) is normal, cPiecePriorityHigh (10) is high, and cPiecePriorityCritical (100) is critical. A new piece defaults to 0 when TonCut uses projects and to 1 otherwise.
  • ISheet.Priority is a stock priority from cStockPriorityMin (0) to cStockPriorityMax (100); see its reference entry.

Geometry

Plugins mainly meet geometry in four places:

  1. IFormat Shape, IBanding, and IGrinds when importing pieces.
  2. ISheet Edging, Defects, and Holes when importing or exporting stock.
  3. ISolutionSheet coordinate helpers when exporting results.
  4. ISolutionCut, ISolutionWaste, and ISolutionFormat when reading optimization output.

The shape model supports rectangles, linear shapes, arbitrary paths, and more specialized shape types. A result exporter must not assume that every piece or waste region is a plain rectangle.

Terminology map

The TonCut Engine documentation describes many of the same concepts under engine names:

Engine termDesktop interface
DeviceIDevice
Material / material groupIMaterial
Veneer / bandIBand / IBanding
PieceIFormat
Stock / stock itemISheet / IStandardSheet
Cutting / output sheetISolutionSheet
Output pieceISolutionFormat
WasteISolutionWaste
CutISolutionCut

Was this page helpful?