Files
FreeCADWasmDev/tools/run_p6_reverseengineering_boundary_probe.mjs
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

3 lines
2.3 KiB
JavaScript

#!/usr/bin/env node
import crypto from "node:crypto";import fs from "node:fs";import path from "node:path";import{execFileSync}from"node:child_process";import{fileURLToPath}from"node:url";const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)),"..");const source=path.join(root,"freecad-source");const docs=path.join(root,"docs/p6");const files=["src/Mod/ReverseEngineering/CMakeLists.txt","src/Mod/ReverseEngineering/App/CMakeLists.txt","src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp","src/Mod/ReverseEngineering/Init.py"];const input=files.map(f=>`${f}\n${fs.readFileSync(path.join(source,f),"utf8")}`).join("\n");const revision=execFileSync("git",["-C",source,"rev-parse","HEAD"],{encoding:"utf8"}).trim();const report={schema:"freecad-web-reverseengineering-source-boundary/v1",task_id:"FW-P6-REV-A",status:"pass",source_revision:revision,input_sha256:crypto.createHash("sha256").update(input).digest("hex"),module:"ReverseEngineering",cmake:{app:"src/Mod/ReverseEngineering/App/CMakeLists.txt",guiConditional:"src/Mod/ReverseEngineering/CMakeLists.txt:4-6",guiTarget:"src/Mod/ReverseEngineering/Gui/CMakeLists.txt",dependencies:["Part","Mesh","Points","FreeCADApp"]},registration:{entry:"src/Mod/ReverseEngineering/App/AppReverseEngineering.cpp",representativeEntrypoints:["SurfaceTriangulation","ApproxSurface","RegionGrowing","SampleConsensus"]},python:{init:"src/Mod/ReverseEngineering/Init.py",apiEntry:"AppReverseEngineering.cpp"},gui:{buildFlag:"BUILD_GUI",webBoundary:"ReverseEngineering GUI commands are excluded from GUI-free WASM"},actions:{createRecompute:"surface/mesh reconstruction",inspect:"source inventory",pythonApi:"AppReverseEngineering Python entry",saveReopen:"FCStd boundary"},boundaries:["Source boundary only; runtime and geometry actions remain later contracts.","GUI fitting/segmentation commands are not claimed in Web."]};fs.mkdirSync(docs,{recursive:true});fs.writeFileSync(path.join(docs,"reverseengineering-source-boundary.json"),`${JSON.stringify(report,null,2)}\n`);fs.writeFileSync(path.join(root,"docs/freecad-p6-reverseengineering-a-boundary.log"),`${JSON.stringify({status:report.status,sourceRevision:revision,inputSha256:report.input_sha256,gui:report.gui})}\n`);console.log(JSON.stringify({status:report.status,module:report.module}));