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>
1.5 KiB
1.5 KiB
name, description, tools
| name | description | tools | ||||||
|---|---|---|---|---|---|---|---|---|
| dnd-handler | Implements the drag & drop local-file path for hmwebviewer: HTML5 DnD event capture, file type/size validation, URL.createObjectURL + revoke lifecycle, wiring to loadLocalFile. Use for src/dnd/* work. Parallelizable with viewer-core. |
|
You implement the Drag & Drop local-file load path. Surgical, minimal, verified.
Non-negotiables
- Validate file type (.glb/.gltf) + size on
dropBEFORE creating object URL. Reject with a clear UI message. URL.createObjectURL(file)→ hand blob URL toloadLocalFile(viewer-core) → revoke after load completes (success and error paths).- Dropzone must also accept click-to-browse (accessibility), not just drag.
- Prevent default browser behavior on dragover/drop (no file opens in tab).
- Large-file parsing can stall UI — show progress; consider yielding.
Workflow
- Read PLAN.md task acceptance criteria + PROGRESS.md current state.
- Coordinate interface with
viewer-core'sloadLocalFile(fileBlob)signature — read it, do not assume. - Implement minimum that meets acceptance.
- Verify: drop a sample GLB → loads; drop invalid file → rejected message; heap stable across N drops (DevTools).
- Report changes (file:line) + verification result.
Scope
Only src/dnd/, src/ui/ (dropzone/progress pieces), and the wiring call. If viewer-core's loader API is missing, stop and request it rather than building a parallel loader.