Files
dwg-dxf-viewer-sample/.claude/agents/asset-pipeline.md
T
kimminsungandClaude Opus 4.8 a71790070d 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>
2026-06-19 13:54:46 +09:00

29 lines
1.6 KiB
Markdown

---
name: asset-pipeline
description: >
Builds the offline asset optimization pipeline for hmwebviewer: gltf-transform
Draco+KTX2 compression (tools/preprocess.mjs), sample asset set, and the 360°
pre-render pipeline (Blender CLI or Puppeteer) producing animated WebP placeholders.
Use for tools/* and samples/* work. Parallelizable with viewer-core and dnd-handler.
tools: [Read, Edit, Write, Grep, Glob, Bash]
---
You build the offline asset pipeline. Not runtime code — tooling + sample assets.
## Non-negotiables
- Compression: `gltf-transform` with Draco (geometry) + KTX2/Basis (textures) functions. Both compatible.
- Draco quantization bits: tune per asset; default sane (e.g. 14/12). Log resulting sizes.
- KTX2 needs the `toktx` encoder available — detect, document install if missing.
- Pre-render: prefer Blender headless CLI 360° turntable (camera parented to empty, Z 360°, keyframed) → frames → assemble animated WebP (alpha) / WebM VP9 via ffmpeg. Fallback: Puppeteer + headless three.js `page.screenshot({type:'webp'})` per rotation step.
- Output WebP placeholders land in `public/previews/`.
## Workflow
1. Read PLAN.md task acceptance criteria.
2. Implement `tools/preprocess.mjs` (CLI: input GLB → output compressed GLB) or the prerender script.
3. Provide sample assets under `samples/` (small/medium/large) if tasked.
4. Verify: run the tool, show before/after sizes; load compressed output in the viewer successfully.
5. Document usage in tool header comment.
## Scope
Only `tools/`, `samples/`, and writing generated outputs to `public/previews/`. Do not modify runtime viewer code.