Files
FreeCADWasmDev/docs/current/PARTDESIGN_SHAFT_GEOMETRY_PROGRESS.md

5.7 KiB

Shaft geometry recovery and remaining analysis gaps

Date: 2026-09-17 (Asia/Shanghai) Requirements: PartDesign:desktop:PartDesign_WizardShaft and PartDesign_WizardShaftCallBack Overall status: incomplete; no requirement promoted to passed.

Functional Repairs

  • Geometry creation no longer depends on importing NumPy through SegmentFunction. NumPy is imported where TranslationFunction actually solves boundary conditions. Desktop equilibrium still requires a real numerical backend; no replacement NumPy module was introduced.
  • Fixed ShaftFeature.updateSegment calling Gui.SendMsgToActiveView unconditionally in a headless document. The desktop view update remains when Gui is available.
  • Both command paths now use a single WizardShaft.WebDocument workflow. The actual dispatch lives in PartDesignDesktopCommands.cpp; the unreachable duplicate shaft implementation in PartDesignRuntimeProbe.cpp was removed to prevent future fixes landing in dead code.
  • Geometry is constructed and edited using the existing desktop ShaftFeature sketch/revolution implementation. No cylinders are substituted for the model. Every successful mutation verifies one valid solid and analytic stepped/annular volume.
  • The native revolution stores segment parameters and a native link to its sketch. The editor reconstructs its small builder state from these document properties after undo, redo or FCStd restoration; global Python session dictionaries are no longer required.
  • Whole-document transactions preserve geometry/history on invalid input. A uniform bore is enforced because the desktop sketch supports one inner diameter; variable-bore requests are explicitly rejected instead of silently creating incorrect geometry.
  • Previously attempted FEM selections cannot silently succeed or proceed to an unavailable solver. Creation with Force/Fixed/Bearing/Pulley/Gear and the callback now return explicit implementation_required before mutation. Corresponding unsupported UI choices are disabled.
  • Mounted geometry controls now include read, undo/redo, native FCStd save/open, OPFS persistence and visible Three.js rendering. Model operation results explicitly state analysisComputed: false.

Core files: WizardShaft/WebDocument.py, ShaftFeature.py, SegmentFunction.py, PartDesignDesktopCommands.cpp, PartDesignRuntimeProbe.cpp, probe CMake dependency tracking, partdesign-shaft-facade.ts, partdesign-desktop-adapter.ts, and partdesign-shaft-task.tsx.

Executed Evidence

Command: python3 tools/run_business_acceptance.py --module PartDesign --ids PartDesign:desktop:PartDesign_WizardShaft PartDesign:desktop:PartDesign_WizardShaftCallBack --reuse

Latest result: 17 geometry/boundary scenario records and 1 callback rejection record completed; 13.265 seconds. No assertion errors remained. The helper deliberately returned not_implemented, so the runner correctly reported acceptance_incomplete, 0 passed and 2 remaining.

Formal incomplete report

Detailed cases and remaining boundaries

Checks exercise stepped and hollow shafts, actual sketch and revolution objects, analytic volume, stable object identity, dimension edits, native undo/redo followed by further editing, invalid dimensions, uniform-bore enforcement, foreign selection, isolation, unsupported constraints without mutation, cancel, FCStd reopen, and continued native/browser editing. Browser cases use mounted controls, actual OPFS bytes, reload/open and editing of restored segment values.

The previous complete-workflow test expected a Force constraint even though the runtime did not have the required native FEM/analysis implementation. That expectation was replaced with executable geometry evidence plus an explicit unresolved constraint boundary; it was not converted into a pass. Existing prior evidence is preserved.

One native kernel is shared across the selected IDs; it is terminated before the shared browser workflow. TypeScript checking, production Vite build, incremental PartDesign native build and whitespace checks passed. Existing native libraries were reused. No historically passed requirement suite was rerun.

Visual Inspection

Playwright measured nonblank canvas pixels, changed screenshots after rotation, and task overflow at 1440x900 and 390x844. Desktop and mobile images were visually inspected.

Next Work

  1. Integrate real native FEM constraint types and their callback semantics in this document-owning runtime. Do not use fake constraint properties or silently ignore requested forces.
  2. Provide the actual equilibrium/deflection numerical backend and graph results. NumPy is still required by the supplied analysis code; geometry-only success is not analysis evidence.
  3. Add insertion/removal of shaft segments after creation using the native sketch model and transactional recovery. Existing dimension editing is already functional.
  4. Define migration for older FCStd shafts that do not carry wizard segment metadata. This run certifies files produced by the implemented document workflow.

Do not repeat the old module-import failure or reintroduce an in-memory-only session. Continue from the active PartDesignDesktopCommands.cpp -> WizardShaft.WebDocument.execute route. The general 1508-requirement migration remains unfinished and historical validation stays deferred.

Handoff: service active/unfrozen with failure restart enabled. Cycle 9330 has a live child process (667999), new source-reading activity, and is wiring the four direct Split commands into the existing native document lifecycle.