Files
FreeCADWasmDev/docs/current/web-camera-host-20260913.md
wangdequan 9a7c4f0335 Save FreeCAD Web workspace sources and user validation evidence
IFC native binding remains incomplete; preserve accurate test results.
2026-09-15 22:01:58 +08:00

5.2 KiB

Web Camera Host Delivery

Implemented and frontend-built: 16 display commands. User validation is deferred. This does not declare all Web functions or the FreeCAD migration complete.

Implementation

  • Nine standard orientations reuse the supplied src/Gui/Camera.cpp quaternions.
  • Zoom uses NavigationStyle.cpp's exponential step with desktop default 0.2.
  • Left/right rotation follows View3DPy.cpp's quarter turn about viewing direction.
  • Fit All uses only visible rendered document objects, including ancestor visibility, to frame the display camera. It excludes lights and axes helpers.
  • Store/Recall Working View retains camera/target/clipping state by document in the mounted host. Missing saved state is an explicit error, not dummy success.
  • Changing camera orientation rebuilds OrbitControls through its public API: cached up-axis coordinates and pending damping cannot overwrite the command. Renderer listeners and owners are updated; old input listeners are disposed.
  • Existing ImportRenderBridge and OpenScadDesktopView share the implementation. Viewport orientation menu and icon commands operate on that host's document; the existing desktop command dispatcher also invokes the same handler.
  • Catalog, route discovery and implementation packets include the actual helper. Missing host still fails; no Web stateful fixture or native marker fallback.

Three.js only manipulates display state and returned meshes. No geometry/model algorithm was added; existing OCCT/FreeCAD WASM artifacts were not recompiled.

Recorded Build Costs

Step Seconds
Initial capability route generation 8.508
Implementation packet preparation 0.664
Formal pipeline: module registry 0.104
Formal pipeline: capability registry after final UI edits 8.423
Formal pipeline: frontend build 1.633
Incremental public asset sync, inside frontend build 0.056
Formal pipeline: deferred business metadata 0.935
Formal pipeline total 11.095

Receipt: web-camera-host-pipeline.json. Sixteen routed records, frontend build exit 0. The registry reported 1208/1451 routed, 243 still requiring implementation at publication. This is source/route status, not business acceptance or parity. No tests, acceptance, browser checks or performance benchmarks were run.

Remaining Scope

Projection switching, selection fitting, other view hosts and full desktop camera preferences are not claimed here. Stored working views last for the mounted host; OpenScadDesktopView currently remounts on document/selection updates. This is not FCStd/OPFS persistence of camera presets. View-oriented commands do not unify the live documents owned by separate native workers.

Unattended Read Bottleneck

The observed 20-cycle window contained 12 budget-exceeded cycles. Source reading itself used 1.744 seconds, while post-read model gaps used 681.824 seconds (32.2%). One previous BIM turn explicitly exited because the source-read cap prevented inspecting already located native behavior. These measurements do not establish that all model gaps are caused by the cap.

Added read_implementation_source.py: exact current-packet source/support/native anchor files only, four supplemental windows per turn, at most 100 lines and 12000 bytes per window. File locking enforces the shared allowance; repeated unchanged windows return a reuse notice. No broad search or build/test bypass. Raw and compact prompts both describe the tool. The scheduler accounts this as source/anchor, separate from ordinary search limits, retaining command/time caps. Blocked rg/fast_source_search now return exit 64 with the recovery command, instead of success without searching. The file-modification rule no longer forbids reading an actually changed or missing patch anchor through this tool.

The default stalled-module cooldown was reduced from 600 to 180 seconds. A module still moves aside after repeated no-progress turns and remains recorded as deferred, but the planner can retry it three times sooner. An explicit FREECAD_MODULE_RETRY_SECONDS environment value still overrides this default.

This fixes a concrete context-access dead end. Overall unattended throughput recovery still requires observed subsequent cycles, not a live-process claim.

Deployment: scheduler v25 was drained and restarted by the existing watchdog, PID 3292765, cycle 8157. That real implementation cycle used source/anchor to read WebViewCommands.h after the ordinary cap. It also exposed an incomplete packet allowlist: pending Web view commands lacked the existing Part view facade and mounted UI files. Packet preparation now includes both document owners and the existing view transport for pending Web/Std commands as well as implemented ones. Build routing still requires actual implemented command catalog membership. The refreshed packet includes NativeDocumentView.h, part-view-facade.ts and web-view-task.tsx. No arbitrary-path reading was enabled.

That cycle reported five visibility handlers edited, with browser wiring and eleven other selected commands still incomplete. This is not an additional completed-delivery claim. Independently, the live global registry later reported 1212/1451 routed and 239 implementation-required; other scheduler work is not credited to the sixteen-camera-command batch.