Files
FreeCADWasmDev/docs/current/partdesign-face-color-checkpoint.md

4.5 KiB

PartDesign Face Color Checkpoint

Batch: de77f3ddfce7ac18ee397374 Selected record: PartDesign:desktop:Part_ColorPerFace Date: 2026-09-17

Implemented

  • web/src/partdesign-desktop-adapter.ts routes the selected command through the existing PartDesign document Worker. It validates a single current-document feature, task state, face names and finite RGB channels; read and cancel use snapshot without mutation.
  • PartDesignDocumentWorkflow.cpp implements setFaceColors, validates native face indices before opening a transaction, and stores per-face appearance in a native dynamic App::PropertyColorList named WebFaceColors. Native transaction history and FCStd serialization own the property.
  • Snapshot returns per-face RGBA values and OCCT face-by-face tessellation with corresponding RGB vertex colors. Color edits preserve native feature geometry and Body tip.
  • partdesign-document-facade.ts accepts the new action. It also now admits the already implemented setPrimitive action, whose missing allowlist entry caused fixture requests to receive no Worker response.
  • partdesign-face-color-task.tsx is mounted in workbench-shell.tsx for the selected command. It provides a native shape selector, face checkboxes and swatches, Apply/Cancel, and an interactive Three.js preview of the native response.
  • tools/partdesign-face-color-business-cases.mjs is called by the existing PartDesign business case entry point. The selected ID was added to declared executable coverage, not manually marked as passing.

Verification

Focused build succeeded:

cmake --build freecad-source/build-web/configure --target FreeCADWebPartDesignRuntimeProbe -j2

Synced only the rebuilt FreeCADWebPartDesignRuntimeProbe.js and .wasm from the configured build's bin into web/public/kernel.

Acceptance command:

python3 tools/run_business_acceptance.py --module PartDesign --ids PartDesign:desktop:Part_ColorPerFace

Latest attributable report: docs/current/business-evidence/e2df27820c28d37ba3a38e1b-20260917T093437311438.json. Runner result: passed 1, remaining 0, exit code 0, 6.34 seconds.

Native cases assert selected/untouched face colors, per-vertex color mapping, analytic box volume, bounds, feature identity, Body tip, returned selection, rejection without document/history mutation, cancellation, undo/redo, FCStd persistence and editing after reopen. Browser cases execute the mounted desktop command, assert returned face swatches, count rendered red pixels, exercise orbit interaction, and check task overflow at 1440x1000 and 390x844.

Screenshots were inspected: docs/current/partdesign-face-color-browser/1440.png and 390.png. Their hashes are retained by the case evidence. Scoped git diff --check succeeded; many pre-existing application files are untracked in this workspace, so this does not replace compilation or runtime checks.

Existing development server remains available at http://localhost:5180/workbench.html?module=PartDesign&command=Part_ColorPerFace.

Retained Boundaries

  • Appearance is stored in the headless document's WebFaceColors property. Mapping to desktop GUI ViewObject material/DiffuseColor storage and reading desktop GUI appearance from arbitrary imported FCStd files are not established by these cases.
  • Face colors currently follow indexed native faces. Snapshot guards changed face counts, but persistent topological-name remapping after upstream topology changes is not implemented or asserted.
  • This task edits RGB colors. Per-face transparency, picking faces directly in the preview, and matching desktop task preview/rollback behavior are not implemented.
  • Native persistence and history are tested; this batch does not assert browser OPFS save/reload or browser undo/redo controls for face appearance.
  • Existing gear/sprocket numpy failures belong to a different batch and remain unresolved. No IFC source, semantic contract, verifier, proof requirements, acceptance machinery, or passing ledger statuses were manually modified. No full-parity/API gate, deployment, push, or external message was performed.

Continuation

The selected executable business case is accepted by the unchanged runner. Preserve its evidence and the remaining boundaries above when scheduling subsequent work. Avoid repeating the unchanged passing batch. If broader desktop appearance parity is selected, first obtain bounded source anchors for native GUI face material storage and topological color propagation, then extend native/browser assertions before claiming that additional behavior.