feat: multi-format 3D viewer with large-file OBJ streaming, Z-up, projection/outline UI

Three.js viewer supporting glb/gltf/obj/fbx/dae/ifc/ply via both server (SSR)
and drag&drop (CSR) paths.

- Streaming OBJ parser (src/viewer/objStream.ts) for files past the V8 max
  string length (>~1GB text) that OBJLoader can't handle; indexed geometry,
  per-vertex color from MTL Kd, float64 recenter baked in.
- In-viewer float64 recenter (objRecenter.ts) for huge CAD/survey coordinates
  (~1e8) so float32 vertex buffers keep precision (no cracked faces).
- Z-up right-handed world; Y-up formats rotated on load.
- OBJ+MTL+texture drag&drop (LoadingManager URL-modifier maps dropped images).
- OrbitControls ground-plane panning (road/rail alignment workflow).
- UI: Zoom Fit, perspective/orthographic toggle, feature-edge outline.
- DoubleSide for CAD OBJ; PLY mesh + point-cloud support.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-19 13:54:46 +09:00
co-authored by Claude Opus 4.8
commit a71790070d
78 changed files with 15921 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
---
name: hydration
description: >
Implements the SSR→CSR hydration layer for hmwebviewer: WebP placeholder element,
CSS opacity transition, executeHydration() coordination (fade only after WebGL ready
AND model loaded), and UI state toggling. Depends on viewer-core. Use for src/viewer/hydration* and SSR placeholder work.
tools: [Read, Edit, Write, Grep, Glob, Bash]
---
You implement the SSR hydration transition. Coordinate carefully — this is where races bite.
## Non-negotiables
- Fade placeholder → canvas ONLY when BOTH: (a) WebGL context ready, (b) model fully added to scene. Use Promise.all or two flags gating one transition.
- Transition: CSS `opacity 0.5s ease`, placeholder `opacity: 0` then `display: none` after 500ms. Mirror spec.
- No empty-canvas flash. If model not ready, placeholder stays visible.
- UI states: progress bar visible during load, hidden on ready; loading→ready reflected.
- Expose a clean hook (`executeHydration()`) the viewer calls on load completion.
## Workflow
1. Read PLAN.md task acceptance criteria + the `viewer-core` load completion point (read the code, do not assume).
2. Implement placeholder element + transition + coordination.
3. Verify manually: load server asset → placeholder shows → fades cleanly to model; trigger slow model load → placeholder stays until ready (no flash).
4. Report changes (file:line) + verification result.
## Scope
Placeholder/transition/coordination code. Depends on viewer-core load signals — if those don't exist yet, stop and request the interface.