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 value | Type and unit | Constants |
|---|---|---|
| Length, position | Cardinal or Integer, 0.01 mm | cLengthMultiplier = 100 per mm |
| Area | TField (Int64), (0.01 mm)² | cFieldMultiplier = 10000 per mm² |
| Piece rotation | TRotation (Word), 0.1° | cRotationUnit = 0.1, cRotation90 = 900, cRotation180, cRotation270, cRotation360 |
| Solution sheet rotation | Integer, whole degrees | only 0, 90, 180, 270 |
| Counts, quantities, priorities, weights | not scaled |
Units by property
| Property | Unit |
|---|---|
IFormat Length, Width, Surplus, Margin, TotalLength, TotalWidth | 0.01 mm |
IFormat Rotation, RotationStep | 0.1° (TRotation) |
IFormat Quantity, Priority, Weight | not scaled |
IMaterial Thickness, Width, Kerf | 0.01 mm |
IMaterial recycle sizes (MinShorterRecycleSize, MaxLongerRecycleSize, and the others) | 0.01 mm |
IMaterial StackSize, CutShiftHorzLimit, CutShiftVertLimit, CutShiftTotalLimit | not scaled |
ISheet Length, Width, Edging sides | 0.01 mm |
ISheet Quantity, StackSize, CutShiftHorzLimit, CutShiftVertLimit | not scaled |
MinEdgeDistance sides | -1 means inherited |
ISolutionFormat X, Y | 0.01 mm, native sheet frame |
ISolutionFormat Rotation | 0.1° (TRotation) |
ISolutionSheet Rotation | whole degrees: 0, 90, 180, 270 |
ISolutionCut PosX, PosY, TarX, TarY, PosXp, PosYp, TarXp, TarYp | 0.01 mm, output frame |
ISolutionWaste X, Y, Length, Width | 0.01 mm, native sheet frame |
Field properties, waste fields (TechnologicalWasteField and others) | (0.01 mm)² (TField) |
ISolutionSheet.CalcEffectiveLayout outputs | 0.01 mm |
ISolutionSheet.CalcCutsInfo length | 0.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.Descriptionis the piece name the user sees.IFormat.Identifieris a code; TonCut shows it in some label modes and encodes it in barcodes (see ).IFormat.Priorityis anInteger:cPiecePriorityDefault(0) inherits the project's priority,cPiecePriorityNormal(1) is normal,cPiecePriorityHigh(10) is high, andcPiecePriorityCritical(100) is critical. A new piece defaults to 0 when TonCut uses projects and to 1 otherwise.ISheet.Priorityis a stock priority fromcStockPriorityMin(0) tocStockPriorityMax(100); see its reference entry.
Geometry
Plugins mainly meet geometry in four places:
- IFormat
Shape, IBanding, and IGrinds when importing pieces. - ISheet
Edging,Defects, andHoleswhen importing or exporting stock. - ISolutionSheet coordinate helpers when exporting results.
- 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 term | Desktop interface |
|---|---|
| Device | IDevice |
| Material / material group | IMaterial |
| Veneer / band | IBand / IBanding |
| Piece | IFormat |
| Stock / stock item | ISheet / IStandardSheet |
| Cutting / output sheet | ISolutionSheet |
| Output piece | ISolutionFormat |
| Waste | ISolutionWaste |
| Cut | ISolutionCut |
The Engine documentation is useful for concepts, but this site defines the Desktop plugin contract. Where they differ, for example in file matching, feature flags, result codes, or units, follow this site.