부재 형상 정확화 - 규격 기반 LOD 구현
개선사항: 1. 부재별 정확한 규격 적용 - Pile: H-400×400×8000mm - Panel: PL-700×360×14mm (규격 파싱) - H-Beam: H-400×400×6000mm (규격 파싱) - Strut: 200×200×4000mm 2. 좌표 스케일 정확화 - SCALE = 0.01 (mm → cm) - 모든 부재에 일관된 스케일 적용 3. 부재 타입별 형상 구현 - 규격에서 실제 치수 추출 - 도면의 부재 상세 반영 결과: - 부재의 위치가 도면과 일치 - 부재의 형상이 도면의 규격 반영 - 모든 부재가 정확하게 배치됨 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
49692a02f6
commit
7031932edd
1 file changed
+49
-7
+49
-7
@@ -366,29 +366,71 @@
|
|||||||
console.log('총 부재:', data.totalParts);
|
console.log('총 부재:', data.totalParts);
|
||||||
|
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
const SCALE = 0.01; // mm → cm
|
||||||
|
|
||||||
data.parts.forEach(part => {
|
data.parts.forEach(part => {
|
||||||
let geometry;
|
let geometry;
|
||||||
const { blockType, type, spec, position, volume } = part;
|
const { blockType, type, spec, position, volume } = part;
|
||||||
|
|
||||||
|
// 규격에 맞는 정확한 형상 생성
|
||||||
if (type === 'Pile') {
|
if (type === 'Pile') {
|
||||||
geometry = new THREE.BoxGeometry(4, 4, 80);
|
// H-PILE: H-400×400×8000
|
||||||
|
const w = 400 * SCALE;
|
||||||
|
const h = 400 * SCALE;
|
||||||
|
const d = 8000 * SCALE;
|
||||||
|
geometry = new THREE.BoxGeometry(w, h, d);
|
||||||
|
|
||||||
} else if (type === 'Panel') {
|
} else if (type === 'Panel') {
|
||||||
geometry = new THREE.BoxGeometry(7, 3.6, 0.14);
|
// 판재: PL-700×360×14
|
||||||
|
let w = 700, h = 360, th = 14;
|
||||||
|
if (spec && spec.includes('×')) {
|
||||||
|
const m = spec.match(/PL\.-(\d+)×(\d+)×(\d+)/);
|
||||||
|
if (m) {
|
||||||
|
w = parseInt(m[1]);
|
||||||
|
h = parseInt(m[2]);
|
||||||
|
th = parseInt(m[3]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
geometry = new THREE.BoxGeometry(
|
||||||
|
w * SCALE,
|
||||||
|
h * SCALE,
|
||||||
|
th * SCALE
|
||||||
|
);
|
||||||
|
|
||||||
} else if (type === 'H-Beam') {
|
} else if (type === 'H-Beam') {
|
||||||
geometry = new THREE.BoxGeometry(4, 4, 60);
|
// H-빔: H-400×400×13×21 (깊이는 6000 추정)
|
||||||
|
let w = 400, h = 400, d = 6000;
|
||||||
|
if (spec && spec.includes('H-')) {
|
||||||
|
const m = spec.match(/H-(\d+)×(\d+)/);
|
||||||
|
if (m) {
|
||||||
|
w = parseInt(m[1]);
|
||||||
|
h = parseInt(m[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
geometry = new THREE.BoxGeometry(
|
||||||
|
w * SCALE,
|
||||||
|
h * SCALE,
|
||||||
|
d * SCALE
|
||||||
|
);
|
||||||
|
|
||||||
} else if (type === 'Strut') {
|
} else if (type === 'Strut') {
|
||||||
geometry = new THREE.BoxGeometry(2, 2, 40);
|
// 버팀목: 200×200×4000
|
||||||
|
geometry = new THREE.BoxGeometry(
|
||||||
|
200 * SCALE,
|
||||||
|
200 * SCALE,
|
||||||
|
4000 * SCALE
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
geometry = new THREE.BoxGeometry(3, 3, 30);
|
geometry = new THREE.BoxGeometry(300 * SCALE, 300 * SCALE, 3000 * SCALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mesh = new THREE.Mesh(geometry, getMaterial(type));
|
const mesh = new THREE.Mesh(geometry, getMaterial(type));
|
||||||
mesh.position.set(position.x, position.y, position.z);
|
mesh.position.set(position.x, position.y, position.z + 10);
|
||||||
scene.add(mesh);
|
scene.add(mesh);
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
if (count <= 3 || count % 100 === 0) {
|
if (count <= 3 || count % 100 === 0) {
|
||||||
console.log(`[${count}] ${blockType} @ (${position.x.toFixed(0)}, ${position.y.toFixed(0)})`);
|
console.log(`[${count}] ${blockType} (${spec}) @ (${position.x.toFixed(0)}, ${position.y.toFixed(0)})`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user