Files
OrcaSlicer/scripts/CAD
Tommaso Bianchi 8b9ff36685 The eleven constraint buttons no rung had ever pressed
Twenty buttons on the CONSTRAIN bar, nine of them exercised. The other eleven
were "implemented" in the sense that the kernel builds the right def for them --
which is exactly what was true of Parallel yesterday morning, right up until a
user pressed it and got nothing.

What a kernel test cannot see is whether the BUTTON is wired to the index its
name claims. CON_BTN is 449 + 42*i over a hand-written name list, and it has
drifted once already: six buttons were inserted, everything from index 6 on
pointed at the wrong control, and nothing caught it for months because no rung
pressed past index 5. D13 presses index 6; D14 through D22 press 8 to 19. The
map turned out to be intact, which is worth knowing rather than assuming.

D12 vertical, D13 equal_radius (its own button, not Equal's promotion),
D14 concentric, D15 tangent, D16 midpoint, D17 symmetric (the three-pick form),
D18 sym_h, D19 radius, D20 diameter, D21 fix, D22 dist_y.

Three are shaped around a specific way the code could be wrong rather than
around "does something happen":

  D20 exists for a factor of two. Diameter wired to the Radius handler gives
  r = 30 for a typed 30, and nothing on screen looks wrong.

  D21 -- Fix alone is unfalsifiable: nothing moved, so nothing proves the
  constraint exists. It only becomes observable when a SECOND constraint would
  otherwise move the fixed point, so the rung drives the pair to a 70 mm gap and
  checks which end travels.

  D14 asserts the radii did NOT change. Concentric is about centres; a solve
  that also equalised the radii would pass a naive check.

D17 failed on its first run and the rung was wrong, not the app: all three
entities are free, so the solver is entitled to satisfy the mirror by moving the
AXIS instead of the points -- and it did, landing the pair symmetric about
x = -8.18. It now measures signed perpendicular distance to the axis where the
axis actually is, which is the stronger property anyway.

Coverage: 20/20 buttons pressed, up from 9. Ladder 135 -> 177 properties across
43 rungs, all holding.

snaporca-l2vm
2026-09-01 04:19:48 +02:00
..

Design-tab scripts

Everything here supports the parametric Design tab (src/libslic3r/CAD/, src/slic3r/GUI/CAD/). Nothing here is needed to build or run OrcaSlicer — these are the development and verification tools for that one feature.

The verb in the name is the role:

build-… produce a binary
start-… bring something up and leave it running
run-… run a suite and report pass/fail
check-… one specific assertion, usually driving a live app

Verification

Script What it proves Needs
run-kernel-tests.sh The CAD kernel builds and the Catch2 [CadDocument] tags pass — every case builds a document, recomputes it and asserts on real geometry. Exit 0 is the verification contract. Docker only. No display.
run-all-checks.sh Every check below, in one command. The gate before pushing a Design-tab change. Docker + the GUI container
check-sketch-engine.py A ladder of 2D sketches of increasing complexity, judged on loop count, closure and void attribution rather than on area. Kernel only
check-sketch-engine-corpus.py The same ladder graded against a systematic sample of real drawings instead of shapes we chose. Kernel + corpus
check-gui-sketching.py The same profiles drawn the way a person draws them — synthetic mouse gestures and typed values. Headless GUI
check-gui-context-menu.py That right-click is the pivot of the design gesture, and adapts to what was clicked. Headless GUI
check-mcp-sketch.py The sketch layer driven over the MCP socket, asserting what decides whether a profile is buildable. Headless GUI + SNAPORCA_MCP

run-kernel-tests.sh is the only one CI can run. The rest need a live application with an OpenGL canvas and synthetic input, which hosted runners do not have. The kernel suite itself is already in CI by an ordinary route: the cases are registered in tests/libslic3r/CMakeLists.txt under if (SLIC3R_CAD), so they are part of libslic3r_tests and run under ctest on every platform like any other unit test. This script exists for the local loop, where it is a two-minute round trip instead of a full application build.

Build and run

Script Purpose
build-gui.sh Build the GUI binary in a throwaway container, writing into the build-cache volume the long-lived GUI container reads.
build-gui-incremental.sh Incremental build against the deps-baked image, for a fast edit/compile loop.
start-headless-gui.sh Bring the app up on a headless X display (Xvfb + a window manager), ready to drive or attach to over VNC.

Two constraints that are not obvious and have each cost a session:

  • Never build inside the GUI container. Its baked source tree silently reconfigures the shared build directory and this fork's targets vanish.
  • A window manager is required. Without one, windows are never focused, and an unfocused GTK app ignores synthetic keys — which looks exactly like a code bug.

docs/rig_build_traps.md documents these and three more, with symptoms and exact recovery commands. Read it before debugging a configure or link failure one of these scripts reports.