Skip to content

feat(cli): add --inspect-paint JSON paint dump (Orca #14608) - #46

Merged
aceRage merged 2 commits into
mainfrom
cursor/cli-inspect-paint-3372
Sep 19, 2026
Merged

aceRage merged 2 commits into
mainfrom
cursor/cli-inspect-paint-3372

Conversation

@aceRage

@aceRage aceRage commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Description

Port of OrcaSlicer #14608 (--inspect-paint): dump per-facet supports / seam / MMU / fuzzy paint state as JSON to stdout, then exit. Machine-readable alternative to the paint gizmos.

CLI handler is wired in src/Snapmaker_Orca.cpp (not OrcaSlicer.cpp). Exclusive-action rejection mirrors Edge #36 / #39 / #40 (--inspect-mesh, --strict, --export-settings -).

What it emits

Per object → volume → paint layer, plus a top-level summary. Empty layers collapse to {"empty": true}. Non-empty layers list each present state with facet count, area in mm², and a mesh-local bounding box over the painted triangles only (FacetsAnnotation::get_facets_strict returns the whole source vertex list).

Layer keys: supports, seam, mmu_segmentation (extruder_1 .. ExtruderMax), fuzzy_skin. Paint-depth / ImageMap facet layers are not folded into this JSON.

sources lists every input file as absolute paths (resolve_cli_input_path, same as --inspect-mesh).

Multi-input: Orca OrcaSlicer#14608 merges CLI inputs into one Model before actions and lists every path in sources. The original handler still called inspect_to_json once per leftover Model, which concatenated JSON documents on stdout. PaintCLI::inspect_to_json now takes every loaded model and emits one JSON value: objects are concatenated (global index), with a single summary. Two STLs → one parseable document, sources length 2.

Edge adapt

Screenshots/Recordings/Graphs

N/A (CLI JSON dump; paint gizmos unchanged).

Tests

Not run: this environment has no build tree (build/ absent), so the binary and Catch2 suites were not compiled.

Accept criteria (to verify when a build is available)

  • Snapmaker_Orca --inspect-paint painted.3mf → valid JSON; summary counts match GUI paint.
  • Unpainted STL: exit 0, layers "empty": true, sources absolute.
  • Two-input smoke: Snapmaker_Orca --inspect-paint a.stl b.stlone JSON value (python -m json.tool / jq . succeeds; not two documents concatenated). sources has both absolute paths; objects includes geometry from both files; summary.objects is the combined count.
  • Status 254 / CLI_INVALID_PARAMS (−2) for: no input; combined with --slice, --strict, --export-settings -, --inspect-mesh, --migrate-datadir-test.
  • --inspect-mesh / --ground-* still work; paint-depth GUI unchanged.

--inspect-paint without input, or stacked with --slice / --strict / --export-settings - / --inspect-mesh / --migrate-datadir-test, is rejected before load (or at the migrate early-exit) via the same exclusive-action pattern as --inspect-mesh.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 17, 2026 18:17
Port --inspect-paint from OrcaSlicer OrcaSlicer#14608 onto Edge. The action dumps
per-facet supports/seam/MMU/fuzzy paint state as JSON and exits.

Handler lives in Snapmaker_Orca.cpp (not OrcaSlicer.cpp). Exclusive-action
rejection mirrors --inspect-mesh / --export-settings - from Edge #36/#39/#40:
--slice, --strict, --export-settings, --inspect-mesh, --progress-json,
--hub, and --hms-lookup are rejected with CLI_INVALID_PARAMS (status 254).
Sources use the same absolute paths as other inspects (resolve_cli_input_path).

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
…datadir-test

Orca OrcaSlicer#14608 merges CLI inputs into one Model, but the handler still dumped
inspect_to_json once per leftover Model, concatenating documents on stdout.
Fold every loaded model into a single objects/summary document.

--migrate-datadir-test is a CLIMisc early stdout exit (like --hub / --hms-lookup),
so it never appears in m_actions; reject it at the handler and in the paint
exclusivity gate.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
@aceRage
aceRage merged commit 63462ea into main Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants