2026-06-16 13:16:35 +03:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<title>Open CAD Studio</title>
|
2026-06-17 04:50:28 +03:00
|
|
|
<link data-trunk rel="icon" href="assets/logo.svg" />
|
2026-06-16 13:16:35 +03:00
|
|
|
<style>
|
|
|
|
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #1e1e1e; }
|
|
|
|
|
canvas { display: block; }
|
2026-06-17 01:55:28 +03:00
|
|
|
|
|
|
|
|
/* Splash shown while the wasm bundle downloads and initializes. Removed
|
|
|
|
|
once the app's canvas appears (see the observer script below). */
|
|
|
|
|
#loading {
|
|
|
|
|
position: fixed;
|
|
|
|
|
inset: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
gap: 22px;
|
|
|
|
|
background: #1e1e1e;
|
|
|
|
|
color: #cfcfcf;
|
|
|
|
|
font-family: system-ui, sans-serif;
|
|
|
|
|
z-index: 9999;
|
|
|
|
|
transition: opacity 0.4s ease;
|
|
|
|
|
}
|
|
|
|
|
#loading.hide { opacity: 0; pointer-events: none; }
|
|
|
|
|
#loading .title { font-size: 22px; font-weight: 600; letter-spacing: 0.5px; }
|
|
|
|
|
#loading .title span { color: #3399e6; }
|
|
|
|
|
#loading .sub { font-size: 12px; color: #777; }
|
|
|
|
|
#loading .spinner {
|
|
|
|
|
width: 46px;
|
|
|
|
|
height: 46px;
|
|
|
|
|
border: 4px solid #2e2e2e;
|
|
|
|
|
border-top-color: #3399e6;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
animation: ocs-spin 0.9s linear infinite;
|
|
|
|
|
}
|
|
|
|
|
@keyframes ocs-spin { to { transform: rotate(360deg); } }
|
2026-06-16 13:16:35 +03:00
|
|
|
</style>
|
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
|
|
|
<!-- Trunk builds the wasm32 binary. The crate has no Cargo features:
|
|
|
|
|
the geometry kernel is pure Rust, so the web build gets the same
|
|
|
|
|
solid modelling the native one does. See issue #45. -->
|
|
|
|
|
<link data-trunk rel="rust" data-bin="OpenCADStudio" />
|
feat(web): lazy per-script font loading for international CAD text
The web build has no system-font access, so CAD text in non-Latin scripts
(Cyrillic, Greek, CJK, …) rendered as nothing — build_fallback was a hard
None on wasm (#141). Instead, ship per-script Noto subsets under web/fonts
(one alphabet per file, SIL OFL 1.1) and fetch them lazily over HTTP the
first time a drawing uses that script, then outline glyphs with ttf-parser.
- web_font: Script enum + script_of (char → script font), a per-script
store with lazy fetch, and a pending queue drained by the app loop.
- CJK is split by language (chinese/japanese/korean). Han ideographs share
code points but differ by language, so the shared block is routed by the
document's $DWGCODEPAGE (932→JP, 949→KR, GB/936→CN); kana is always
Japanese, Hangul always Korean. Re-tessellates when the language changes.
- build_fallback (wasm) outlines from the fetched subset; clear_fallback_cache
lets glyphs that missed while a font was in flight reappear on load.
- PollWebFonts subscription (web only) + WebFontLoaded message drive fetches.
- Trunk copy-dir serves web/fonts; nothing is bundled into the native binary
(desktop keeps using system fonts).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 16:13:26 +03:00
|
|
|
<!-- Per-script Noto subsets, fetched lazily at runtime (one alphabet per
|
|
|
|
|
file) so CAD text renders non-Latin scripts on the web. (#141) -->
|
|
|
|
|
<link data-trunk rel="copy-dir" href="web/fonts" />
|
2026-07-25 18:49:18 +03:00
|
|
|
<link data-trunk rel="copy-file" href="web/ocs-parse-worker.js" />
|
2026-07-28 11:49:45 +03:00
|
|
|
<link data-trunk rel="copy-file" href="web/discussions.json" />
|
2026-07-29 00:41:51 +03:00
|
|
|
<link data-trunk rel="copy-file" href="web/videos.json" />
|
2026-06-16 13:16:35 +03:00
|
|
|
</head>
|
2026-06-17 01:55:28 +03:00
|
|
|
<body>
|
|
|
|
|
<div id="loading">
|
|
|
|
|
<div class="spinner"></div>
|
|
|
|
|
<div class="title">Open <span>CAD</span> Studio</div>
|
|
|
|
|
<div class="sub">Loading…</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
// The app mounts a <canvas> into <body> when it's ready. Watch for it and
|
|
|
|
|
// fade the splash out.
|
|
|
|
|
(function () {
|
|
|
|
|
const splash = document.getElementById("loading");
|
|
|
|
|
const done = () => {
|
|
|
|
|
if (!splash) return;
|
|
|
|
|
splash.classList.add("hide");
|
|
|
|
|
setTimeout(() => splash.remove(), 450);
|
|
|
|
|
};
|
|
|
|
|
if (document.querySelector("canvas")) return done();
|
|
|
|
|
const obs = new MutationObserver(() => {
|
|
|
|
|
if (document.querySelector("canvas")) {
|
|
|
|
|
obs.disconnect();
|
|
|
|
|
done();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
obs.observe(document.body, { childList: true, subtree: true });
|
|
|
|
|
})();
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
2026-06-16 13:16:35 +03:00
|
|
|
</html>
|