Nesting.cs Overview
Purpose
Nesting.cs is a comprehensive test fixture for validating Layout and
Nesting functionality in the Flux cutting application. It tests how
parts are arranged, positioned, and organized on a cutting sheet.
Fixture Details
| Property | Value |
|---|---|
Fixture ID |
1501 |
Name |
“Nesting Test” |
Module |
FluxCut |
Subsystem |
Nesting |
Test Machine |
2230001 |
Primary File |
123.fx |
Setup & Teardown
[FixtureInitialize]
-
Installs cutting machines (ID: 2230001) before running tests
[FixtureCleanUp]
-
Deletes temporary .txt and .png files from
Utils.tempPath -
Uninstalls the test machine after all tests complete
Test Methods (13 Tests)
Part Selection & Highlighting
-
C122099 (Test 424) - “Similar option highlights Parts with the same angle and tooling should be selected together”
-
Opens DXF, assigns thickness and machine
-
Tests “Similar” selection highlighting
-
Validates that 55 similar parts are selected
-
-
C123187 (Test 437) - “Parts Selection using the options: ‘Same parts’, ‘Similar parts in row’ and ‘Similar parts in column’”
-
Tests three selection modes in nested layout
-
Validates each selection method with reference data
-
Part Movement & Positioning
-
C122169 (Test 428) - “Moving the part by dragging”
-
Tests drag-and-drop part movement
-
Validates final part placement
-
-
C122170 (Test 1510) - “Moving the part by selecting it”
-
Tests double-click + mouse move for part positioning
-
Validates layout after movement
-
-
C122171 (Test 430) - “Creating duplicate parts using Ctrl”
-
Tests Ctrl+drag to create part duplicates
-
Validates duplicate placement in layout
-
Array & Pattern Creation
-
C122172 (Test 1511) - “Creating array of parts in layout”
-
Creates part arrays along COLUMN direction
-
Creates part arrays along ROW direction
-
Validates multi-dimensional part arrangement
-
Part Collision & Display
-
C123184 (Test 434) - “Overlapping parts are shown in red”
-
Tests part overlap visualization
-
Compares with and without Ctrl key (collision detection)
-
Renders screen comparison
-
Part Rotation
-
C123185 (Test 1512) - “Rotating the parts with mouse wheel”
-
Tests Ctrl+Mouse wheel rotation
-
Validates rotated part placement
-
Grouping Operations
-
C123186 (Test 1513) - “Group parts together”
-
Tests grouping multiple parts
-
Tests ungrouping parts
-
Validates selection behavior for grouped/ungrouped parts
-
Nesting Corner Options
-
C123192 (Test 1514) - “Nest start corner option”
-
Tests four corner start positions:
-
Bottom left
-
Bottom right
-
Top left
-
Top right
-
-
Tests Quick-Nest generation with different corner settings
-
Renesting Options
-
C145736 (Test 1517) - “Nesting options under Nesting icon in the command bar”
-
Tests 5 renesting strategies:
-
CreateRemSheet (Rearrange to create remainder sheet)
-
UseFullSheet (Rearrange to full sheet)
-
SpreadAlongX (Spread parts along X axis)
-
SpreadAlongY (Spread parts along Y axis)
-
SpreadAlongXandY (Spread along both axes)
-
-
Advanced Nesting
-
C150617 (Test 1518) - “Manual Twinline Nesting”
-
Tests Shift+drag for twinline nesting
-
Validates that all parts have
CLGrouptechnology -
Uses Flux scripting validation
-
UI Elements
-
C200391 (Test 3516) - “Display of support pins in Cut view”
-
Tests support pins visibility in Cut view
-
Navigates to nesting view (‘n’ key)
-
Enables support pins display
-
Visual comparison with reference
-
Helper Methods
Nesting Operations
DoNewQuickNest(bool singlePart = false) // Create quick nest layout
SelectPartsBy(string option) // Select parts by criteria
Renest(RenestOption option) // Perform renesting operations
Recompute(RecomputeOption option = ...) // Trigger recompute/retooling
Validation Methods
CheckLuxScreen(string folder, filename = "test") // Bitmap comparison
CheckPartsInLayout(string folder, filename) // Layout data comparison
CheckSelectedParts(string folder, filename) // Selected parts validation
DoAnyPartOverlaps() // Boolean: Parts colliding?
AreAllPartsNestedWithinSheet(bool includeTooling = ...) // Boolean: Parts in margin?
Key Enums
RenestOption
RearrangeToCreateRemSheet = 0 // 'a'
RearrangeToFullSheet = 1 // 'b'
SpreadPartsAlongX = 2 // 'c'
SpreadPartsAlongY = 3 // 'd'
SpreadPartsAlongXY = 4 // 'e'
Cancel = 5 // 'f'
RecomputeOption
RetoolAllElements = 0 // Drop existing & retool all
ToolOnlyUntooledElements = 1 // Tool only untooled parts
Sequence = 2 // Recompute sequence
Routing = 3 // Recompute routing
Cancel = 4 // Cancel operation
Key Patterns Used
UI Automation
-
Keyboard input:
Utils.Type()for commands (e.g., ‘l’ for CutCAM, ‘n’ for nesting) -
Mouse operations: Click, drag-and-drop, double-click, mouse wheel
-
Keyboard modifiers: Ctrl, Shift for special interactions
Part Coordinates
Parts are identified using pixel coordinates:
new (50, 90) // Base part position
new (150, 90) // Target position
new (87, 167) // Intermediate point
new (1500, 1500) // Far position for arrays
Flux Scripting Integration
Validates layout and part state using Flux C# scripts:
Utils.RunScriptWithOutput(commands) // Execute Flux script & get result
Flux.Layout.Current // Access current layout
Flux.Layout.Current.Children // Access parts in layout
Visual & Data Validation
-
Screen comparison: Renders to PNG, compares with reference (95% tolerance)
-
Text comparison: Validates layout dumps, part outlines, NC data
-
Bitmap comparison: Visual verification of rendering
Test Data Requirements
| File | Purpose |
|---|---|
123.fx |
Primary test part file |
thinComplex.dxf |
Complex drawing with 55+ similar parts |
Test_C122099/ |
Reference data for similar parts test |
Test_C123187/ |
Reference data for part selection tests |
Test_C122169/ through Test_C200391/ |
Reference data/images for each test |
Key Testing Areas
✅ Part Selection - Similar parts highlighting - Row/column selection modes
✅ Part Manipulation - Dragging, moving, rotating - Duplicate creation - Array generation
✅ Grouping/Organization - Part grouping/ungrouping - Collision detection - Part overlap visualization
✅ Nesting Strategies - Quick-Nest with corner options - Renesting with various algorithms - Twinline nesting
✅ Visual Validation - Screen rendering comparison - Support pins display - Layout data verification
Architecture Highlights
-
Modular design: Separate helper methods for common operations
-
Fluent assertions: Direct state validation via Flux scripting
-
Reference-based validation: Compares against baseline files/images
-
Multi-modal interaction: Keyboard, mouse, and scripting commands
-
Tolerance-based comparison: 95% bitmap similarity threshold for visual tests
This is a sophisticated layout/nesting validation framework ensuring correct part arrangement, positioning, and display in the Flux application’s cutting optimization engine.