pcbjam/wasm/stubs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Viktor Vaczi db9d6ee04b feat(wasm): occ-split — lazy occ_service worker; kicad_editor drops OCC (−31%)
Move OpenCASCADE out of the merged editor image into occ_service: a separate
emscripten module (-sASYNCIFY=0, MODULARIZE, in-container -Oz finalize, 2N+8
pre-warmed pthread pool) booted lazily in a dedicated Web Worker on the first
STEP export or STEP/IGES model parse. kicad_editor.wasm ~190 MB -> 130 MB;
sessions that never touch OCC never fetch its 57 MB. STEP export works in the
browser for the first time: the unchanged desktop dialog runs EXPORTER_STEP,
whose wasm shadow suspends into globalThis.occService and the export bytes go
straight to a browser download (never entering the editor heap). STEP/IGES 3D
models parse in the worker via the oce shadow (S3D WriteCache/ReadCache wire).

- wasm/occ-service/: service CMake target (hooked from the kicad fork's
  top-level CMakeLists, wasm/editor pattern), embind entry
  (occExport/occLoadModel), wxConfig pre-js.
- wasm/stubs/{exporter_step,oce_plugin}_stub.cpp: EM_ASYNC_JS worker bridges
  (callee-shadowing; no caller #ifdefs).
- web/standalone: provider installed whenever the kicad_editor bundle boots
  (cross-face safe); ONE shared worker-boot source occ-worker.js (vite ?raw;
  the e2e stub reads the same file) — blob worker with locateFile absolutized
  against the glue URL; export download-name guard.
- deps: OCC builds with RapidJSON so its glTF/GLB writer exists — pinned to
  the vcpkg master snapshot 2025-02-26 (24b5e7a8b27f), the same code official
  KiCad consumes via vcpkg.json's opencascade[rapidjson]; rapidjson's latest
  tag (v1.1.0, 2016) is ill-formed under modern clang.
- tests: occ-export dialog e2e (lazy-fetch boundary + STEP download bytes),
  occ-probe incl. a 9-format matrix (step/stpz/brep/xao/ply/stl/glb/u3d/pdf),
  3d-viewer-models hard-asserts the worker parse; occ provider stub installed
  ambiently by the kicad fixtures.

Validated against desktop kicad-cli 10.0.4: geometric exact equality (bbox
delta 0 um, volume delta 0.0000%) for STEP/GLB/STL/BREP/STPZ across three
boards and option sweeps — with desktop OCC 7.9 vs wasm OCC 7.8; PLY/XAO/PDF
structurally equal; U3D same-size (quantizer float LSBs differ). Full kicad
e2e green on Firefox and Chromium; standalone verified end to end (lazy fetch
only on the Export click; export.step 60,628 B ISO-10303-21; loadModel 700 KB
STEP -> 569 KB scenegraph cache).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 12:39:58 +02:00
..
GL Add missing GLU_TESS_BOUNDARY_ONLY constant for idftools 2026-01-03 11:24:24 +01:00
ngspice feat(schematic): eeschema WASM build + e2e harness 2026-05-29 16:01:17 +02:00
nng Enable 3D viewer in KiCad WASM build 2025-12-21 14:21:29 +01:00
3d_canvas_stub.cpp feat(wasm): Disable 3D viewer with comprehensive stubs 2026-01-10 15:15:50 +01:00
3d_scenegraph_stub.cpp feat(wasm): Disable 3D viewer with comprehensive stubs 2026-01-10 15:15:50 +01:00
3d_viewer_stub.cpp feat(wasm): Disable 3D viewer with comprehensive stubs 2026-01-10 15:15:50 +01:00
api_plugin_stub.cpp wasm-port-rebase: KiCad 10.0.4 rebase + WASM build adaptations 2026-06-24 10:30:25 +02:00
char_traits_uint16_workaround.h feat(schematic): eeschema WASM build + e2e harness 2026-05-29 16:01:17 +02:00
curl_stub.c Enable 3D viewer in KiCad WASM build 2025-12-21 14:21:29 +01:00
eeschema_frame_stub.cpp feat(schematic): eeschema WASM build + e2e harness 2026-05-29 16:01:17 +02:00
eeschema_ngspice_data_stubs.cpp feat(schematic): eeschema WASM build + e2e harness 2026-05-29 16:01:17 +02:00
exporter_step_stub.cpp feat(wasm): occ-split — lazy occ_service worker; kicad_editor drops OCC (−31%) 2026-07-03 12:39:58 +02:00
gl_ffp_stub.c feat: enable WASM 3D viewer build — FFP link stubs, drop glemu shim 2026-06-19 09:21:37 +02:00
libgit2_stub.c fix(wasm): KiCad 10 kiplatform/libgit2 stubs, e2e fixtures, asyncify -g hook 2026-06-24 10:30:25 +02:00
model_substitution_stub.cpp fix(wasm): add MODEL_SUBSTITUTION no-op stub for 3D-disabled pcbnew/footprint build 2026-06-26 08:14:47 +02:00
nl_gerbview_plugin_stub.cpp feat: gerbview WASM port 2026-06-03 14:23:57 +02:00
nl_pcbnew_plugin_stub.cpp Fix KiCad WASM build and runtime errors 2025-12-22 16:30:53 +01:00
nl_pl_editor_plugin_stub.cpp feat: pl_editor WASM port + browser file dialog fixes 2026-06-01 10:30:56 +02:00
nng_stub.c Enable 3D viewer in KiCad WASM build 2025-12-21 14:21:29 +01:00
oce_plugin_stub.cpp feat(wasm): occ-split — lazy occ_service worker; kicad_editor drops OCC (−31%) 2026-07-03 12:39:58 +02:00
pcb_frame_stub.cpp Fix KiCad WASM build and runtime errors 2025-12-22 16:30:53 +01:00
pcbnew_scripting_stub.cpp Enable 3D viewer in KiCad WASM build 2025-12-21 14:21:29 +01:00
python_manager_stub.cpp Fix KiCad WASM build and runtime errors 2025-12-22 16:30:53 +01:00
scripting_stub.cpp Fix KiCad WASM build and runtime errors 2025-12-22 16:30:53 +01:00
wasm-emscripten-finalize-stub.sh Fix KiCad WASM build and runtime errors 2025-12-22 16:30:53 +01:00
wasm-opt-stub.sh Fix Asyncify and improve build process 2025-12-14 11:59:50 +01:00