Laser Cutting Technology
This document explains the laser cutting pipeline in Flux: the cutting-condition database, the cut-step class hierarchy, the auto-tooler, and the NC output path.
Primary files:
-
Core/Laser/LaserCore.cs— cutting-condition database infrastructure -
Core/Laser/LaserCut.cs—LaserStep,LaserPathCut,PointCut,LaserText -
Core/Laser/PlineCut.cs—PlineCutandMacroCut(the main cut steps) -
Core/Laser/TraceCut.cs—TraceCut(approach/escape/profile base) -
Core/Laser/Ops/LaserAuto.cs—LaserAutotooler
1. Overview
The laser pipeline has three layers that work in sequence:
Drawing2 (E2Pline, E2Point entities)
↓ LaserAutotooler.DoTooling()
FlatTech (IStepCollection of CutStep objects: PlineCut, PointCut, …)
↓ ICodeGenerator / LSTGen
NC file (.lst, .nc, .nc3d, …)
The database layer (LaserCore.cs) provides the cutting parameters — speed, gas
pressure, kerf width, pierce time — for a given material and thickness. The
step layer (PlineCut, TraceCut) carries per-contour tooling: which condition to
use, where the approach starts, corner treatments, bevel data. The tooler
(LaserAutotooler) creates steps from drawing entities and selects conditions
automatically.
2. The Cutting-Condition Database (LaserCore.cs)
LaserCore.cs is the core database infrastructure. It is not named after a machine —
the file provides the classes that represent a machine’s laser parameter database
(Trumpf calls this an "LTT", Laser Technology Table).
2.1. The three-level hierarchy
LaserDBBook (one per machine)
└── LaserDBPage[] (one per material × thickness × surface combination)
└── LaserCondition[] (cut, mark, vaporize, pierce conditions)
2.2. LaserDBBook
File: Core/Laser/LaserCore.cs:385
One LaserDBBook exists per CutMachine. It is the top-level container for all
cutting conditions on that machine and is loaded from two .curl files:
-
mc:<machineId>/cutdbFactory.curl— factory-shipped defaults (read-only) -
mc:<machineId>/cutdbUser.curl— user modifications layered on top
| Property | Meaning |
|---|---|
|
Machine identifier string (e.g. |
|
All |
|
Ordered array of field IDs for cutting conditions |
|
Ordered array of field IDs for pierce conditions |
|
Ordered array of field IDs for edge-control conditions |
|
Pages filtered by the machine’s |
|
Materials for which at least one page exists; follows |
|
|
Looking up a page:
| Method | Behaviour |
|---|---|
|
Exact match only; returns ordered sequence |
|
Closest match with scoring: ±thickness 5 %, film mismatch +5, treatment mismatch +1500, wrong material +1000. Returns up to ~3 score buckets. |
|
First exact match ( |
|
First lenient match |
Field index lookups (GetCCFieldIndex, GetPCFieldIndex) map a LaserDBField.EFields
enum value to the offset inside LaserCondition.Val[]. The result is cached in a
256-entry byte array, so the lookup is O(1) after the first call.
Saving:
Save() writes only the diff between the factory book and the current book to
cutdbUser.curl using AuCurl.Save. SaveFactory() writes the entire book to the
shared archive (developer use only).
2.3. LaserDBPage
File: Core/Laser/LaserCore.cs:960
A LaserDBPage is one row in the machine’s technology table — cutting parameters for
a specific material × thickness × surface combination.
| Property | Type | Meaning |
|---|---|---|
|
|
Unique ID. Factory pages: < 100001. User-defined: ≥ 100001. |
|
|
|
|
|
Material name matching |
|
|
Sheet thickness in mm |
|
|
Painted, oiled, bare, etc. |
|
|
Protective film presence |
|
|
Standard, OxygenCutting, HiLas, HighSpeed, CompressedAir, BrightLine, etc. |
|
|
Flags: FlyLine, CoolLine, BevelCut, RedFlyLine, NanoJoints |
|
|
N₂, O₂, Air, Argon, N₂O₂, Custom |
|
|
Lens focal length (mm) |
|
|
Human-readable name (e.g. |
|
|
All conditions on this page |
|
|
Raw LST STAMM table values (Trumpf machines) |
|
|
LTC/LCE/LPE table data (newer Trumpf format) |
|
|
Maximum acceleration for this page (m/s²) |
|
|
Maximum bevel chamfer angle (default 50°) |
|
|
Parsed from |
|
|
Required machine capabilities |
Convenience accessors:
| Property / Method | Meaning |
|---|---|
|
The "large contour" |
|
|
|
Non-redundant cut conditions, largest geometry first. Drops medium if it is identical to small. |
|
True if any |
|
The vaporize condition (or null) |
|
All path conditions of the given cut type |
|
Single condition by ID |
|
Best pierce condition for the given pierce type, respecting |
|
Condition tagged to a specific layer name |
|
True if the pline is smaller than the smallest active condition’s |
|
Auto-selects the best condition for a pline |
2.3.1. ChooseCC — how a condition is selected for a contour
File: Core/Laser/LaserCore.cs:1120
The goal is to pick the fastest condition whose geometry threshold the pline satisfies.
When ccBy == EChooseCCBy.Area: uses the pline’s enclosed area directly —
selects the first condition whose GeomSize ≤ area.
When ccBy == EChooseCCBy.Average or MaxSegment: measures segment lengths along
the pline, but merges consecutive segments separated by a turn angle < 10° to avoid
penalising smooth spline-approximated curves. For each resulting effective segment
length, a "corrected" length is computed that accounts for curve radius:
corrected_len = len × (1 + (f - 1) × (1 - R_threshold / seg.Radius)) // for curves
corrected_len = len × f // for straights
where f = 2 × √π ≈ 3.545
The average (or maximum) corrected length is compared against
2 × √(GeomSize × π) — the diameter of a circle with area = GeomSize. The
first condition for which the metric exceeds this threshold is chosen (large
contour condition = largest GeomSize = selected for large/complex contours).
If no condition qualifies, the last (slowest) condition is returned as fallback.
2.4. LaserCondition
File: Core/Laser/LaserCore.cs:1338
A single cutting or piercing condition. All numeric parameters are stored as float[]
Val, indexed by position in the owner book’s CCField or PCField array.
| Property | Type | Meaning |
|---|---|---|
|
|
Unique within the page |
|
|
|
|
|
|
|
|
Cast to |
|
|
Layer name this condition is mapped to (for layer-driven selection) |
|
|
Minimum contour area (mm²) for this condition to apply |
|
|
Parameter values; indexed via |
|
|
Sheaf settings attached to this condition (approach radius, etc.) |
|
|
Vendor-specific extra values (third-party machines) |
Fast-access properties (call GetValue(EFields.xxx) internally):
|
Cutting speed (m/min) |
|
Gas pressure (bar) |
|
Cut width on sheet (mm) |
|
Head-to-sheet distance (mm) |
|
Pierce duration (s) |
|
True for |
|
True for |
|
True if this is the large-contour standard condition |
|
True if Trumpf PierceLine field is set in |
2.5. Key Enumerations
2.5.1. EPierce — pierce operation types
| Value | Meaning |
|---|---|
|
Standard pierce (default; stored as 0 so it can be omitted in .curl) |
|
No pierce (start on sheet edge or pre-pierced) |
|
Soft / slow pierce for sensitive materials |
|
Power / fast pierce |
|
Cool pierce (gas cooling) |
|
Dot-mark only (no through-cut) |
|
Punched on a combination machine |
|
Peck piercing (staged) |
|
Multi-step pierce |
|
Ramp-modulated piercing variants |
|
Gas-assisted pierce variants |
|
Fast pierce |
2.5.2. ECut — path operation types
| Value | Meaning |
|---|---|
|
Through-cut (removes material) |
|
Burns off protective film without cutting through |
|
Engraves/scores the surface |
|
Dot-by-dot marking |
2.5.3. ELaserProcessTypes — primary process
Standard, OxygenCutting, HiLas (nitrogen high-pressure), HighSpeed, CompressedAir, NitroLinePlasma, HighQuality, BrightLine, ThickLine, ArgonCutting, PrecisionCutting, Reliable3D.
2.5.4. ELaserProcessOptions — secondary flags (bitfield)
FlyLine (stitch cut), CoolLine, BevelCut, RedFlyLine, NanoJoints.
2.5.5. EGasTypes
Undefined, N2, O2, Air, Argon, N2O2, Custom.
2.5.6. ECornerTreatment
DoNothing, Rounding, Looping, Dwell, Cool, Stop, Slowdown,
BevelSharpCorner, BevelCylindricalRounding, BevelConicalPoint.
3. The Cut-Step Class Hierarchy
CutStep (abstract base — Entity2 + CutConfig)
└── LaserStep (abstract — adds LaserPage, Settings)
├── LaserPathCut (abstract — adds CCId, CC, BevelData, Pierce)
│ └── TraceCut (abstract — adds Trace, approach/escape profile)
│ ├── PlineCut ← main workhorse for contour cutting
│ └── MacroCut ← special-shape template cutting
├── PointCut ← point pierce / dot mark
└── LaserText ← automatically added text markings
3.1. CutStep
The base class shared across laser, punch, and other technologies. Holds:
Entity2 Entity, CutConfig Config, ESFlags Flags, and the dirty/notification
infrastructure (Dirty(), PFire()).
3.2. LaserStep
File: Core/Laser/LaserCut.cs:58
Adds laser-specific concerns:
| Member | Meaning |
|---|---|
|
The |
|
|
|
Always equals |
|
Abstract — called by |
|
Adds |
3.3. LaserPathCut
File: Core/Laser/LaserCut.cs:111
Abstract base for all contour operations. Adds cutting-condition selection:
| Member | Meaning |
|---|---|
|
Primary cutting-condition ID. |
|
|
|
Pierce condition ID auto-selected from the page |
|
|
|
|
|
|
|
True when the pline is smaller than the page’s smallest condition geometry |
|
Resets |
|
Parent in the Sheaf hierarchy: wraps |
3.4. PlineCut
File: Core/Laser/PlineCut.cs:13
The primary cut step for normal contours. Extends TraceCut with per-cut overrides:
| Property | Meaning |
|---|---|
|
|
|
|
|
|
|
|
|
True when approach point is not fixed and there are no mid-path CC changes |
|
|
|
|
|
User-overridden corner treatments (by corner index) |
|
Crossing points with other cuts (for commonline/shared-cut optimisation) |
|
Positions where bevel angle changes (from |
|
Lie values where bevel joints are inserted |
3.5. MacroCut
File: Core/Laser/PlineCut.cs (at the end of the file)
A TraceCut that cuts a standard shape (circle, D-shape, rounded rectangle, chamfered
rectangle, double-D) using a pre-computed shape template instead of the entity pline
directly. The LaserAutotooler creates MacroCut when ToolStdShape succeeds.
3.6. TraceCut
File: Core/Laser/TraceCut.cs
Abstract base for PlineCut and MacroCut. Owns the computed toolpath profile:
| Property | Meaning |
|---|---|
|
The main trace polyline (approach + cut + escape) |
|
|
|
Complete toolpath: approach → pierce position → cut → escape |
|
First and last points of the profile |
|
Total path length being cut (not counting approach/escape) |
|
Lead-in / lead-out arc or line lengths |
|
Forced approach position on the pline (float, NaN = auto) |
|
Forced cut-end position (used for sheared-sheet edge cuts) |
|
|
|
|
Key ESFlags values:
| Flag | Meaning |
|---|---|
|
Approach location locked (from approach marker entity or user) |
|
Standard |
|
This cut marks a bend line (selects Mark condition automatically) |
|
Approach starts on a sheared sheet edge |
|
Cut ends on a sheared sheet edge |
|
Kerf offset has been validated; cleared when |
Key methods:
-
Dirty()— marks the profile for recomputation and firesEProp.CodeDirty. -
GetNestingPlines()— returns approach and escape plines for nesting (theCutToolinglayer plines added to the part outline for collision avoidance). -
GetToolingPlines()— approach, cut body, and escape segments separately. -
MoveApproach(lie)— relocates the approach start on the pline. -
Flip(really)— reverses the cut direction (clockwise ↔ counter-clockwise).
3.7. PointCut
File: Core/Laser/LaserCut.cs:262
A single pierce or dot-mark at a point. Can be created from:
* E2Point ep — explicit point entity in the drawing
* E2Pline e2p — pierces the bounding box centre of the pline (for pre-pierce)
Key properties: Pierce (EPierce), PierceCondition (the LaserCondition).
NC generation calls cg.TurnLaserOn(PierceCondition, null, EKerfCorrection.None).
Optionally calls cg.VaporizePoint for film vaporization around the pierce.
3.8. LaserText
File: Core/Laser/LaserCut.cs:356
A marking step for automatically added laser text (part numbers, data-matrix codes,
etc.) created by finishing rules. Not backed by an E2Text entity in the drawing.
Properties include Text, Angle, font settings, position, and EMarkOutputType
(plain text, data-matrix, QR, etc.).
4. LaserAutotooler.DoTooling
File: Core/Laser/Ops/LaserAuto.cs:24
LaserAutotooler is the orchestrator that transforms a Drawing2 into a fully tooled
FlatTech (the IStepCollection). Called from Part.DoCutTooling().
4.1. Precondition
If Config.LaserPage == null (no cutting-condition page could be found for this
material/thickness), the tooler returns EResult.NoLaserPage immediately.
4.2. Step-by-step process
public EResult DoTooling (EDoFlags flags = EDoFlags.Default) {
Tech.CompOnce.Clear (); // 1. clear cached values
GatherSpecialEntities (); // 2. find approach markers
// 3. stitch cutting
if (FlyLine && StitchCutDist > 1) {
new StitchCutterCircles (Tech).DoTooling ();
new StitchCutter (Tech).DoTooling ();
}
// 4. tool each entity
foreach (var ent in Dwg.Entities) { … create PlineCut / PointCut … }
// 5. sheared-sheet edge notches
// 6. trim concavities (experimental)
// 7. finishing rules
Tech.ApplyFinishingRules (contourMap);
Tech.OptimizeCutEnds (); // 8. optimize
Tech.RefreshMarkings (); // 9. laser markings
Tech.MarkBendLines (); // 10. bend-line marks
return EResult.OK;
}
4.2.1. Step 2 — Approach markers
Entities on the ApproachMarker layer are gathered. Their positions are matched
against plines later in step 4 to lock the approach point.
4.2.2. Step 3 — Stitch cutting (FlyLine)
When ELaserProcessOptions.FlyLine is enabled and StitchCutDist > 1 mm,
StitchCutterCircles and StitchCutter create PlineCut fragments that produce
tabs between parts on a nested sheet — the laser cuts almost all the way around each
part but leaves small uncut bridges (stitches) so pieces stay connected until the
operator removes them.
4.2.3. Step 4 — Tooling entities
For each E2Pline in the drawing:
-
Skip already-tooled (
Tech.HasSteps(ent)) and covered entities. -
Sheared sheet: if the outer pline has sheared edges, skip it here; handle it separately after the main loop.
-
Standard shape (
ToolStdShape): if the machine hasSplShapeMaskand the pline matches a supported shape (circle, D, rounded rect, chamfered rect, double-D), aMacroCutis created with a pre-computed shape trace and a fixed 90° approach. Returnstrueto skip further handling. -
Normal pline: create
PlineCut(e2p, config).-
If the auto-selected
CCis not a cut (marking/vaporize), setPierce = None. -
For outer or open plines: disable end optimisation.
-
If
SlowerCCForConstrainedApproachis set: while the approach is constrained (tool head can’t reach the start without crossing the part), try a slower CC that provides a longer approach lead-in.
-
-
For
E2Pointentities: createPointCutwith the configured pierce type.
4.2.4. Step 5 — Sheared-sheet notches
If the outer pline has sections that should be sheared (sheet edge already cut by
guillotine), only the remaining unsheared portions are tooled as separate PlineCut
fragments with StartOnSheetEdge / EndOnSheetEdge flags set.
4.2.5. Steps 7–10 — Post-processing
-
ApplyFinishingRules— applies user-defined rules (e.g. mark this feature, skip that layer, add approach at specific angle). -
OptimizeCutEnds— moves approach start points to minimise rapid-travel distance between consecutive cuts. -
RefreshMarkings— addsLaserTextsteps for part numbers, barcodes etc. as configured by marking rules. -
MarkBendLines— createsPlineCutsteps withESFlags.BendMarkfor eachE2Bendline, using theMarkcondition.
4.2.6. ToolStdShape — special-shape macro cuts
File: Core/Laser/Ops/LaserAuto.cs:150
Checks SplShapeMask against the pline’s ShapeDesc. Recognized shapes:
| Shape | sliceAt |
Approach |
|---|---|---|
|
0 |
Approach at segment 0, max approach = diameter |
|
2.5 |
Approach at segment 2.5 |
|
1 |
Max approach = width / √2 |
|
3 |
Max approach = width / √2 |
A MacroCut is created with AppLength capped at the shape’s maximum approach, zero
radius, and a 90° approach angle.
Thin-shape rejection: if BreakThinMacro is set and the aspect ratio exceeds
ThinMacroFactor, the macro is rejected and a normal PlineCut is used instead.
5. Trumpf LTT Data: LstLTTParameter and Ltx
5.1. LstLTTParameter
File: Core/Laser/LaserCore.cs:1442
Metadata for each column in a Trumpf LST STAMM table. Loaded once from ltxData.json:
| Field | Meaning |
|---|---|
|
JSON key (camelCase, e.g. |
|
LST column number (e.g. 2290 = MaterialStandard) |
|
Unit string written into STAMM ( |
|
|
CreateSTAMMTable(pages) generates the BEGIN_LTT_STAMM … END_LTT_STAMM block
for the LST file by iterating LstLTTParameter.Parameters and reading each page’s
STAMMData array at the matching index.
5.2. Ltx, LtxRow, LtxField, LtxParameter
Newer Trumpf laser machines use an LTX format (three linked tables: LTC common
parameters, LCE cut extension, LPE pierce extension) instead of the older STAMM
approach.
Ltx holds the three table strings. LtxRow stores a row of encrypted
(AES-256) key-value pairs, protecting proprietary machine parameters. LtxParameter
provides the static column definitions (loaded from ltxData.json) and formula
rules for generating LST expressions.
6. Complete Pipeline
Drawing2 (E2Pline, E2Point, E2Bendline)
│
↓ Part.DoCutTooling()
│ → new LaserAutotooler(part).DoTooling()
│
├── For each E2Pline
│ ├── ToolStdShape? → MacroCut (template trace)
│ └── else → PlineCut
│ ├── CCId auto-select: LaserDBPage.ChooseCC(op, pline, ccBy)
│ ├── Pierce auto-select: LaserDBPage.GetPC(pierceType)
│ └── Profile computed by TraceCut (approach arc + cut + escape)
│
├── For each E2Point → PointCut
├── StitchCutter → stitch PlineCuts (FlyLine)
├── ApplyFinishingRules
├── OptimizeCutEnds
├── RefreshMarkings → LaserText steps
└── MarkBendLines → PlineCut (BendMark flag, Mark condition)
│
↓ FlatTech (IStepCollection)
all CutStep objects in cut order
│
↓ ICodeGenerator.GenCode() / LSTGen
per step:
├── PlineCut → RapidMove to approach → TurnLaserOn(CC, pierce)
│ → CutPath with kerf offset, corner treatments,
│ → CCChanges mid-path → TurnLaserOff → escape
├── PointCut → VaporizePoint (optional) → TurnLaserOn(PC)
└── LaserText → WriteText
│
↓ NC file (.lst, .nc, .nc3d, …)
+ Trumpf STAMM / LTX tables (LstLTTParameter.CreateSTAMMTable)
7. Key Files
| File | Responsibility |
|---|---|
|
Database: |
|
Class hierarchy: |
|
|
|
|
|
|
|
|
|
Cut-sequence routing optimisation |
|
|
|
Trumpf LST NC code generator; consumes |