Skip to content

Prepare stage

Status: PROPOSED

Prepare is the planned stage in docs/ui/ui-plan.md:52–93,171–195. Every item is PROPOSED unless a row is explicitly HOW IT IS with a code citation.

Prepare makes the non-planar decision before the conventional demo-process controls. Slicer mode opens here. Simulator mode can enter Prepare, but sees a reduced loader and read-only mesh view.

flowchart LR
  L["Load model"] --> M["Mesh + plates + palette"]
  M --> NP["Enable and configure Non-Planar"]
  NP --> R["Detect or paint regions"]
  R --> P["Check Process values"]
  P --> S["Slice"]
  S --> T["DEMO TOOLPATH badge + Preview offer"]

Profiles

PROPOSED — three compact chips stay at the top of the sidebar:

Chip What it selects Honest source
Printer Printer preset and clearance defaults PROPOSED host JSON store; later additive SetPrinterProfile
Filament Material used for analysis PROPOSED picker over a real material-profile path; parsed metadata can show (inferred)
Process Named projection onto the visible process and non-planar fields PROPOSED host preset; an edited field shows a delta marker

The picker and persistence model are covered in Profiles.

Plate and model summary

PROPOSED — after a model loads, the plate area contains:

Element Planned behavior Status
Plate/object list One row per plate/object; the selection becomes the target for painting and transforms PROPOSED
Visibility controls Show or hide a selected object PROPOSED
Palette chips One chip per 3MF palette entry PROPOSED UI over existing palette queries
Object transform strip Move, rotate, or scale the selected plate PROPOSED additive SetPlateTransform; plates are read-only today
Mesh information Plates, palette size, vertices, triangles, and unit HOW IT IS — the Slicer already exposes MeshInfoLabel (src/SlicerApp/MainWindow.axaml:69) and fills it after loading (src/SlicerApp/MainWindow.axaml.cs:234–238)
Warp-grid summary Analysis grid dimensions / risk summary HOW IT ISWarpGridLabel exists (src/SlicerApp/MainWindow.axaml:70) and is filled through GetWarpGridInfo / GetWarpGridRisk (src/SlicerApp/MainWindow.axaml.cs:579–621; src/Nps.EngineHost/EngineSession.cs:505–527)

The engine already exposes plate counts, per-plate triangle counts, palette colors, and model unit (src/Nps.EngineHost/NpsAbi.cs:294–322). The list, selection, visibility, and transform interactions remain PROPOSED.

Non-Planar panel

PROPOSED — this group is expanded by default and sits above Process. Turning it off disables dependent fields with the reason “Enable Non-Planar first.”

Field User meaning Honesty label
Enable Generate the current demo path with non-planar Z variation HOW IT ISSliceNonPlanar binds EnableNonPlanar (src/SlicerApp/MainWindow.axaml:47–50), which becomes NpsGcodeGenParams.enableNonPlanar (src/Nps.EngineHost/EngineSession.cs:336–352)
Maximum surface angle Eligibility limit, 0–75° PROPOSED — requires SetNonPlanarParams.maxSurfaceAngleDeg
Maximum amplitude Cap on Z deviation PROPOSED — requires SetNonPlanarParams.maxAmplitudeMm
Thickness envelope Layers across which the transition blends PROPOSED — requires SetNonPlanarParams.thicknessEnvelopeMm
Collision clearance Nozzle radius and gantry height pair PROPOSED — requires collisionRadiusMm / collisionHeightMm
Detection mode Auto, Paint, or Full PROPOSED
Seam policy Aligned, Nearest, Random, or Painted PROPOSED
Detect regions Run automatic region detection PROPOSED additive region exports
Paint regions Enter the viewport brush mode PROPOSED UI state plus additive paint-stroke export
Region rows Show auto/painted source, overrides, and profile deltas PROPOSED

Note

Enable is the only non-planar field that affects generation today. Angle, amplitude, thickness, clearance, detection, seam policy, region detection, painting, and overrides must not be presented as working controls.

See Non-Planar controls for the complete field and workflow map.

Process group

The four conventional inputs stay visible and expanded below Non-Planar. They are not hidden behind a preset because they are the only numeric generation parameters the engine consumes today.

Control Default Current route Status
Layer height 0.2 mm SliceParams.LayerHeightGcodeGenOptions.LayerHeightNpsGcodeGenParams.layerHeight HOW IT IS (src/SlicerApp/SliceParams.cs:40,50–54,88–96; src/Nps.EngineHost/EngineSession.cs:341–352)
Feedrate 1800 mm/min Feedratefeedrate HOW IT IS (src/SlicerApp/SliceParams.cs:41,57–61,88–96; src/Nps.EngineHost/EngineSession.cs:350)
Volumetric flow scale 1.0 VolumetricFlowScalevolumetricFlowScale HOW IT IS (src/SlicerApp/SliceParams.cs:42,64–68,88–96; src/Nps.EngineHost/EngineSession.cs:345–350)
Number of layers 5 NumLayersnumLayers HOW IT IS (src/SlicerApp/SliceParams.cs:44,78–82,88–96; src/Nps.EngineHost/EngineSession.cs:351)

PROPOSED — Process becomes a named, collapsible group without changing those four working routes. Applying a process profile fills fields; editing a field adds a delta marker and makes an already-generated path dirty.

Load model and G-code

Action Planned Prepare behavior Honest current state
Load model Open a general 3MF model picker through LoadModelFromFileWithOptions; retain the Benchy shortcut PROPOSED picker. HOW IT IS — the button currently resolves the primary fixture and calls the load path (src/SlicerApp/MainWindow.axaml.cs:190–241); the options-aware ABI export exists (src/Nps.EngineHost/NpsAbi.cs:254–258) but has no production UI consumer.
Load G-code Open text G-code or BGCODE and move directly to inspectable Preview/Simulate state HOW IT IS — a picker already feeds ParseGcode / ParseBgcode (src/SlicerApp/MainWindow.axaml.cs:272–372; src/Nps.EngineHost/EngineSession.cs:124–165). Stage routing is PROPOSED.
File menu Open Model, Open G-code, Export, Quit PROPOSED; it mirrors the visible buttons rather than creating alternate behavior.

Loading external G-code is analysis input, not a generated session export. It clears the planned demo provenance and leaves Export disabled until a path is generated in-session.

Slice CTA

PROPOSEDSlice is promoted to the titlebar. It becomes Re-slice when settings differ from the last generated snapshot and is disabled with a reason when no model is loaded.

HOW IT ISApply / Regenerate already requires _modelLoaded, harvests the controls, and enters RunGenerate (src/SlicerApp/MainWindow.axaml.cs:244–263,394–456). That path calls GenerateDemoToolpath; it is not a production slicer (src/Nps.EngineHost/EngineSession.cs:330–390). The planned CTA preserves that honesty and sets the DEMO TOOLPATH badge.

There is no fake percentage. PROPOSED — while the synchronous call runs, the button shows busy and the status bar reports an indeterminate operation. A cancelable progress dialog is deferred until async slice exports and threading rules exist.

Empty and failure states

State Planned message / action Status
Prepare, no model Import a 3MF model to begin + Load model PROPOSED
Preview, no toolpath Slice to see the toolpath PROPOSED
Simulate, no toolpath No toolpath loaded + Open G-code PROPOSED
Simulator-mode Prepare Loaders + read-only mesh info; Process collapsed with “configure in Slicer mode” PROPOSED
Missing fixture / load error Keep the stage, preserve an honest error in status and Activity PROPOSED Activity surface over existing error reporting
ABI mismatch Disable engine actions and explain the mismatch in the titlebar chip PROPOSED presentation over the existing ABI check

See also