| Changelog | Fixed
- 3DS files loaded tipped on their side when the exporter used Y-up instead of the 3ds-Max Z-up default. The loader had been hard-coded to rotate every 3DS model -90° around X (commit d8117a0, "fix: add coordinate system rotation corrections for Z-up formats"), which helped CAD-style Z-up files but silently broke Y-up exports — Cottage_FREE.3DS for example rendered with its long axis as the vertical. Dropped the unconditional rotation; 3DS files now pass through at their authored orientation. Most modern 3DS exporters (Blender, recent Maya) are already Y-up, and Z-up outliers can be fixed by orbiting or — if this becomes common — by a future user-facing orientation toggle. Other Z-up-rotating loaders (STL, PLY, 3MF, DAE) are unchanged because those formats have stronger Z-up conventions that are not affected by this fix. Reproduced and verified in the live Nextcloud container by downloading the user's 3DS via WebDAV, inspecting bbox dimensions with a new
scripts/inspect-3ds.mjs harness (raw X=1243, Y=675, Z=1465 — Y is the height), and hard-refreshing the viewer page.
- Standalone viewer: KTX2 loader threw on init with
Cannot read properties of undefined (reading 'isWebGPURenderer'), so models with Basis/KTX2-compressed textures silently fell back to placeholder textures. Root cause: the standalone ThreeViewer.vue never forwarded the live WebGLRenderer into the loading context, and Three.js r182's KTX2Loader.detectSupport(renderer) dereferences renderer.isWebGPURenderer before checking anything else. Fix: pass renderer: renderer.value in the context, plus a defensive guard in gltf.js that skips KTX2 entirely (with a warning) when no renderer is available instead of throwing. The modal viewer was unaffected — it already forwarded this.renderer. Live-E2E harness now also watches for KTX2/WebGPU console complaints so the regression can't sneak back in.
- Standalone viewer: glTF models with embedded
data: buffers failed to load under Nextcloud's Content Security Policy. The app CSP allowed data: for img-src but not connect-src, so GLTFLoader's fetch() of embedded base64 buffers (the default export shape of many gltf files) was blocked by the browser. ResponseBuilder::addCspHeaders now also adds data: to connect-src. Caught end-to-end by driving Playwright against the real dev container (scripts/live-e2e-check.mjs).
- Skip-to-viewer link wasn't in a usable tab position — it was rendered inside
<NcContent> → <NcAppContent>, which put it ~9 tabs deep behind Nextcloud's header, nav sidebar, and file list. Wrapped in <Teleport to="body"> so the anchor lives at the body level regardless of where Nextcloud's chrome wraps us. DOM-verified focusable in the live container; clicking it moves focus to #viewer-wrapper. The CHANGELOG entry below that claims "first tab stop" was aspirational — Nextcloud's own Skip to main content / Skip to navigation links always win the first two positions, which is correct behavior we can't (and shouldn't) override.
Added
- Four more CAD formats via OpenCascade — STEP, IGES, BREP, FCSTD (closes #97): All four formats come from the OCCT family of NURBS/B-Rep CAD files and share one WASM integration. Uses
occt-import-js (Viktor Kovacs's purpose-built emscripten port of OpenCascade's import + tessellation) — much smaller than vanilla opencascade.js (~7 MB WASM vs 10+) and with a JSON-based mesh output that's a clean fit for Three.js. Architecture: one shared src/loaders/occt-runtime.js exposes getOcct() (memoized module promise so the 7 MB WASM downloads once across all 4 loaders) and buildGroupFromOccResult() (walks the assembly hierarchy preserving node names, transforms are already baked into tessellated vertices so we don't reapply matrices). Each format gets a thin ~25-line loader: STEP (.step, .stp) → ReadStepFile, IGES (.iges, .igs) → ReadIgesFile, BREP (.brep, .brp) → ReadBrepFile, FCSTD (FreeCAD document) → unzip via fflate, filter for .brep entries, feed each to ReadBrepFile — per-body failures don't take out the whole document. The resulting bundle shape: four 1 KB loader chunks + one 725 KB shared occt-runtime-*.chunk.mjs + 7.3 MB WASM served separately from /apps/threedviewer/occt/. Main/app bundles unchanged (0 B trend). Not unit-tested because the whole pipeline needs live WASM + real CAD fixtures to exercise meaningfully; covered by the existing smoke suite pattern.
- Fifth new format — IFC (
.ifc) (#97): Industry Foundation Classes, the de-facto BIM interchange standard. Loader in src/loaders/types/ifc.js uses ThatOpen's web-ifc WASM (~5 MB, lazy-loaded on first .ifc open) and a hand-written Three.js bridge — web-ifc-three has been deprecated and its modern replacement (@thatopen/components) is a heavy framework we don't need just for file loading. Bridge logic: StreamAllMeshes walks the IFC element graph, each FlatMesh's PlacedGeometry entries yield tessellated vertex data in interleaved [px,py,pz,nx,ny,nz] layout which we deinterleave into separate position/normal attributes, then apply flatTransformation (column-major 4×4) and per-geometry color. Express IDs (expressID, geometryExpressID) are preserved on mesh.userData.ifc for future property-panel tooling. Memory is carefully managed — geometry.delete() in a finally block releases the WASM-side handle per mesh, and CloseModel runs unconditionally so parse errors don't leak the full IFC model. WASM copies ship via scripts/copy-decoders.mjs to /apps/threedviewer/web-ifc/ (both single-threaded web-ifc.wasm and multi-threaded web-ifc-mt.wasm — IfcAPI picks the variant based on runtime feature detection) so air-gapped Nextcloud deploys don't need CDN reachability. JS glue is lazy-chunked into a 3.4 MB ifc-*.chunk.mjs that only loads when a user opens a .ifc file; main/app bundle impact is minimal. Not unit-tested because the whole pipeline requires live WASM + real IFC fixtures; covered by the smoke spec suite instead.
- Fourth new format — dotbim (
.bim) (#97): JSON-based BIM format from dotbim.net — simple schema (meshes + elements with { mesh_id, vector, rotation, guid, type, color, info, face_colors? }). Loader in src/loaders/types/dotbim.js handles mesh instancing (multiple elements sharing a mesh_id each get their own cloned geometry), element transforms (translation vector + unit quaternion rotation), RGBA byte colors, optional per-face colors (v1.1.0 schema — unindexes geometry so each triangle's 3 verts carry the face color), and tolerates legacy exporter quirks (missing/null rotation, mismatched face_colors length). Element metadata (guid, type, info) is stashed on mesh.userData.dotbim for future inspection tooling. 10 Jest specs in tests/unit/loaders/dotbim-parser.test.js cover instancing, transforms, color handling, transparency, legacy-rotation fallback, orphan elements, metadata, and JSON/schema validation error paths. Zero WASM, zero external deps, ~180 lines. Like the other new loaders it's lazy-chunked via the registry's dynamic imports — 0 B impact on the main/app bundles.
- Three new 3D formats — OFF, AMF, 3DM (closes #97 partially): (1)
.off (Geomview Object File Format) — hand-rolled plain-text parser in src/loaders/types/off.js covering OFF, COFF (per-vertex colors, float or 0–255 int), N-gon fan triangulation, inline # comments, and binary-OFF rejection. 9-test Jest suite exercises the parse path end-to-end (tetrahedron, n-gon, comments, COFF float/int colors, degenerate inputs). (2) .amf (Additive Manufacturing Format) — wraps three.js's bundled AMFLoader, handles both XML and ZIP-compressed variants. (3) .3dm (Rhinoceros) — wraps Rhino3dmLoader, loads rhino3dm.js + rhino3dm.wasm (~4 MB) on first use from the app's bundled copy at /apps/threedviewer/rhino3dm/ so air-gapped Nextcloud deployments don't need CDN reachability. scripts/copy-decoders.mjs now copies the rhino3dm assets alongside DRACO/Basis. All three formats are registered across the 5 sync points (lib/Constants/SupportedFormats.php, src/config/viewer-config.js, src/loaders/registry.js, src/main.js::SUPPORTED_MIMES, appinfo/mimetypemapping.json); npm run format:check PASS. Each loader is lazy-chunked via the registry's dynamic imports, so the main/app bundle size is unchanged (only users who open the new format pay the download cost). The 6 remaining formats from #97 (step, iges, brep, fcstd, ifc, bim) all require OpenCascade.js or web-ifc WASM (~5–10 MB each) and are deferred until demand justifies the bundle hit.
- Forced-colors (Windows High Contrast) CSS hardening: New central override sheet (
src/css/forced-colors.css, imported from main.js) scoped entirely to @media (forced-colors: active) — no effect on default rendering. Addresses three patterns the a11y audit found: (1) custom badges (.stats-badge, .fps-badge, .active-badge, .last-used-badge) that rely on background-color + text-color alone collapsed into the surrounding surface once the UA repainted both with system colors; they now get a 1px CanvasText border so they stay visible. (2) .filter-format-chip.active lost its visual distinction from the inactive state because both backgrounds became Canvas; the active variant now uses Highlight / HighlightText with forced-color-adjust: none so selection state survives. (3) Focus states that suppressed outline and relied on box-shadow or colored border-color (.export-select:focus, .annotation-text-input:focus, .skip-to-viewer:focus) had no visible focus indicator; they now re-enable a 2px Highlight outline. Verified by a new Playwright spec (tests/playwright/a11y-forced-colors.spec.ts, 5 tests) that loads the real CSS file into static fixtures mirroring each component shape and asserts border/outline width > 0 under emulateMedia({ forcedColors: 'active' }). Caveat: Playwright's forced-colors emulation uses a neutral palette — this closes the keyboard/CSS correctness gap but an interactive Windows HC walkthrough is still the final source of truth for theme-specific contrast issues.
- i18n parity tooling (
scripts/check-i18n.mjs): Walks src/ (.vue/.js/.ts) and lib/ (.php) and extracts every t('threedviewer', 'string'), this.t(...), and ->t(...) call via regex. Diffs the extracted set against l10n/en.json: ERROR on source strings missing from en.json, WARN on orphan keys no source uses, per-locale coverage summary that reports missing, passthrough (value === key), and orphan counts. --sync-en auto-adds missing keys (value = key); --prune removes orphans. Wired as npm run i18n:check / npm run i18n:sync; i18n:check is now part of the validate chain. First sync closed 329 missing keys and pruned 87 orphans in en.json — ar/de/es coverage now reports accurately at ~27% (previously looked higher only because en.json itself was incomplete).
- Export pipeline unit tests + MIME consistency fix: Nine Jest specs in
tests/unit/composables/useExport.test.js cover getGeometryStats (indexed, non-indexed, multi-mesh groups, non-geometry descendants) and exportAsSTL/exportAsOBJ/exportAsGLB (correct MIME — model/stl, model/obj, model/gltf-binary — correct byte length, null-object guards, and a multi-material OBJ scene that passes through the exporter with its material array and geometry groups intact instead of being flattened). Three.js exporters are mocked so the test runs deterministically in jsdom without pulling in Three's ESM-only subpath imports; the real exporter output remains covered by the Playwright smoke suite. Shipped alongside a MIME consistency fix in SlicerModal.vue — the slicer-export fallback path was still using application/octet-stream for STL and text/plain for OBJ even though the main Export Model path had been updated to model/stl / model/obj; both paths now agree.
- Loader smoke-test coverage for cancel/retry/network-drop: Two new Playwright specs in
tests/smoke/viewer.spec.ts use page.route() to deterministically simulate (a) a user cancelling a hanging load and then retrying — the second fetch is fulfilled with a fixture and the viewer reaches __LOAD_COMPLETE, and (b) a network failure (route.abort('failed')) that must surface via __LOAD_ERROR without being misclassified as a user abort. ThreeViewer grew two tiny test hooks (window.__LOAD_COMPLETE on successful model-loaded, window.__LOAD_ERROR on non-abort errors) to give tests a DOM-independent signal — production code is unchanged in behavior.
- Accessibility follow-ups: Keyboard users now get a "Skip to 3D viewer" link as the first tab stop (visually hidden until focused, slides into view on focus) that jumps focus past the navigation directly to
#viewer-wrapper. Both modals (SlicerModal, HelpPanel) now trap Tab/Shift+Tab inside the dialog while open and restore focus to the element that opened them on close — implemented via a dependency-free useFocusTrap composable. Modals also gained aria-modal="true" and tabindex="-1" on the dialog surface. Covered by a new Jest unit suite (tests/unit/composables/useFocusTrap.test.js) and a Playwright a11y spec (tests/playwright/a11y-skip-link.spec.ts) that verifies skip-link behavior under forced-colors: active (Windows High Contrast).
- Transform Gizmo: Translate, rotate, and scale models interactively with Three.js TransformControls. Mode selector (Move/Rotate/Scale) and reset button in the Analyze section. Disables orbit controls while dragging.
- Animation clip selector: Dropdown in the Animation panel to switch between individual animation clips (e.g., Run, Walk, Idle) for models with multiple animations
- Texture optimization pipeline: Quality presets (Original/High/Medium/Low) with Canvas 2D downscaling, memory tracking, and configurable setting in Personal Settings
- X3D parser: Full XML-based parser replacing placeholder cube — supports IndexedFaceSet geometry, materials, textures, transforms, and DEF/USE references
- Volume & surface area measurement: Model statistics panel now shows actual mesh surface area (sum of triangle areas) and mesh volume (signed tetrahedra method, accurate for watertight meshes), in addition to bounding box volume
- Custom color palette editor: Personal Settings → SlideOutToolPanel now exposes four user-overridable scene/chrome colors on top of the base light/dark theme: background, grid, toolbar bg, and toolbar text. Each has a native
<input type="color"> picker plus a per-key "×" clear button; a single "Reset all palette colors" button clears everything at once. Overrides persist to localStorage['threedviewer:customPalette'] and are merged on top of whichever base theme (auto/light/dark) is active, so switching themes leaves your palette alone. The viewer rebuilds its THREE.GridHelper in place when gridColor changes and swaps scene.background when background changes — no reload required.
- Decoder worker pool tuning (parallel decoding):
GLTFLoader's DRACO and KTX2 sub-loaders now call setWorkerLimit(n) with n = min(hardwareConcurrency - 1, 4) (floor 2), so GLB textures and compressed meshes decode in parallel across multiple Web Workers instead of serializing on one. Defensive feature-detection — falls through when the Three.js version doesn't expose setWorkerLimit. Result: GLBs with multiple KTX2 textures load noticeably faster on 4+ core machines without starving the main thread or flooding it with workers on 1-core devices.
- Memory pressure auto-step-down: The performance composable now samples
performance.memory.usedJSHeapSize each frame and, when usage crosses 85 % of the configured maxMemoryUsage cap (default 500 MB), auto-switches to the Low performance mode — reducing pixel ratio, disabling shadows, and applying LOD. A one-time warning toast ("Auto-reduced quality — memory pressure") surfaces what happened; the flag clears once memory drops back below 70 % so the user can re-raise quality manually. 5-second cooldown prevents thrashing, and the check gracefully skips browsers without the non-standard performance.memory API (Firefox, Safari).
- Background indexing status API + progress bar: New
GET /api/files/index-status endpoint backed by ICacheFactory::createDistributed returns { active, processed, total, percent, startedAt, updatedAt } for the authenticated user. FileIndexService.reindexUser now pre-counts supported files (respecting .no3d and hidden-folder skip rules), then bumps the processed counter after each file. The Personal Settings "Re-index now" button starts a 750 ms poll in parallel with the blocking POST request and renders a live NcProgressBar ("142 / 284 (50 %)"), falling back to "Scanning…" until the pre-scan completes. Status TTL is 1 hour.
- Adaptive texture streaming (visibility-aware queue):
useProgressiveTextures now accepts a (camera, scene) streaming context and sorts its pending queue by frustum visibility before each batch — textures on meshes currently in view load first, off-screen ones are deferred. When the camera moves, the very next batch picks up the new viewpoint. queueTexture has a new optional mesh argument for visibility scoring; the signature stays backward-compatible, so existing callers are unaffected. ThreeViewer auto-registers the context on init so future loader pipelines that opt into progressive loading get adaptive scheduling for free.
- Measurement suite upgrades: The Statistics panel's measurement section is now a full measurement tool:
- Unit picker: Choose mm / cm / m / in / ft / generic units from a dropdown; bounding box, surface area, and volume values re-render instantly with the right suffix (
mm, mm², mm³, etc.). Defaults to the project's configured VIEWER_CONFIG.measurement.defaultUnit so it matches the existing ruler tool.
- Per-mesh breakdown: When a model has more than one mesh, a scrollable list shows each mesh's surface area and volume in the selected unit. Clicking a row focuses the panel on that mesh — the Width/Height/Depth/Area/Volume rows switch to its numbers and a "Focused:
mesh name" header with a Show-all link appears. Helper meshes (transform-gizmo pickers, annotation markers) are excluded.
- Pick mesh in viewport: A one-shot button arms a raycasting click handler on the canvas; the next click on a mesh focuses it in the stats panel. Works with any mesh in the loaded model, respects visibility, and skips gizmo helpers.
- Watertightness badge: The section header flags each mesh as Watertight (all edges shared by exactly two triangles — volume is reliable), Not watertight (open or non-manifold edges detected — volume should be treated as approximate), or Unknown (non-indexed geometry, or >500k triangles so we skip the edge-map check for performance). Aggregated badge appears at the top of the section; per-mesh flags appear next to each row in the breakdown.
- Copy measurements: A button copies a plain-text report of the current values (bounding box, surface area, mesh volume, bbox volume, watertight status, per-mesh table) to the clipboard in the selected unit. Uses
navigator.clipboard.writeText on secure contexts with the textarea + execCommand fallback for legacy browsers. Success/error toast via the existing push-toast channel.
- WebXR / VR mode: Enter immersive VR via the 🥽 button in the top bar (only shown when the browser advertises
immersive-vr support). Animation loop swaps to renderer.setAnimationLoop during XR sessions, and FPS throttling is bypassed since the headset enforces its own cadence. Testable without a headset using the Chrome WebXR API Emulator extension.
- Annotation JSON export/import: Save annotations as a versioned JSON document and re-import them later. The schema includes
format, version, exportedAt, modelFilename, and an annotations array of { id, point, text, timestamp }. Import/Export buttons appear in the Annotations overlay when annotation mode is active.
- Scene comparison diff overlay: When two models are loaded side-by-side via Comparison mode, a "Scene Diff" panel auto-appears showing original vs. comparison stats (vertex count, face count, mesh count, bounding box X/Y/Z, diagonal length) with color-coded deltas (green = increase, red = decrease). Helper meshes (transform gizmo pickers, axes/grid helpers) are excluded from stats so the diff reflects only the loaded geometry. The overlay is dismissable via × and re-openable from a "Diff" button in the comparison controls.
- Annotations persistence (per-file backend save): Annotations now save automatically to your Nextcloud account, keyed by file ID, so they reappear next time you open the same model. Backed by a new
AnnotationsService that stores one JSON document per (user, file) under app data (appdata_*/threedviewer/annotations/{userId}/{fileId}.json), with GET/PUT/DELETE routes at /api/annotations/{fileId} validating that you have access to the underlying file before reading or writing. Saves are debounced 600 ms after each change; clearing all annotations issues a DELETE so the backend doc is removed instead of storing an empty list. A small status pill ("Loading… / Saving… / Saved / Save failed") in the annotation overlay header surfaces sync state. 256 KB cap per document.
- Shareable view link: New "Copy View Link" button in the View section copies a URL that encodes the current camera viewpoint (position, target, zoom) as a compact
cam=px,py,pz,tx,ty,tz,z query parameter. Opening the link reloads the model and restores the exact same angle after auto-fit runs, so you can send collaborators a link and say "check out this corner of the model" without needing a live session. Toast feedback on copy success/failure; button disabled until a model is loaded. Works on any secure context (HTTPS or localhost) via navigator.clipboard, with an offscreen-textarea + execCommand fallback for legacy environments. No backend — pure URL round-trip.
- Clipping box (6-plane section analysis): The existing Cross-Section tool now has a Plane / Box mode switch. Plane mode is unchanged (single cross-section plane with axis + position slider). Box mode enables six axis-aligned clipping planes, one per face of the model's bounding box, each with an independent 0–1 offset slider that moves that face inward toward the opposite side. Setting
xMin=0.35 and zMax=0.35, for example, slices the leftmost 35% off along X and the nearest 35% off along Z, leaving the intersection slab visible with interior surfaces rendered via DoubleSide. A "Reset box" button returns all six offsets to 0. Plane and box state are kept independently so toggling between modes is non-destructive, and box offsets auto-remap when a new model is loaded.
- File browser search & filters: New filter toolbar in the file browser. At the Folders/Types/Dates overview level the search box runs a global recursive search that walks every folder, type, and date bucket and surfaces matching files as a flat results grid (each card showing its full path) — so searching
wolf from the Folders root finds Wolf-Blender-2.82a.glb two folders deep without manual drilling. Inside leaf views (drilled into a folder, type, or month) the search filters both subfolder cards and file cards together, and unlocks two extra controls: multi-select format chips (one per extension actually present in the current view) and a size bucket dropdown (Any / < 1 MB / 1–10 MB / > 10 MB). Filters compose with AND between categories and OR within format chips, and a "Clear filters" button appears as soon as any filter is active. Filters auto-reset when navigating between folders/types/dates so a stale query never makes the next view look empty.
Fixed
- FBX taillight/lens transparency: FBX post-processing was force-overriding every material to
opacity = 1.0; transparent = false, which made authored translucent lens shells (taillights, headlights, glass) opaque and hid the coloured mesh inside — the Mercedes GLS rear lights rendered as a solid grey slab with the red only visible if the camera was pushed inside the body. Now preserves the FBX-authored opacity: materials with 0 < opacity < 1 are left transparent with depthWrite = false so inner meshes show through; only materials with opacity <= 0 (which would render invisible) are still forced opaque.
- Stats panel — File size on multi-file loads: File Size showed "0.00 MB" for formats that come with sidecar assets (OBJ+MTL, FBX with textures, GLTF+BIN). The stats panel was reading
modelLoading.progress.value.total, but multi-file loaders report progress as a percentage (max 100) rather than bytes, so the resulting "100 B → 0.00 MB" rounded to zero. Now reads the actual byte count from modelSourceFiles.value[].size (matching main filename first, else first file), with the progress-total value only used as a fallback when it looks like real byte counts (> 1 KB).
- Stats panel — Texture memory accounting: Textures section reported "Memory: 0.00 MB" while textures were still loading, because the loaded-image check used a 512×512 fallback that happened to resolve before decode — making tiny placeholders look real. Now distinguishes three states: loaded (dimensions ≥ 4×4 contribute to memory), pending (flagged separately so the UI can show "loading…"), and missing (1×1 placeholder or HTML
img with empty src / zero naturalWidth). ThreeViewer polls analyzeModel once a second for up to 8 seconds after load when any texture is pending, so async decodes get picked up without the user needing to reopen the panel.
- FBX dark rendering without textures: When an FBX referenced textures (e.g.
texture.png) that weren't shipped alongside the model, the loader substituted a 1×1 base64 placeholder into mat.map. final = color × placeholder then multiplied every surface down toward near-black, producing a silhouette-dark render where the Mercedes GLS looked like a blob. The loader now detects its own placeholder (1×1 image size) and nulls out mat.map; a new "clay mode" kicks in when zero textures resolved from dependencies, brightening near-greyscale dark material colours to a pleasant 0.75 clay-grey while hue-preserving the brightening on coloured materials (green license plate, red brake lights) so they still read as coloured instead of washing out to clay.
- ZIP export — main file path: The main model file is now packed under its basename (e.g.
eyeball.obj) instead of its full Nextcloud path (e.g. /3D files/Eyeball/eyeball.obj). The leading slash is invalid in ZIP archives and broke extraction on some platforms.
- ZIP export — preserved subdirectory layout: Textures discovered in subdirectories (e.g.
textures/) are now packed under their original relative paths in the ZIP instead of being flattened to the root, so the unzipped folder mirrors the original Nextcloud layout and re-imports cleanly.
- Comparison mode loading 400 error:
loadComparisonModelFromPath was passing the { id, subdir } object returned by getFileIdByPath directly into URL templates, producing [object Object] and a 400 from the file API. Now destructures id before use. (Latent regression from the earlier getFileIdByPath return-shape change.)
Fixed
- Animation playback: Previously all animation clips played simultaneously, causing blended/static poses. Now only one clip plays at a time
- Animation timeline seek: Slider scrubber now correctly updates the model pose when dragged (replaced
mixer.setTime() with action.time + mixer.update(0))
- Animation loop toggle: Toggling Loop off and back on no longer leaves the animation stuck; finished LoopOnce actions properly restart
- FBX rendering: Fixed dark/black eyeball — upgraded Lambert to Phong materials, added SRGBColorSpace, normalized scale, detected transparent shells
- PLY loader: Preserved original vertex normals from file instead of always recomputing them
|