Make the ladder runnable on this fork's rig — 6 of 7 rungs now hold

This fork had never been gated end to end. Five separate things stopped it, none
of them a defect in the CAD code itself, and each failure named the wrong
subsystem — which is why they survived.

1. run-all-checks.sh invoked docs/ux/mockups/gen_offer_table.py. The design docs
   moved to docs/CAD/ (bbd1989e1e) and this path did not follow, so the rung
   failed on a missing file.
2. gen_offer_table.py then resolved REPO one dirname short, because it now sits a
   level deeper. OUT pointed at docs/src/.../DesignOffer.hpp, which does not
   exist, so --check diffed the generated table against an EMPTY file and
   reported all 189 lines as a difference.
3. DISPLAY was never passed into the container. The check scripts fall back to
   ":10", which is the other fork's rig; this one's Xvfb is :11. Symptom:
   "FATAL no app window on :10", which reads like a dead app.
4. Every absolute chrome coordinate was written in the Snapmaker fork's layout.
   This fork keeps mainline's top row (File / save / undo / redo / Calibration
   with the title), so the whole chrome sits 26 px lower. At the unshifted y the
   Design-tab click landed in the toolbar and the app stayed on the Home page,
   reported as "no sketch opened after plane click + Shift+S"; the unshifted
   Construction checkbox reported "0 construction axis". The three constants now
   derive from CHROME_DY. Canvas coordinates were never affected -- clickmm()
   computes them from live canvas geometry -- which is why dozens of geometric
   properties passed exactly on a GUI that had never been driven.
5. CON_BTN was stale for every index after 5, from the sketch epic's six new
   buttons. Fixed in both forks; see the companion commit on snaporca.

pdftocairo was also missing from the rig image (installed there, not a repo
change), without which every corpus sheet threw.

RESULT: offer-table, kernel, engine, corpus, corpus-scale and offer all hold.
The gesture ladder now reaches D2 and applies Equal length through the Constrain
toolbar, both sides landing at 99.928133658; it then fails re-entering the sketch
after commit, filed as snaporca-eoj1 with the evidence and the next measurement
to take. Kernel here is 7701 assertions / 270 cases.
This commit is contained in:
Tommaso Bianchi
2026-08-31 08:40:06 +02:00
parent ca8f813994
commit d0791c3b8a
3 changed files with 46 additions and 8 deletions
+6 -1
View File
@@ -16,7 +16,12 @@ import sys
HERE = os.path.dirname(os.path.abspath(__file__))
UX = os.path.dirname(HERE)
REPO = os.path.dirname(os.path.dirname(UX))
# One dirname more than you would expect: this generator lives at docs/CAD/ux/mockups/,
# not docs/ux/mockups/, since the design docs moved into the CAD subfolder (bbd1989e1e).
# With the old count REPO resolved to docs/, so OUT pointed at docs/src/.../DesignOffer.hpp,
# which does not exist -- and --check then diffed the real generated table against an empty
# file and reported the whole 189-line header as a difference.
REPO = os.path.dirname(os.path.dirname(os.path.dirname(UX)))
ATLAS = os.path.join(UX, "tool_atlas.json")
OUT = os.path.join(REPO, "src", "slic3r", "GUI", "CAD", "DesignOffer.hpp")
+29 -5
View File
@@ -209,7 +209,19 @@ def leave_sketch():
TREE_ROW0 = (300, 215)
DESIGN_TAB = (128, 29)
# EVERY absolute chrome coordinate below is written in the Snapmaker fork's layout and then
# shifted by CHROME_DY, because this fork keeps mainline OrcaSlicer's top row (File / save /
# undo / redo / Calibration, with the document title) which that fork does not have. The whole
# chrome — tab strip, sketch toolbar, confirm button — sits 26 px lower here.
#
# Getting this wrong does not look like a coordinate problem. At the unshifted y the Design tab
# click landed in that toolbar, the app stayed on the Home page, and the first rung reported
# "no sketch opened after plane click + Shift+S"; the unshifted Construction checkbox reported
# "0 construction axis". Both name the wrong subsystem. Canvas coordinates are immune because
# clickmm() derives them from the live canvas geometry — only the chrome constants need this.
CHROME_DY = int(os.environ.get("SNAPORCA_CHROME_DY", "26"))
DESIGN_TAB = (128, 29 + CHROME_DY)
def go_design():
@@ -677,7 +689,7 @@ def corner_pair(ents):
die("no adjacent pair in what should be a rectangle")
CONSTRUCTION_CHECKBOX = (419, 75)
CONSTRUCTION_CHECKBOX = (419, 75 + CHROME_DY)
def draw_line(x0, y0, x1, y1, length, angle):
@@ -794,10 +806,22 @@ def rung_extend():
# has not constrained anything, it has only nudged it.
# Constrain-mode toolbar, measured off the rig at 1920x1080 (icon centres, 42 px apart).
CON_BTN_Y = 76
#
# THIS LIST MIRRORS THE cbtn() SEQUENCE IN DesignPanel.cpp AND HAS TO BE UPDATED WHEN A BUTTON
# IS INSERTED. Positions are computed by index, so inserting a button shifts every entry after
# it and the map silently points at the wrong icon -- a rung then applies some OTHER constraint
# and fails with a geometric message that says nothing about buttons.
#
# It has already happened once, undetected: equal_radius and collinear (after "equal"), sym_v
# and sym_h (after "symmetric") and dist_x and dist_y (after "fix") were added while this list
# still had 14 names. Everything from index 6 on was wrong in both forks. Nothing caught it
# because the ladder only ever clicks "perpendicular" (3) and "equal" (5), both of which sit
# before the first insertion. The next rung to use "tangent" would have clicked "collinear".
CON_BTN_Y = 76 + CHROME_DY
CON_BTN = {n: (449 + 42 * i, CON_BTN_Y) for i, n in enumerate(
["horizontal", "vertical", "parallel", "perpendicular", "coincident", "equal",
"concentric", "tangent", "midpoint", "symmetric", "angle", "radius", "diameter", "fix"])}
"equal_radius", "collinear", "concentric", "tangent", "midpoint", "symmetric",
"sym_v", "sym_h", "angle", "radius", "diameter", "fix", "dist_x", "dist_y"])}
def draw_rect_undimensioned():
@@ -826,7 +850,7 @@ def rung_dimension():
leave_sketch()
CONFIRM_BTN = (1751, 75)
CONFIRM_BTN = (1751, 75 + CHROME_DY)
def confirm_and_reopen():
+11 -2
View File
@@ -38,17 +38,26 @@ step() {
# SC2329: every call goes through step(), which invokes it via "$@", so shellcheck
# cannot see the callers below.
# shellcheck disable=SC2329
# This fork's rig runs Xvfb on :11, the other fork's on :10, and the check scripts default
# to ":10" when DISPLAY is unset -- which docker exec leaves unset. The rungs that drive the
# GUI therefore looked for a window on a display that does not exist here and reported
# "FATAL no app window on :10", which reads like a dead app rather than a wrong display.
RIG_DISPLAY="${RIG_DISPLAY:-:11}"
run_in_rig() { # copy the script in fresh, then run it there
docker cp "$1" "$C:/tmp/$(basename "$1")" >/dev/null || return 1
shift
docker exec "$C" python3 "$@"
docker exec -e DISPLAY="$RIG_DISPLAY" "$C" python3 "$@"
}
# FIRST, and it needs no rig: the offer table the menu is compiled from must be what the atlas
# says. The header calls itself GENERATED and had been hand-edited anyway — which cost four rows
# that existed only in the header, one row wired to the wrong action, and a count of 91 for a
# 92-row array, so the last verb was unreachable (snaporca-z8rs, snaporca-ziam).
step "offer table matches the atlas" python3 docs/ux/mockups/gen_offer_table.py --check
# docs/CAD/, not docs/: SoftFever moved the design docs into the CAD subfolder
# (bbd1989e1e) and this line kept the old path, so the rung failed on a missing file
# rather than on anything about the table. The other fork still has docs/ux/.
step "offer table matches the atlas" python3 docs/CAD/ux/mockups/gen_offer_table.py --check
step "kernel suite" scripts/CAD/run-kernel-tests.sh --vol "${KVOL:-snaporca_kerneltest}"