3D viewer: switch STEP engine to occt-wasm (OCCT V8, module worker); fix mobile rendering (Uint16 chunking, index wrapping, tight near/far); state-coloured box + debug line; app widget parity; licenses/docs
This commit is contained in:
@@ -46,12 +46,12 @@ no external dependencies (except `highlight.js`, vendored in `lib/`).
|
||||
- **Widget rendering** for Mermaid, Excalidraw (canvas) and MindElixir (mind map) notes, with a
|
||||
collapsible, highlighted "Source" block and copy button.
|
||||
- **3D models**: `.step` / `.stp` / `.stl` files (as file notes, as inline attachments, or linked
|
||||
from text notes) render in an interactive three.js viewer (STEP via occt-import-js, OpenCascade
|
||||
WASM, parsed in a **Web Worker** so the page stays responsive). The viewer is **full-bleed**
|
||||
(~`100vw`) with a viewport-based height, drag to rotate / scroll to zoom, rounded 8px box, a
|
||||
loading progress bar and a caption that always shows `name · size · triangle count`.
|
||||
STEP tessellation is dense (≈0.1–1 M+ triangles for assemblies). See
|
||||
[docs/embed-3d-model.md](docs/embed-3d-model.md).
|
||||
from text notes) render in an interactive three.js viewer (STEP via **occt-wasm**, OpenCASCADE
|
||||
V8, parsed in a non-blocking **module worker**). The viewer is **full-bleed** (~`100vw`) with a
|
||||
viewport-based height, drag to rotate / scroll to zoom, rounded 8px box, a loading progress bar,
|
||||
a caption showing `name · size · triangle count`, and a small debug line. Large meshes are
|
||||
split into `Uint16` chunks so mobile GPUs render them too (≈480k triangles for the demo
|
||||
battery module). See [docs/embed-3d-model.md](docs/embed-3d-model.md).
|
||||
- **3D viewer inside Trilium (app widget)**: the same viewer runs in the Trilium app itself
|
||||
(independent of the blog) via a `note-detail-pane` widget – see `app/`.
|
||||
- Code highlighting (highlight.js + line numbers) and copy buttons on all code boxes.
|
||||
@@ -69,7 +69,7 @@ no external dependencies (except `highlight.js`, vendored in `lib/`).
|
||||
| `theme/favicon.svg` | default site favicon | code (SVG) |
|
||||
| `theme/cookie.woff2` | "Cookie" font for the Buy me a coffee button | file, `font/woff2` |
|
||||
| `lib/highlight.js` | vendored highlight.js | code, `application/javascript` |
|
||||
| `lib/3d/*` | three.js + OrbitControls + STLLoader + occt-import-js (WASM) for the 3D viewer | code / file |
|
||||
| `lib/3d/*` | three.js + OrbitControls + STLLoader + occt-wasm (OCCT V8 bundle + WASM) for the 3D viewer | code / file |
|
||||
| `lib/hljs_line_numbers.js` | highlight.js line-numbers plugin | code |
|
||||
| `scripts/*.js` | frontend share snippets (content is pasted **verbatim** into a code note, including the `<script>`/`<style>` wrapper) | code |
|
||||
| `app/3d-model-viewer-app.jsx` | JSX widget that renders the 3D viewer for model file notes inside the Trilium app (label `#widget=3dModelViewer`) | code, `text/jsx` |
|
||||
|
||||
Reference in New Issue
Block a user