Files
FreeCADWasmDev/docs/current/reverseengineering-create-recovery.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

1.8 KiB

ReverseEngineering create/recompute recovery

Batch: 412be33d86b5291b70f03ddd

The reported first failure is ambiguous: the create facade caught exceptions from both fc_web_dispatch_json and JSON.parse and replaced either with Invalid native JSON. The facade now reports native execution exceptions separately, preserving their stack/message, and includes a bounded response prefix for actual JSON parse failures. This changes error reporting only.

The existing native dispatcher in freecad-source/src/WebAssembly/FreeCADCoreProbe/ReverseEngineeringRuntimeProbe.cpp continues to call Reen.approxCurve(points).toShape(), retain named FreeCAD documents and objects, and use transactions and native recompute. No geometry or success results were substituted.

The next outer-pipeline diagnostic exposed a native exception (20711592) on the first create request. Local desktop source freecad-source/src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp, Module::getPoints, constructs a Py::Tuple for each sample. The JSON bridge creates Python lists, which were passed directly to that binding. The create handler now converts each validated XYZ list to a tuple before calling the same native approxCurve implementation, matching the existing native examples. Coordinates, fitting defaults, geometry validation and document transactions are preserved.

Remaining boundary: this source-level input-contract repair needs an incremental build of FreeCADWebReverseEngineeringRuntimeProbe and real WASM verification by the outer pipeline. Reuse tools/reverseengineering-business-cases.mjs for the first four-point create, updates, scale/translation invariants, document retention and invalid-input recovery. No acceptance or failure-closure status has been written. Browser document synchronization and surface fitting remain outside this contract.