fix: [fire-shutter] 3D 가이드레일 벽 정렬 수정 및 B키 그리드 토글 추가

- 벽 기둥 내면을 본체 배면과 같은 선상에 정렬 (브라켓은 벽 안에 매립)
- B키로 바닥 그리드 표시/숨기기 토글 기능 추가
This commit is contained in:
김보곤
2026-03-13 21:20:54 +09:00
parent e6b0f8e02e
commit 1a6ceebb4c

View File

@@ -1325,10 +1325,11 @@ function fs3dInit() {
const hemi = new THREE.HemisphereLight(0x87ceeb, 0x8b4513, 0.3);
scene.add(ambient, dir1, dir2, hemi);
// Grid
// Grid (B키로 토글)
const grid = new THREE.GridHelper(5000, 50, 0x334155, 0x1e293b);
grid.position.y = 0;
scene.add(grid);
let floorGridRef = grid; // B키 토글용 참조
// === TransformControls (클릭 선택 + 이동) ===
transformCtrl = new THREE.TransformControls(camera, renderer.domElement);
@@ -1438,6 +1439,12 @@ function deselectMesh() {
return;
}
// B: 바닥 그리드 토글
if (k === 'b' && !e.altKey && !e.ctrlKey) {
if (floorGridRef) floorGridRef.visible = !floorGridRef.visible;
return;
}
// H: 선택된 요소 감추기
if (k === 'h' && selectedKey) {
const hideKey = selectedKey;
@@ -2198,11 +2205,12 @@ function createRailGroup() {
const wallMat = new THREE.MeshStandardMaterial({ color: wallColor, transparent: true, opacity: wl.opacity / 100, side: THREE.DoubleSide });
meshes.wall = new THREE.Group();
// 가이드레일 최대 깊이 (개구부 중심에서 브라켓 끝까지)
const railMaxDepth = isScreenType
? (g.sideWall + g.thickness + 30) // ③ 벽연형-C 벽쪽 body 끝 = 111.55mm
: (rw / 2); // 철재형: 레일 절반 폭
const whw = hw + railMaxDepth; // 벽 기둥 내면 = 브라켓 끝에 정렬
// 가이드레일 본체 배면 깊이 (개구부에서 본체 백월까지)
// 벽 기둥 내면 = 본체 배면과 같은 선상 (브라켓 ③④는 벽 두께 안에 매립)
const railBodyDepth = isScreenType
? (g.sideWall + g.thickness) // 본체 배면 = 81.55mm
: (rw / 2); // 철재형: 레일 절반 폭
const whw = hw + railBodyDepth;
const wg = wl.wing;
const topH = wl.topMargin;
const totalH = colH + topH;