import { describe, expect, it } from 'vitest'; import * as THREE from 'three'; import { buildPier } from '../src/core/geometry'; import { buildRebar3D } from '../src/view/rebar3d'; import { loadP1 } from './helpers'; const rb = buildRebar3D(buildPier(loadP1())); describe('3D 철근 모델 (③)', () => { it('every 철근표 family has bars, named as in the table', () => { for (const n of ['C1', 'C4', 'C7', 'C9', 'C10', 'C11', 'C12', 'C13', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'B1', 'B4', 'B5', 'B6', 'B7', 'B8', 'S1', 'S2']) { expect(rb.byName.get(n)?.length ?? 0, n).toBeGreaterThan(0); } }); it('P1 has one bar per 원주 등분 (46) and P2 likewise', () => { expect(rb.byName.get('P1')!.length).toBe(46); expect(rb.byName.get('P2')!.length).toBe(46); }); it('highlight dims the other bars and keeps the chosen one', () => { rb.highlight('P3'); const p3 = (rb.byName.get('P3')![0].material as THREE.MeshStandardMaterial).opacity; const c1 = (rb.byName.get('C1')![0].material as THREE.MeshStandardMaterial).opacity; expect(p3).toBe(1); expect(c1).toBeLessThan(1); rb.highlight(null); expect((rb.byName.get('C1')![0].material as THREE.MeshStandardMaterial).opacity).toBe(1); }); });