Metamation Developer Notes

  • Developer Notes
  • Resource Map
  • Tools
    • Code Formatting
    • Configuring Git
    • Assignments
    • Testing with Windows Sandbox
    • Single Binary Applications
    • Self-Updating Applications
  • Flux Workflow
    • Flux Workflow
    • Flux Development Style Guide
    • Release notes for Flux
    • SonarCloud analysis for Flux
    • Build a Flux SDK Program
    • Shipping Flux
    • Flux.Test
      • BasicBendAuto Test
      • LaserAuto.cs Detailed Documentation
      • Laserexample:Test1
  • Technical Notes
    • File formats
      • .FX File Format
      • Au(Gold) streams
      • .GEO File Format
      • .LST File Format
      • .LST file - technology
      • .BNC File Format
      • .WAD Files: Flux Resource Packages
      • .Curl Files: ASCII config information
    • Folders App
      • Data\Bendtools
      • Data\Machines
    • FluxCode
      • Welcome & Repo Map
      • Architecture & System Context
      • Subsystem *Bend* (Press Brake)
      • Subsystem *BCell* (Bend Cell Automation)
      • API Maps
      • Data Model Catalog
      • Design Patterns -- A Reader's Guide
      • Tests and Golden Paths
      • Guided Code Tours
      • CAM Glossary with Code Mapping
      • Assignments
      • Flux Onboarding Handbook
    • Data flow
      • Part
        • Part.Dwg
        • Part.Load
        • Part.Load to Part.Dwg
      • BendTech.cs
      • Bend Technology
      • Laser Cutting Technology
    • LTS (Long term support mechanism)
    • Machine ID Scheme
  • FluxTester
    • Commands and Scripts
    • Command Cookbook
    • Script Commands
    • BendTooling.cs Test Inventory
    • LaserTooling.cs Test Steps
    • Fluxtester Recipe Book
    • Nesting.cs Overview
    • Nesting.cs Recipe Book
    • Job.cs Overview
    • Job.cs Recipe Book
  • Software license
  • 3d party software
    • Python
  • Documentation
    • Bento documentation
      • Structure of a Bento page
      • Attributes
    • Software
      • Software Requirement
      • Installation
      • Git workflow for documentation contributors
    • Quick start guide
    • Workflow
      • Roles and responsibilities
      • Analyze
      • Edit
      • Proofread
      • Pre-Publish
      • Publish
      • Release cycle
      • Information required for Documentation Team
      • Checklist for Documenters
    • Styleguide
    • Flavoring
    • Translation
      • Ordering translation for a new document
    • Citations
    • Annotation
FluxTester
/
Nesting.cs Overview

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 CLGroup technology

    • 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.

Contents

  • Purpose
  • Fixture Details
  • Setup & Teardown
  • [FixtureInitialize]
  • [FixtureCleanUp]
  • Test Methods (13 Tests)
  • Part Selection & Highlighting
  • Part Movement & Positioning
  • Array & Pattern Creation
  • Part Collision & Display
  • Part Rotation
  • Grouping Operations
  • Nesting Corner Options
  • Renesting Options
  • Advanced Nesting
  • UI Elements
  • Helper Methods
  • Nesting Operations
  • Validation Methods
  • Key Enums
  • Key Patterns Used
  • UI Automation
  • Part Coordinates
  • Flux Scripting Integration
  • Visual & Data Validation
  • Test Data Requirements
  • Key Testing Areas
  • Architecture Highlights
Fluxtester Recipe Book Nesting.cs Recipe Book

      Copyright © 2025 TRUMPF Metamation. All rights reserved.

    Compiled by Bento