LaserAuto.cs Detailed Documentation
LaserAuto.cs contains regression and behavior tests for automatic laser tooling.
General pattern in many tests:
-
LoadPart(…) -
Configure part/tech settings when needed
-
Call
DoCutTooling(…)or layout code generation -
Validate with boolean assertions or text comparisons (
Assert.AreTextEqual)
Detailed Test Coverage
Group A: Baseline and Layer Semantics
Test1 (6147)
Scenario: Performance timing on ZuriTrimmed.geo.
Validation: DoCutTooling completes in under 8 seconds.
Why it matters: Guards against performance regressions in a representative geometry.
Test2 (6149)
Scenario: Mark-layer entity tooling in MarkLayer.fx.
Validation:
-
Mark-layer points are tooled as
PointCutwith pierce typeEPierce.Mark. -
Mark-layer polylines remain
PlineCutwith marking enabled (CC.IsMarking).
Why it matters: Prevents simplification rules from incorrectly converting mark polylines into pierce points.
Test3 (6156)
Scenario: GEO file containing point entities.
Validation: Every E2Point is represented by a PointCut step.
Test4 (6174)
Scenario: Layer-based behavior in MarkLayer2.fx.
Validation:
-
Stdpolyline cuts are not marking. -
Markpolyline cuts are marking. -
Auxentities are not allowed to be tooled.
Test5 (6175)
Scenario: Approach markers from AppMarkers.fx.
Validation:
-
PlineCut.ApproachBasematches expected marker points. -
Marker-layer points are not tooled as
PointCut.
Group B: Text Marking and Rule Parameter Sweeps
Test6 (6206)
Scenario: Automatic laser text placement with parameter sweep.
Validation: For all combinations of orientation, horizontal alignment, vertical alignment, and multiple heights, generated LaserText placement/angle/text data matches LaserText.txt.
Why it matters: Exhaustive regression net for text placement logic.
Test24 (9063)
Scenario: Special macros in TC_WRITE.
Validation: Generated code from a macro-based text rule matches C41979.lst.
Test25 (9064)
Scenario: DataMatrix marking (TC_LABEL_DMC).
Validation: Mixed variable/literal DataMatrix rules generate expected code (C43021.lst).
Test26 (9065)
Scenario: Grouping behavior for multiple text marks.
Validation: Across orientation/alignment combinations and toggled grouping flags, dumped mark info matches C43327.txt.
Test27 (9066)
Scenario: Missing marking generation regression (C43151).
Validation: Two related parts both generate expected mark outputs (C43151.txt).
Test28 (9067)
Scenario: Multiple marking output types.
Validation: Output code supports/serializes expected mixed types (TC_LABEL_DMC, TC_LABEL_Text, TC_WRITE, Geometry) and matches C44634.lst.
Test31 (9070)
Scenario: Marking overlap issue with open polyline inner contours (C45360).
Validation: Mark placement dump matches C45360.txt after applying varied mark rules.
Group C: Process Rules, Contours, and Open Polyline Behavior
Test7 (6217)
Scenario: DXF with countersinks and material context.
Validation: Trace output equals CounterSink.txt.
Test8 (6218) and Test9 (6219)
Scenario: Dashed lines in GEO files.
Validation: No undesired approaches; trace outputs match NoAppOnDashed*.txt references.
Test11 (6312)
Scenario: Open contour piercing behavior.
Validation: Every TraceCut has a non-None pierce type.
Test18 (9005)
Scenario: Pie slugout strategy selection. Validation: A non-inner-circular case does not use pie slugout.
Test20 (9034)
Scenario: Open polylines processing mode. Validation:
-
Mark-layer open polylines default to mark operation.
-
Std-layer open polylines default to cut operation.
-
Forced modes (
Cut,Mark,None) override behavior as expected.
Test30 (9517)
Scenario: End optimization scope and interactions with finish rules. Validation:
-
End optimization applies only to inner closed contours.
-
Outer and open contours remain unoptimized.
-
Settings (
AppAngle,AppRadius) are correct for optimized and non-optimized paths. -
With pie strategy and finish rules enabled, optimized contour count and approach defaults remain correct.
Test32 (13517)
Scenario: Cavity cut generation level.
Validation: Cavity cuts are produced at part level, ordering is deterministic, and first two cut ranges match C45774.txt.
Special note: Uses try/finally to restore global experimental flag.
Group D: Layer Filtering, Import Semantics, and Geometry Selection
Test10 (6263)
Scenario: Info-layer geometry handling. Validation: Tooling excludes info-layer geometry (only one step remains).
Test12 (6317)
Scenario: Point-on-polyline skipping policy.
Validation: With default config, one point entity is tooled; with PointEntitiesToSkip = All, point tooling is removed.
Test13 (6318)
Scenario: Form footprint marking.
Validation: Enabling MarkFormingFootprint increases marking step count.
Test14 (2556)
Scenario: Outer geometry detection when one outline is smaller than a hole.
Validation: OuterPlines count equals 2.
Test16 (6387)
Scenario: Red geometry in GEO used for nesting when no closed polyline exists. Validation: Standard outer polylines are discovered.
Test16B (6448)
Scenario: Handling red polylines when standard closed geometry exists. Validation:
-
One polyline is assigned to
Aux. -
Tooling completes successfully.
-
At least one outer closed standard
LaserPathCutexists.
Test19 (9009)
Scenario: Import setting for text entities (TextProcess).
Validation:
-
Nonemaps imported texts toInfolayer. -
Markmaps imported texts toMarklayer. -
Setting restored to
ByLayer.
Test22 (9059)
Scenario: GEO reader and PROCESS_SIDE = BOTTOM.
Validation: Entities are flagged SkipLaserTooling and excluded from final tooling (single step remains).
Test29 (17518)
Scenario: Blue contour handling in GEO. Validation: Blue entities may exist in drawing, but none appear in generated tooling steps.
Group E: Layout, Code Generation, and Special Regressions
Test15 (6376)
Scenario: Conversion of point operations when thickness changes.
Validation: Reducing thickness from 8 to 1 mm converts previously pierce-only point operations into path-cut operations (no PointCut remains).
Test17 (2564)
Scenario: Pre-cutting exception regression (C32519).
Validation: With sheared-sheet enabled, tooling traces match C32519.txt.
Test21 (9036)
Scenario: Condition selection by area under sheet slicing.
Validation: All generated SliceCut operations use condition ID 1.
Test23 (9061)
Scenario: Performance/robustness for saw-blade-like geometry (C39426).
Validation: Generated code equals C39426.lst.
Helper Methods and Their Roles
FilePath(string fileName)
Builds path to fixture data under Laser\\Auto\\.
DumpMarkInfo(StringBuilder sb, FlatTech tech)
Serializes each LaserText step into deterministic text lines including text value, height, position, angle, and DataMatrix flag.
Used by tests that verify marking placement/output stability.
LoadPart(string file)
Loads a part from test data path. Centralizes input loading and keeps tests concise.
TestTooling(FlatTech tech, string refFile)
Collects TraceCut.Trace0 curl representation into text and compares with golden file.
Used for compact regression checks where full object assertions are unnecessary.