# Web FreeCAD BitBybit

FreeCAD-aligned web CAD frontend baseline for the BitBybit runtime boundary.

本机断网开发、资源同步、校验和恢复入口见 [离线资源库说明](docs/offline-development.zh-CN.md)。

## Current scope

- React + Vite frontend shell
- Three.js `0.185.1` is pinned for the internal Viewport Adapter; React does not import Three.js directly.
- FreeCAD-style application menus, workbench navigation, Combo View, Task Dock, viewport and Report view
- Machine-readable workbench and command manifest in `src/freecadManifest.ts`
- Current status, source-of-truth order and focused execution queue in [docs/current-work.zh-CN.md](docs/current-work.zh-CN.md)
- Re-audited completion status, critical path and smallest executable milestones in [docs/freecad-web-execution-master-plan.zh-CN.md](docs/freecad-web-execution-master-plan.zh-CN.md)
- Chinese implementation plan in `docs/web-cad-implementation-plan.zh-CN.md`
- Full 34-module FreeCAD 1.1.1 scope, Bitbybit/OCCT source-build track and executable task ledger in [docs/freecad-complete-parity-backlog.zh-CN.md](docs/freecad-complete-parity-backlog.zh-CN.md)
- Executable reference-oracle and R0-R9 delivery order in [docs/freecad-reference-execution-roadmap.zh-CN.md](docs/freecad-reference-execution-roadmap.zh-CN.md)
- Detailed owner lanes, 83-task WBS, dependencies and gates in [docs/freecad-full-parity-execution-wbs.zh-CN.md](docs/freecad-full-parity-execution-wbs.zh-CN.md)
- Reproducible 34-module source inventory in [config/freecad-source-inventory.json](config/freecad-source-inventory.json), generated and checked with `./npmw run generate:freecad-inventory` and `./npmw run check:freecad-inventory`
- Source-traceable TypeId/property candidate inventory in [config/freecad-type-property-inventory.json](config/freecad-type-property-inventory.json), checked with `./npmw run check:freecad-type-properties`
- Locked FreeCAD 1.1.1 planegcs WASM subset with Dedicated Worker verification for line/circle/curve constraints, SnellsLaw, Ellipse InternalAlignment helpers and clamped cubic B-spline Weight

The compatible browser baseline now spans all 34 locked FreeCAD modules, but it is not a system-level exact implementation: the release matrix currently records `0 exact`, `26 compatible`, `5 proxy` and `3 development` modules. The active milestone is exact-parity promotion for the FreeCAD 1.1.1 oracle, topology naming, document/property semantics, core modeling and FCStd round-trip. See the [current work focus](docs/current-work.zh-CN.md); completed P01-P10 compatibility programs must not be interpreted as an exact FreeCAD claim.

## Development

```bash
./npmw install
./npmw run dev
```

The repository uses a project-local, checksum-verified Node.js `22.23.2` runtime and npm `10.9.8`. The wrapper restores it from the local resource library first, or downloads it when online, into the ignored `.runtime/` directory and never changes `/usr/bin/node`; this removes the engine warning caused by running npm with an older system Node. `./nodew` runs the same pinned Node directly. See [docs/project-runtime.zh-CN.md](docs/project-runtime.zh-CN.md) for recovery and CI rules.

Build verification:

```bash
./npmw run verify
```

The locked FreeCAD `1.1.1` source build and desktop-oracle replay workflow is documented in [docs/freecad-baseline-and-golden.zh-CN.md](docs/freecad-baseline-and-golden.zh-CN.md). All project Node commands in that workflow use `./npmw`.

Geometry work follows a Bitbybit-first policy. Existing Bitbybit OCCT Worker, modeling, IO, triangulation and cache APIs are reused first; missing capabilities may be built from locked Bitbybit/OCCT sources as an Emscripten WASM provider behind the Facade. Source commits, patches, ABI, SBOM, hashes and FreeCAD differential fixtures are required before a capability can be promoted.

The SQLite OPFS worker requires cross-origin isolation headers. Vite dev and preview apply `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp`; deployments must preserve them.
