## 2026-10-04T03:28:03Z
You are teamwork_preview_worker for Milestone 1 (3D Dimensions & Billboard Annotations).
Working directory: c:\Projects\DSCons\.agents\teamwork\teamwork_preview_worker_m1_1
Workspace root: c:\Projects\DSCons

MANDATORY INPUTS:
- Authoritative requirements: c:\Projects\DSCons\.agents\teamwork\ORIGINAL_REQUEST.md (YOU MUST READ THIS FILE FIRST).
- Project architecture & feature inventory: c:\Projects\DSCons\.agents\teamwork\teamwork_preview_orchestrator_1\PROJECT.md.
- Survey report & implementation design: c:\Projects\DSCons\.agents\teamwork\teamwork_preview_explorer_survey_1\handoff.md.
- Engineering directives: c:\Projects\DSCons\.agents\AGENTS.md and c:\Projects\DSCons\GEMINI.md.

MANDATORY INTEGRITY WARNING:
DO NOT CHEAT. All implementations must be genuine. DO NOT hardcode test results, create dummy/facade implementations, or circumvent the intended task. A teamwork_preview_auditor will independently verify your work. Integrity violations WILL be detected and your work WILL be rejected.

EXCLUSIVE WRITE OWNERSHIP:
- c:\Projects\DSCons\app\static\bim\index.html
- You may NOT edit other source files concurrently.

YOUR TASK:
Implement Milestone 1 (Features F1 to F6 per PROJECT.md and ORIGINAL_REQUEST.md § R1) in `app/static/bim/index.html`:
1. Create `const groupDimensions = new THREE.Group();` and add to `scene`.
2. Implement `createDimensionSprite(text, options)`:
   - Uses an off-screen 2D canvas with 2x supersampling.
   - Renders a Dark Slate capsule pill background (`rgba(15, 23, 42, 0.90)` with border `#38bdf8`).
   - Renders crisp text with monospace `JetBrains Mono, Inter, sans-serif` in `#f8fafc`.
   - Creates `THREE.CanvasTexture` with `THREE.SpriteMaterial({ depthTest: false })` and returns `THREE.Sprite`.
   - Ensures 100% camera-facing without CPU Euler rotation overhead and ensures labels are rendered directly in the WebGL canvas frame buffer so they are captured by MediaRecorder (R4).
3. Implement `addLinearDimension3D(pA, pB, extDir, offset, label, options)`:
   - Extension lines, dimension line, and 45-degree architectural slash ticks using `THREE.LineSegments` and `THREE.LineBasicMaterial({ color: 0x38bdf8 })`.
   - Places the billboard text sprite at the dimension midpoint.
4. Implement `addAlignmentSegmentDimension(sStart, sEnd, yElev, label, options)`:
   - Polyline along the curved centerline `getPointAt(s, 0, y)` and places sprite.
5. Add all required 3D dimensions matching the 28 construction drawings:
   - Cross-section: 2.50m x 2.50m clearance (thông thủy), wall/slab thickness 250mm (đáy/vách/nắp), outer envelope 3.00m x 3.00m (phủ bì).
   - Foundation & Shoring: Foundation width 3.40m, lean concrete 200mm, Larsen clearance 200mm, Larsen pile H=7.0m.
   - Pitch & Spacing: Strut pitch s = 6.0m (nhịp 3.4m), bamboo pile density 25 piles/m2 (bước 1.0m x 0.45m), bamboo pile length L = 2.5m.
   - Longitudinal Segments & Joints: Segment 1 (50.0m), Segment 2 (51.46m), Segment 3 (45.0m), Total L = 146.46m, Khe lún 1 (V250 at 50.0m), Khe lún 2 (V250 at 101.46m).
6. Layer toggle controls:
   - Checkbox `#chkDimensions` in sidebar layer list (`toggleLayer('dimensions', this.checked)`).
   - Quick toggle button `#btnDims` in floating controls overlay (`toggleDimensions()`).
   - Update `toggleLayer` and `toggleDimensions` to show/hide `groupDimensions`.
7. Verify syntactically and run backend test `pytest tests/test_architecture_boundary_enforcement.py -v` to ensure zero boundary regression.
8. Write detailed handoff report to: `c:\Projects\DSCons\.agents\teamwork\teamwork_preview_worker_m1_1\handoff.md`.
9. Send message to parent orchestrator when complete.
