fix: [rd] 벽체 구조 수정 — 통 기둥 + 인방 분리
- 좌/우 기둥을 하나의 통 박스로 통합 (분리 안 됨) - 인방을 셔터박스 윗면부터만 생성 (셔터박스 내부 침범 제거) - 개구부 뒤쪽 벽 제거 (통과 가능)
This commit is contained in:
@@ -1280,50 +1280,37 @@ function fs3dBuild() {
|
||||
meshes.bottomBar.position.set(0, H - shutterH - 20, 0);
|
||||
scene.add(meshes.bottomBar);
|
||||
|
||||
// === WALL (개구부 뚫린 벽체: 좌벽 + 우벽 + 상부 인방 + 좌/우 날개벽) ===
|
||||
// === WALL (좌/우 기둥 + 상부 인방) ===
|
||||
// 기둥: 하나의 통 박스 (바닥~전체높이, 개구부 양옆)
|
||||
// 인방: 셔터박스 윗면부터 위로만 (셔터박스 내부 침범 안 함)
|
||||
const wl = S.wall;
|
||||
const wallH = H + b.height + wl.topMargin; // 전체 벽 높이
|
||||
const wallH = H + b.height + wl.topMargin;
|
||||
const wallColor = new THREE.Color(wl.color);
|
||||
const wallMat = new THREE.MeshStandardMaterial({ color: wallColor, transparent: true, opacity: wl.opacity / 100, side: THREE.DoubleSide });
|
||||
meshes.wall = new THREE.Group();
|
||||
|
||||
// 뒷벽: 개구부(W1 x H) 부분을 제외하고 3조각으로 구성
|
||||
// 1) 좌측 뒷벽 (날개벽 폭만큼)
|
||||
// 좌/우 기둥 (하나의 통 박스)
|
||||
if (wl.wing > 0) {
|
||||
const backLGeo = new THREE.BoxGeometry(wl.wing, wallH, wl.thick);
|
||||
const backL = new THREE.Mesh(backLGeo, wallMat);
|
||||
backL.position.set(-W1 / 2 - wl.wing / 2, wallH / 2, -wl.thick / 2);
|
||||
meshes.wall.add(backL);
|
||||
const colGeo = new THREE.BoxGeometry(wl.wing, wallH, wl.thick);
|
||||
const leftCol = new THREE.Mesh(colGeo, wallMat);
|
||||
leftCol.position.set(-W1 / 2 - wl.wing / 2, wallH / 2, 0);
|
||||
meshes.wall.add(leftCol);
|
||||
|
||||
// 2) 우측 뒷벽
|
||||
const backR = new THREE.Mesh(backLGeo.clone(), wallMat);
|
||||
backR.position.set(W1 / 2 + wl.wing / 2, wallH / 2, -wl.thick / 2);
|
||||
meshes.wall.add(backR);
|
||||
const rightCol = new THREE.Mesh(colGeo.clone(), wallMat);
|
||||
rightCol.position.set(W1 / 2 + wl.wing / 2, wallH / 2, 0);
|
||||
meshes.wall.add(rightCol);
|
||||
}
|
||||
|
||||
// 3) 상부 인방 (개구부 위, 셔터박스+상단여유 높이)
|
||||
const lintelH = b.height + wl.topMargin;
|
||||
if (lintelH > 0) {
|
||||
// 상부 인방 (셔터박스 윗면부터 위로만)
|
||||
if (wl.topMargin > 0) {
|
||||
const totalW = W1 + wl.wing * 2;
|
||||
const lintelGeo = new THREE.BoxGeometry(totalW, lintelH, wl.thick);
|
||||
const lintelGeo = new THREE.BoxGeometry(totalW, wl.topMargin, wl.thick);
|
||||
const lintel = new THREE.Mesh(lintelGeo, wallMat);
|
||||
lintel.position.set(0, H + lintelH / 2, -wl.thick / 2);
|
||||
lintel.position.set(0, H + b.height + wl.topMargin / 2, 0);
|
||||
meshes.wall.add(lintel);
|
||||
}
|
||||
|
||||
// 좌/우 날개벽 (앞쪽으로 돌출, 가이드레일 옆)
|
||||
if (wl.wing > 0) {
|
||||
const wingGeo = new THREE.BoxGeometry(wl.wing, wallH, wl.thick);
|
||||
const leftWing = new THREE.Mesh(wingGeo, wallMat);
|
||||
leftWing.position.set(-W1 / 2 - wl.wing / 2, wallH / 2, wl.thick / 2);
|
||||
meshes.wall.add(leftWing);
|
||||
|
||||
const rightWing = new THREE.Mesh(wingGeo.clone(), wallMat);
|
||||
rightWing.position.set(W1 / 2 + wl.wing / 2, wallH / 2, wl.thick / 2);
|
||||
meshes.wall.add(rightWing);
|
||||
}
|
||||
|
||||
// 벽체 와이어프레임 (윤곽선)
|
||||
// 벽체 와이어프레임
|
||||
meshes.wall.children.forEach(m => {
|
||||
const edges = new THREE.EdgesGeometry(m.geometry);
|
||||
const line = new THREE.LineSegments(edges, new THREE.LineBasicMaterial({ color: 0x8d6e63, opacity: 0.4, transparent: true }));
|
||||
|
||||
Reference in New Issue
Block a user