2026-06-16 13:16:35 +03:00
|
|
|
# Trunk config for the web (wasm) build of Open CAD Studio (issue #45).
|
|
|
|
|
#
|
|
|
|
|
# Build: trunk build --release
|
|
|
|
|
# Dev: trunk serve
|
|
|
|
|
#
|
|
|
|
|
# Requires: rustup target add wasm32-unknown-unknown
|
|
|
|
|
# cargo install trunk wasm-bindgen-cli
|
|
|
|
|
|
|
|
|
|
[build]
|
|
|
|
|
target = "index.html"
|
refactor: retire the solid3d feature — the web build gets solids too
The feature existed for one reason: truck's mesh and boolean crates reach
`vtkio → xz2 → lzma-sys`, a C library that cannot cross-compile to wasm32. So
the web build dropped it, and with it the Model tab, solid tessellation and
ACIS import — all of which quietly did nothing in the browser.
cadkernel is pure Rust and has no C dependency, so none of that holds any
more. The feature gated exactly two things by the end, `acis_export` and the
save-path sync that calls it, and both are as portable as everything around
them. Removing it means the web build makes primitives, runs booleans, draws
ACIS solids read from a file, and writes them back out as exact geometry — the
same as the desktop build.
Verified against all three: native, `--no-default-features`, and an actual
`wasm32-unknown-unknown` check rather than an assumption about one.
The docs claimed otherwise in four places and are corrected. `tessellation.md`
in particular was organised around whether an entity "goes through truck",
which is no longer a question anything can be asked — the three paths are now
a kernel B-rep mesh, a curve sampled through `entities::curve`, or geometry
emitted directly, and the per-entity table is updated to match.
`index.html` no longer passes `data-cargo-no-default-features`; there are no
features left to turn off.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 01:28:25 +03:00
|
|
|
# The crate has no Cargo features: the geometry kernel is pure Rust and
|
|
|
|
|
# cross-compiles to wasm, so the web build gets the same solid modelling the
|
|
|
|
|
# native one does.
|
2026-06-16 13:16:35 +03:00
|
|
|
|
2026-07-25 18:49:18 +03:00
|
|
|
[[hooks]]
|
2026-07-25 21:34:29 +03:00
|
|
|
stage = "post_build"
|
2026-07-25 18:49:18 +03:00
|
|
|
command = "sh"
|
|
|
|
|
command_arguments = ["scripts/build-web-worker.sh"]
|
|
|
|
|
|
2026-06-16 13:16:35 +03:00
|
|
|
[serve]
|
|
|
|
|
# Cross-origin isolation headers enable SharedArrayBuffer, which wasm threads
|
|
|
|
|
# (rayon) need. GitHub Pages cannot set these; a self-hosted server (e.g. the
|
|
|
|
|
# Open-AEC host) can. Without them the app still runs single-threaded.
|
|
|
|
|
headers = { "Cross-Origin-Opener-Policy" = "same-origin", "Cross-Origin-Embedder-Policy" = "require-corp" }
|