Welcome & Repo Map
Goal of this chapter. After 60 minutes you understand what Flux is, where the code lives, how the modules fit together, and where to read next — without writing a single line of code.
Audience. New engineers joining Flux development. No prior CAM knowledge assumed.
Flux in ten lines
-
Flux is a sheet-metal CAD/CAM application from the Metamation/Trumpf family.
-
Business domains: laser cutting, punching, press-brake bending, panel-bender folding, nesting, bend-cell automation (robot).
-
Stack: C# on .NET 10 (Windows, x64-only), UI in WPF (with WinForms residue), 3D import via HOOPS through a C++/CLI wrapper (
Flux.Hula64). -
One solution:
X:\Src\Flux.slnwith eight projects (Base, Core, UI, App, API, Console, Migrate, Test). -
Architecture: Model → View → Glob (Glob ≈ controller). Models and views sit together in
Flux.Core; controllers live inFlux.UI. -
Data formats: geometry/settings as Curl (text) or Au/Gold (binary); read-only assets bundled into Flux.wad. Press-brake NC post-processors are C# classes in
Src\API\Bend\Post\(one per dialect — Trumpf DLD, Bystronic, LVD, Cybelec, Safan, …); the.hxextension still appears in machine config but is only a routing token now. -
One executable (
Flux.exe), but eight flavors (Dev, Flux, Trumpf, Boost, Engine, B23, Fold, Tech) — selected at runtime via aFlux.flavortext file next to the EXE. -
Tests: a custom framework called Flit, with
[TestFixture]/[Test]attributes. ~169 test files, inputs underX:\TData. -
Docs: built-in tech notes live in
X:\Notesin the proprietary FTex format. Excellent in spirit — and partially outdated (see §8). -
You don’t have to commit anything productive in the first six months. Read, navigate, understand, ask. That’s what this chapter is for.
1. What is Flux?
Flux is the next-generation CAM stack from Metamation, replacing the older MetaCAM system step by step. It ships under multiple brand names (see §7 Flavors). The header in every source file states:
// Flux ~ Sheet metal CAD/CAM system // Copyright (c) Metamation India.
The value chain Flux models in code, for a typical part:
CAD import (STEP / IGES / DXF / DWG / ...)
│
▼
Geometry model (B-Rep, mesh, polylines) ← Flux.Base + Flux.Core/Model
│
▼
Feature & operation detection ← Flux.Core/Bend, /Laser, /Punch, /Fold
│
▼
Toolpath / NC generation ← Flux.Core/Bend, /Laser, /Punch
│
▼
Simulation & collision ← Flux.Core/Sim, /BCell
│
▼
Post-processor → NC code (G/M-code, BCC, DLD, ...) ← C# writers in Src\API\Bend\Post\ (dispatched via Hub.GenerateNC by post name)
Important consequence: Flux is not a CRUD business application. "Model" and "view" are often the same object — for example, an E3Plane knows how to render itself in OpenGL. This point is laid out at length in Notes\Dev\1002.BuildingFlux.ftx lines 31—61: the original MVC separation was rolled back because it forced ugly workarounds (the so-called Hub whiteboard).
So if it surprises you that a class like LaserCutVM lives in the Core layer — that’s intentional.
2. Repo map (top-level)
X:\ ├── Src\ C# source code (single solution: Flux.sln) │ ├── Base\ Foundation: geometry, mesh, polylines, IO primitives, rendering layer (Lux) │ ├── Core\ "Engine": domain models + their views (VModel hierarchy) │ ├── UI\ Controllers (Glob hierarchy) + WPF dialogs │ ├── App\ Main window, tabs, shell — this is what gets compiled into Flux.exe │ ├── API\ Narrow wrapper for 3rd-party automation │ ├── Console\ Developer CLI (metadata rebuild and other utilities) │ ├── Migrate\ CLI migration from MetaCAM / TOPS legacy data │ ├── Hula\ C++/CLI wrapper around HOOPS (3D import) — built separately │ ├── Lib\ External NuPkgs / DLLs (Aegis, Trumpf-Licensing, ...) │ ├── Publish\ Publish profiles / setup scripts │ ├── bin\ Build output (all DLLs end up here) │ └── obj\ Intermediate output ├── Test\ Test project (Flux.Test.csproj — framework is "Flit") ├── TData\ Test input data (.geo, .vdwg, ...) organized by domain ├── Data\ Runtime data: machines, tools, materials ├── Doc\ Images and concept diagrams (with a `.png` gallery per domain) ├── Help\ End-user manual (FTex) ├── Notes\ DEVELOPER notes (FTex) — see §8, well worth reading ├── Resources\ Fonts, HOOPS binaries, icons ├── Tools\ Helper utilities ├── Wad\ Read-only resources packed into Flux.wad ├── SDK\ SDK artifacts for API consumers └── .github\ CI/CD
Code volume (rough, current)
| Module | C# files |
|---|---|
Flux.App |
301 |
Flux.Core |
278 |
Flux.Test |
169 |
Flux.UI |
117 |
Flux.Base |
109 |
Flux.API |
98 |
Plus a handful of C++ files in Src\Hula\ (Hula.cpp ≈ 40 KB is the main one). Total: ~938 .cs files under Src\.
3. The eight projects in the solution
| Project | Type | Purpose | Read here |
|---|---|---|---|
Flux.Base |
C# |
Geometry primitives, mesh, polyline, GL context, IO helpers, undo system, Lux rendering layer |
|
Flux.Core |
C# |
Domain engine: Bend, Fold, Laser, Punch, Nest, BCell, Sim, Drawing, Layout, Trim, IO, Settings, Model, OEM, Part, Report |
|
Flux.UI |
C# |
Per-domain Glob controllers + WPF editors (TurretEditor, SheafEditor, LaserDBEditor, …) |
|
Flux.App |
C# |
Main window, tab management, global UI state, selection, undo lifecycle. This DLL is the bulk of |
— |
Flux.API |
C# |
Restricted, hardened wrapper for 3rd parties — no direct Core exposure |
|
Flux.Console |
C# |
Developer CLI (metadata rebuild, internal maintenance) |
Mostly for in-house Metamation use |
Flux.Migrate |
C# |
One-shot CLI migration: tool libraries from TOPS, machine definitions from MetaCAM |
Run once at the customer site |
Flux.Test |
C# |
Test suites (Flit framework) + GUI test runner |
|
Outside the solution but required at runtime:
Flux.Hula64.dll(C++/CLI). The build process is described inNotes\Dev\1002.BuildingFlux.ftxlines 129—187 — do not compile it yourself, copy it fromX:\Resources\Hoopstobin.
Dependency direction
Flux.Base ◄── Flux.Core ◄── Flux.UI ◄── Flux.App
▲ ▲ │
│ └───────────┘
└── Flux.API (facade over Core)
└── Flux.Test (references Core directly)
└── Flux.Migrate, Flux.Console (console front-ends)
└── Flux.Hula64.dll (HOOPS wrapper, native reference)
Source: Src\Flux.sln and the explicit <ProjectReference> / <Reference> entries in each .csproj.
4. Domains under Flux.Core
Flux.Core is internally split into domain packages. Each folder under Src\Core\ is a topic of its own:
| Folder | Domain | Reading entry point |
|---|---|---|
|
Press-brake CAM (folding with stamp/die) |
|
|
Panel-bender CAM (TecZoneFold) |
search |
|
Laser cutting |
|
|
Punching |
|
|
Nesting multiple parts on a sheet |
|
|
Bend-cell automation (robot, gripper, suction cups) |
image gallery at |
|
Simulation & collision |
|
|
2D drawing / sketch mode |
— |
|
Machine / setup layouts |
— |
|
Trim / edge processing |
— |
|
Part model (links domains) |
|
|
File import/export per format |
|
|
Shared 2D / 3D model classes (E2, E3) |
|
|
Settings / configuration |
|
|
Setup sheets, PDF reports |
— |
|
OEM-specific customizations |
— |
Reading heuristic. A class name like
BendOpis the operation,BendCalcis the pure calculation,BendVMis the view aspect (rendering),BendTechis the high-level facade ("generate NC code").BendCoretypically holds central, shared types for the domain.
5. Architecture pattern: Model → View → Glob
Flux follows an opinionated but consistent MVC variant. The terms appear everywhere — internalize them early:
| Layer | What | Where in code | Example classes |
|---|---|---|---|
Model |
Pure domain data |
|
|
VModel (view) |
Knows how to render the model (OpenGL via Lux) |
|
|
Glob (controller) |
UI shell exposing properties + commands |
|
|
GElement |
Abstract UI description of glob properties |
|
— |
PanelMaker |
Translates |
|
— |
Multi-selection. When the user selects multiple objects, the glob system builds a composite glob showing the shared properties and applying commands to all selections. This is the only clean way to implement bulk edits — don’t iterate selections by hand.
Why this matters. When you add a new domain feature, you almost always touch three places: the model, its VM, and a glob. Miss one, and the UI hook is broken.
Rendering layer. The OpenGL drawing primitives live in Src\Base\Lux\. VModel.Draw() is the common entry; rendering goes through Lux.DrawMesh, Lux.Layer, LuxShading, etc. Each VModel registers a chain of scene-graph nodes (SGNode) and gets a process-wide unique Id once it is "live" on a screen.
6. Data and language building blocks
| Term | Meaning | Defined / documented in |
|---|---|---|
Curl |
Text format for serializing config / data |
|
Au / Gold |
Binary format (compact) |
|
VDwg |
Format for rendering geometric images |
|
NC post writers |
One C# class per NC dialect (TrumpfDLD, Bystronic, LVD, …) |
|
Hex |
Originally planned post-processor language (Note 2004, 2016). Postprocessors have since been rewritten in C#. Hex may survive only as a legacy / scripting artifact. |
|
PDL |
Legacy post-processor language. Effectively deprecated. |
historical |
CMD files |
Batch processing |
|
FX file |
Native Flux file (with thumbnail) |
mentioned in |
Wad |
ZIP of read-only resources (shaders, metadata) |
|
Mech |
3D machine model (animatable) |
|
TDATA |
Test data root |
|
Sheaf |
Cascaded settings dictionary (parent-child fallback) |
|
Hub |
Static glue-point wiring components across layers |
|
7. Flavors — one binary, many products
Flux ships under different brands. The binaries are identical; a Flux.flavor file next to Flux.exe decides at runtime which flavor is active:
| Flavor | Branding | Licensing | Where |
|---|---|---|---|
|
developer build |
whitelist (developer PCs) |
your local machine |
|
MetaCAM |
Aegis (online soft-locking) |
US-Metamation, FA-Services |
|
TecZoneBend |
Trumpf WIBU |
Trumpf standalone |
|
TecZoneBend (Boost) |
Trumpf WIBU |
inside Boost |
|
(no UI) |
— |
embedded in Praxis |
|
TecZoneBend (B23) |
B23-APC identification |
on TruBend HMI |
|
TecZoneFold |
Trumpf Sentinel |
on TruBendCenter HMI |
|
Flux-Tech demo |
time-limited |
partners (USMM/FAS) |
Which features are active in which flavor is a feature-bit table in Notes\Tech\2013.FluxFlavors.ftx lines 38—57. If a bug reproduces only in one flavor, it’s almost always a feature bit.
8. Build & run — what you actually need to know (current)
⚠️ Important caveat about the tech notes.
Notes\Dev\1002.BuildingFlux.ftxis the official build doc, but several sections are outdated. For build / toolchain, trust the current.csprojfiles and the onboarding-buddy conversation, not 1002 verbatim.
What 1002 says (2017) vs. what holds today:
| 1002 says | today |
|---|---|
.NET 4.6.1, C# 6 |
.NET 10, file-scoped namespaces, |
Mercurial / Kiln ( |
Git (branch |
Visual Studio 2015 |
recent Visual Studio (Solution format version 16, platform |
Any-CPU build with 32/64-bit Hula trick |
x64-only (see |
|
newer pre-setup variant (ask internally) |
What still holds:
-
Three subst drives are standard:
X:(code/data),W:andN:(Trek). Paths in scripts often hard-codeX:\…. -
Environment variables:
FLUXDATA=X:\Data,FLUXTESTDATA=X:\TDATA,FLUXDEVELOPER=1,FLUXWAD=X:\Wad,TREKPATH=N:\Bin(for post-processors / code-finishers from the Trek stack). -
A separate solution (
Hula64.slninSrc\Hula\) for the HOOPS wrapper — don’t build it, copy the binary fromResources\Hoops\.
Concrete first build attempt:
-
X:set up as a subst (subst X: C:\Work\Fluxor similar)? -
Environment variables set?
-
HOOPS DLLs copied to
Src\bin\hoops\? -
Open
Src\Flux.sln, build *Releasex64*.
-
Run
Flux.exefromSrc\bin\(should detectDevflavor because noFlux.flavorfile is present).
If something breaks: ask buddy first, then read 1002, then search internal issues — in that order.
9. Code conventions (what you’ll see while reading)
From Notes\Dev\1001.FluxDevStyleGuide.ftx and observation of current code:
-
3 spaces for indentation (no tabs). Yes, three. "Goldilocks number."
-
K&R style with brace omission for single statements:
if (nLevel > 0 && !mLevelStack.IsEmpty) PopLevel (); -
Spaces before
(and{, no space before[, no space inside(). -
File header in every
.csfile (the stylized ASCII hammer at the right margin is the internal logo — please keep it when adding new files). -
Modern C# 10+ in new files:
namespace Flux;(file-scoped),#nullable enable. -
Class / file headers span the full width (column 100); region headers per top-level class.
Real example (Test\Bend\BasicBendAuto.cs):
namespace Flit;
#nullable enable
[TestFixture (4, "Basic bend auto-tooler tests", Module = "Bend", Subsystem = "AutoTool")]
class BasicBendAuto {
[Test (82, "Tooling basic part: Bend_04.geo")]
void Test1 () => Test ("Bend/Auto/Bend_04.geo");
...
}
10. Tests — what they look like
-
Framework: Flit (custom-built, not NUnit/xUnit). Attributes:
[TestFixture(id, description, Module=..., Subsystem=...)]and[Test(id, description)]. -
Inputs:
.geofiles underX:\TData\<domain>\…. -
Organization: one directory per domain under
Test\(e.g.Test\Bend\,Test\Laser\). Inside that, often per-year regression bundles:Bend2017.cs,Bend2018.cs, …,Bend2025.cs. Each year-file is a layer of historically collected bugs. -
Reading tip: to find a recent feature in Bend, look at
Test\Bend\Bend<currentYear>.csfirst — that’s where regression tests for PR-described issues land.
A 15-minute reading tour is described in detail in chapter 06.
11. Recommended reading order — the first five days
| Day | Read | Goal |
|---|---|---|
1 |
This document + |
Build a mental model |
2 |
|
Modules + delivery model |
3 |
Pick a domain (recommended: Bend — best-documented with images at |
Understand one domain in depth |
4 |
Walk through |
See how tests drive the code |
5 |
|
Domain depth + data model |
12. First reading exercise (~30 min)
Task: in at most half a page, explain what happens when the user edits a Bend setup through the UI.
Approach (read-only, no code change):
-
Grepforclass BendSetup— where does the class live? -
Find the matching glob in the UI layer.
-
Trace one
BendSetupproperty edit: what methods get called? -
Where is the change persisted? (Hint: Curl, Au, FX.)
-
Is undo registered? Where?
Rubric (for your mentor):
| Level | Criterion |
|---|---|
1 |
Finds |
2 |
Also finds the UI controller, can sketch UI → model data flow |
3 |
Plus: locates persistence and undo, can explain VModel’s role |
4 |
Spots an edge case (e.g. multi-selection: how does the composite glob behave?) and backs the answer up with code/tests |
More exercises in chapter 09.
13. What this chapter is not
-
Not a complete architecture reference (that’s chapter 01).
-
Not a build step-by-step (Notes/1002 owns that — even though ~30 % of it needs a refresh).
-
Not a domain deep-dive (chapter 02 covers Bend; companion chapters can be added per domain).
-
Not a fitness assessment (chapter 09 covers exercises and rubrics).
14. If you take just one thing from this chapter
Flux is intentionally not pure MVC. Models, views (VModel), and controllers (Glob) live in different assemblies, but model + view sit together in
Flux.Core. If that surprises you, readNotes\Dev\1002.BuildingFlux.ftxlines 31—61 — it was a deliberate decision against the previous architecture.
The rest you can look up.
Last updated: 2026-05-04 — when this document disagrees with the repo, the repo wins. Chapter 00 is refreshed roughly quarterly. Report drift via PR or the onboarding maintainer.