forked from 1b-agent/opencadstudio-upstream
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>
This commit is contained in:
1 parent
f14ef54528
commit
273f482aee
8 files changed
+68
-73
No files matched your search
+11
-11
@@ -10,7 +10,7 @@ browser can't provide. This page lists the differences.
|
||||
| Area | Native (desktop) | Web (wasm) |
|
||||
|------|------------------|------------|
|
||||
| Windowing | Multi-window (`iced::daemon`) | Single window (`iced::application`); dialogs are in-canvas modals |
|
||||
| 3D solid modeling | Yes | **No** — `solid3d` feature off |
|
||||
| 3D solid modeling | Yes | Yes — the geometry kernel is pure Rust |
|
||||
| Hatch rendering | Yes | **No** — WebGL2 has no vertex-stage storage |
|
||||
| Fonts | Embedded stroke fonts + system TrueType + shaping + fallback | Embedded stroke fonts only |
|
||||
| File open | Native file dialog → path | Browser picker → bytes |
|
||||
@@ -22,15 +22,16 @@ browser can't provide. This page lists the differences.
|
||||
|
||||
## Details
|
||||
|
||||
### 3D solid modeling — web: disabled
|
||||
The `solid3d` Cargo feature (default on) gates `truck-meshalgo` and
|
||||
`truck-shapeops`, which pull `vtkio → xz2 → lzma-sys`, a C library that can't
|
||||
cross-compile to `wasm32`. The web build compiles with `--no-default-features`,
|
||||
so on the web:
|
||||
- The Model tab's solid primitives and boolean operations are no-ops.
|
||||
- Solid tessellation and ACIS (SAT) import produce no geometry.
|
||||
### 3D solid modeling — web: the same as native
|
||||
It used to be off. The modelling kernel was truck, whose mesh and boolean
|
||||
crates reach `vtkio → xz2 → lzma-sys` — a C library that cannot cross-compile
|
||||
to `wasm32` — so the web build dropped a `solid3d` feature and the Model tab,
|
||||
solid tessellation and ACIS import all did nothing there.
|
||||
|
||||
2-D CAD is unaffected.
|
||||
The kernel is now cadkernel, which is pure Rust and has no C dependency at
|
||||
all, so none of that applies and the feature is gone. The web build makes
|
||||
primitives, runs booleans, draws ACIS solids read from a file and writes them
|
||||
back out as exact geometry, exactly as the desktop build does.
|
||||
|
||||
### Hatch rendering — web: not drawn
|
||||
The batched hatch pipeline binds a read-only storage buffer in the vertex
|
||||
@@ -97,8 +98,7 @@ folder and load again on the next desktop launch.
|
||||
## Build & deploy
|
||||
|
||||
- Native: `cargo build --release --bin OpenCADStudio`.
|
||||
- Web: `trunk build --release --public-url /OpenCADStudio/` (the rust `<link>`
|
||||
in `index.html` sets `data-cargo-no-default-features`, dropping `solid3d`).
|
||||
- Web: `trunk build --release --public-url /OpenCADStudio/`.
|
||||
`.github/workflows/pages.yml` builds and deploys to GitHub Pages on every
|
||||
release. No COOP/COEP headers are needed because the web build is
|
||||
single-threaded.
|
||||
Reference in new issue
Block a user