fix: [bim] 샤프트-브래킷-모터 연결 구조 수정

- 샤프트 길이를 브래킷 중심간 거리로 계산 (고정 비율 제거)
- 모터를 브래킷 내측에 밀착 배치
- 폭 변경 시에도 분리되지 않는 구조로 개선
This commit is contained in:
김보곤
2026-03-13 09:53:33 +09:00
parent 9daf416862
commit bf04ba5f4a

View File

@@ -413,20 +413,22 @@ class GeneratorScene {
const edgeMesh = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0x94a3b8 }));
edgeMesh.position.set(0, boxY, 0); this.objectGroup.add(edgeMesh);
// ── 샤프트 (셔터박스 내부 원통) ──
this.addCylinder(SD / 2, W1 * 0.85, [0, boxY, 0], COLORS.shaft, 'x');
// ── 브래킷 (좌우) ──
const bkW = 0.08, bkX = W1 / 2 - bkW / 2;
// ── 브래킷 (좌우 베어링 지지판) ──
const bkW = 0.08;
const bkX = W1 / 2 - bkW / 2;
this.addBox(bkW, BH * 0.7, BD * 0.5, [bkX, boxY, 0], COLORS.bracket);
this.addBox(bkW, BH * 0.7, BD * 0.5, [-bkX, boxY, 0], COLORS.bracket);
// ── 모터 (원통, 모터 측) ──
// ── 샤프트 (양쪽 브래킷을 관통 — 브래킷 중심간 거리) ──
const shaftLen = W1 - bkW;
this.addCylinder(SD / 2, shaftLen, [0, boxY, 0], COLORS.shaft, 'x');
// ── 모터 (모터측 브래킷 내측에 밀착 배치) ──
const motorDir = params.motorSide === 'right' ? 1 : -1;
const motorR = SD * 0.45;
const motorLen = motorR * 3;
const motorX = motorDir * (W1 / 2 - 0.12);
this.addCylinder(motorR, motorLen, [motorX, boxY, -BD * 0.2], COLORS.motor, 'x');
const motorR = Math.min(SD * 0.55, BH * 0.28);
const motorLen = Math.min(W1 * 0.12, 0.25);
const motorX = motorDir * (bkX - bkW / 2 - motorLen / 2 - 0.01);
this.addCylinder(motorR, motorLen, [motorX, boxY, 0], COLORS.motor, 'x');
// ── 가이드레일 (C-채널, ExtrudeGeometry) ──
const railH = H0 + 0.1; // 바닥~셔터박스 하단 결합부