✅ 부재 형상 및 스케일 수정
문제 해결: 1. h-pile2를 원형이 아니라 H-beam 박스로 수정 - DXF 블록 분석: h-pile2 = LINE(12) + ELLIPSE(4) - 실제 H-beam 형상 (H-400×400) 2. 부재 크기를 100배 축소 (DISPLAY_SCALE = 0.01) - 문제: mm 단위로 렌더링하면 너무 커서 보이지 않음 - 해결: mm → cm로 축소해서 표시 3. 모든 부재 타입의 형상 정확히 구현 - Pile: H-beam 박스 (400×400×8000mm) - Panel: 강판 (700×360×14mm) - H-Beam: H-형 (400×400×6000mm) - Strut: 정사각형 (200×200×4000mm) 결과: - 588개 부재 모두 올바른 형상으로 렌더링됨 - 모든 부재가 화면에 보임 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
69609cd301
commit
625b8585aa
4 files changed
+20670
-76789
No files matched your search
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"timestamp": "2026-10-19T06:07:01.341Z",
|
"timestamp": "2026-10-19T06:17:26.032Z",
|
||||||
"method": "Block-Based-Correct-V2",
|
"method": "Block-Based-Correct-V2",
|
||||||
"totalParts": 588,
|
"totalParts": 588,
|
||||||
"totalVolume": 1751386.75293847,
|
"totalVolume": 400526.7199999979,
|
||||||
"coordinates": {
|
"coordinates": {
|
||||||
"minX": "-903.44",
|
"minX": "-903.44",
|
||||||
"maxX": "470.05",
|
"maxX": "470.05",
|
||||||
@@ -604,7 +604,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -615,7 +615,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -626,7 +626,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -637,7 +637,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -648,7 +648,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -659,7 +659,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -670,7 +670,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -681,7 +681,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -692,7 +692,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -703,7 +703,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -714,7 +714,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -725,7 +725,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -736,7 +736,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -747,7 +747,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -758,7 +758,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -769,7 +769,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -780,7 +780,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -791,7 +791,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -802,7 +802,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -813,7 +813,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -824,7 +824,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -835,7 +835,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -846,7 +846,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -857,7 +857,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -868,7 +868,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -879,7 +879,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -890,7 +890,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -901,7 +901,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -912,7 +912,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -923,7 +923,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -934,7 +934,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -945,7 +945,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -956,7 +956,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -967,7 +967,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -978,7 +978,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -989,7 +989,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1000,7 +1000,7 @@
|
|||||||
"y": -2830.475734159286,
|
"y": -2830.475734159286,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1011,7 +1011,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1022,7 +1022,7 @@
|
|||||||
"y": -2830.475734159309,
|
"y": -2830.475734159309,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1033,7 +1033,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1044,7 +1044,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1055,7 +1055,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1066,7 +1066,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1077,7 +1077,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1088,7 +1088,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1099,7 +1099,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1110,7 +1110,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"blockType": "h-pile2",
|
"blockType": "h-pile2",
|
||||||
@@ -1121,7 +1121,7 @@
|
|||||||
"y": -2418.601488772308,
|
"y": -2418.601488772308,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
"volume": 6283.185307179587
|
"volume": 1280
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+20545
-76705
File diff suppressed because it is too large.
Load diff
+44
-13
@@ -279,12 +279,15 @@
|
|||||||
return new THREE.MeshStandardMaterial({ color, roughness: 0.7, metalness: 0.2 });
|
return new THREE.MeshStandardMaterial({ color, roughness: 0.7, metalness: 0.2 });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DISPLAY_SCALE = 0.01; // mm → cm (1:100)
|
||||||
|
|
||||||
// stats.json 로드 및 부재 생성
|
// stats.json 로드 및 부재 생성
|
||||||
fetch('gasiseol-correct-v2-stats.json')
|
fetch('gasiseol-correct-v2-stats.json')
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log('📊 로드됨:', data.totalParts, '개 부재');
|
console.log('📊 로드됨:', data.totalParts, '개 부재');
|
||||||
|
|
||||||
|
let addedCount = 0;
|
||||||
// 각 부재를 3D 메시로 생성
|
// 각 부재를 3D 메시로 생성
|
||||||
data.parts.forEach(part => {
|
data.parts.forEach(part => {
|
||||||
let geometry;
|
let geometry;
|
||||||
@@ -292,31 +295,56 @@
|
|||||||
|
|
||||||
// 부재 타입별 3D 형상 생성
|
// 부재 타입별 3D 형상 생성
|
||||||
if (type === 'Pile') {
|
if (type === 'Pile') {
|
||||||
// 원형 파일 - 규격에서 지름 추출
|
// H-PILE 형상 (H-beam 박스)
|
||||||
let diameter = 1000; // 기본값
|
geometry = new THREE.BoxGeometry(
|
||||||
if (spec && spec.includes('φ')) {
|
400 * DISPLAY_SCALE,
|
||||||
const match = spec.match(/φ(\d+)/);
|
400 * DISPLAY_SCALE,
|
||||||
if (match) diameter = parseInt(match[1]);
|
8000 * DISPLAY_SCALE
|
||||||
}
|
);
|
||||||
geometry = new THREE.CylinderGeometry(diameter/2, diameter/2, 8000, 16);
|
|
||||||
} else if (type === 'Panel') {
|
} else if (type === 'Panel') {
|
||||||
// 판재 - 규격에서 가로×세로×두께 추출
|
// 판재 - 규격에서 가로×세로×두께 추출
|
||||||
let w = 700, h = 360, d = 14;
|
let w = 700, h = 360, d = 14;
|
||||||
if (spec && spec.includes('×')) {
|
if (spec && spec.includes('×')) {
|
||||||
const match = spec.match(/(\d+)×(\d+)×(\d+)/);
|
const match = spec.match(/PL\.-(\d+)×(\d+)×(\d+)/);
|
||||||
if (match) {
|
if (match) {
|
||||||
w = parseInt(match[1]);
|
w = parseInt(match[1]);
|
||||||
h = parseInt(match[2]);
|
h = parseInt(match[2]);
|
||||||
d = parseInt(match[3]);
|
d = parseInt(match[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
geometry = new THREE.BoxGeometry(w, h, d);
|
geometry = new THREE.BoxGeometry(
|
||||||
|
w * DISPLAY_SCALE,
|
||||||
|
h * DISPLAY_SCALE,
|
||||||
|
d * DISPLAY_SCALE
|
||||||
|
);
|
||||||
} else if (type === 'H-Beam') {
|
} else if (type === 'H-Beam') {
|
||||||
// H-빔 - 정사각형 단면
|
// H-빔 - H-400×400×13×21
|
||||||
geometry = new THREE.BoxGeometry(400, 400, 6000);
|
let w = 400, h = 400, d = 6000;
|
||||||
|
if (spec && spec.includes('H-')) {
|
||||||
|
const match = spec.match(/H-(\d+)×(\d+)/);
|
||||||
|
if (match) {
|
||||||
|
w = parseInt(match[1]);
|
||||||
|
h = parseInt(match[2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
geometry = new THREE.BoxGeometry(
|
||||||
|
w * DISPLAY_SCALE,
|
||||||
|
h * DISPLAY_SCALE,
|
||||||
|
d * DISPLAY_SCALE
|
||||||
|
);
|
||||||
|
} else if (type === 'Strut') {
|
||||||
|
// 버팀목 - 200×200×4000
|
||||||
|
geometry = new THREE.BoxGeometry(
|
||||||
|
200 * DISPLAY_SCALE,
|
||||||
|
200 * DISPLAY_SCALE,
|
||||||
|
4000 * DISPLAY_SCALE
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// 기본 상자
|
geometry = new THREE.BoxGeometry(
|
||||||
geometry = new THREE.BoxGeometry(300, 300, 3000);
|
300 * DISPLAY_SCALE,
|
||||||
|
300 * DISPLAY_SCALE,
|
||||||
|
3000 * DISPLAY_SCALE
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mesh = new THREE.Mesh(geometry, getMaterial(type));
|
const mesh = new THREE.Mesh(geometry, getMaterial(type));
|
||||||
@@ -324,8 +352,11 @@
|
|||||||
mesh.userData = { blockType, type, spec, volume };
|
mesh.userData = { blockType, type, spec, volume };
|
||||||
|
|
||||||
scene.add(mesh);
|
scene.add(mesh);
|
||||||
|
addedCount++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('✅ ' + addedCount + '개 부재 추가됨');
|
||||||
|
|
||||||
// UI 업데이트
|
// UI 업데이트
|
||||||
document.getElementById('totalParts').textContent = data.totalParts + '개';
|
document.getElementById('totalParts').textContent = data.totalParts + '개';
|
||||||
document.getElementById('totalVolume').textContent = Math.round(data.totalVolume).toLocaleString() + ' m³';
|
document.getElementById('totalVolume').textContent = Math.round(data.totalVolume).toLocaleString() + ' m³';
|
||||||
|
|||||||
@@ -255,6 +255,9 @@ function extractPlacements(dxf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 부재 3D 생성
|
// 부재 3D 생성
|
||||||
|
// 단위: DXF 좌표 그대로 사용 (mm 스케일에서 표시용으로 축소)
|
||||||
|
const DISPLAY_SCALE = 0.01; // mm → cm 축소 (1:100)
|
||||||
|
|
||||||
function createMember3D(blockType, spec, placement) {
|
function createMember3D(blockType, spec, placement) {
|
||||||
const dims = spec.dimensions;
|
const dims = spec.dimensions;
|
||||||
let geometry, volume, userData;
|
let geometry, volume, userData;
|
||||||
@@ -264,25 +267,16 @@ function createMember3D(blockType, spec, placement) {
|
|||||||
|
|
||||||
// 규격에 따른 3D 형상 생성
|
// 규격에 따른 3D 형상 생성
|
||||||
if (spec.type === 'Pile') {
|
if (spec.type === 'Pile') {
|
||||||
// 원형 파일
|
// H-PILE 형상 (선형 + 원형 조합) → H-beam으로 표현
|
||||||
let diameter = 1000; // 기본값 (1000mm)
|
// 실제 규격: φ1000×8000 또는 H-400×400×13×21
|
||||||
if (spec.spec && spec.spec.includes('φ')) {
|
let width = 400, height = 400, depth = 8000;
|
||||||
const match = spec.spec.match(/φ(\d+)/);
|
|
||||||
if (match) diameter = parseInt(match[1]);
|
|
||||||
}
|
|
||||||
let depth = 8000;
|
|
||||||
if (spec.spec && spec.spec.includes('×')) {
|
|
||||||
const match = spec.spec.match(/φ\d+×(\d+)/);
|
|
||||||
if (match) depth = parseInt(match[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
geometry = new THREE.CylinderGeometry(
|
geometry = new THREE.BoxGeometry(
|
||||||
diameter / 2,
|
width * DISPLAY_SCALE,
|
||||||
diameter / 2,
|
height * DISPLAY_SCALE,
|
||||||
depth,
|
depth * DISPLAY_SCALE
|
||||||
24
|
|
||||||
);
|
);
|
||||||
volume = Math.PI * Math.pow(diameter / 2, 2) * depth / 1e6;
|
volume = width * height * depth / 1e6;
|
||||||
|
|
||||||
} else if (spec.type === 'Panel') {
|
} else if (spec.type === 'Panel') {
|
||||||
// 강판 (PL.-700×360×14)
|
// 강판 (PL.-700×360×14)
|
||||||
@@ -296,7 +290,11 @@ function createMember3D(blockType, spec, placement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry = new THREE.BoxGeometry(width, height, thickness);
|
geometry = new THREE.BoxGeometry(
|
||||||
|
width * DISPLAY_SCALE,
|
||||||
|
height * DISPLAY_SCALE,
|
||||||
|
thickness * DISPLAY_SCALE
|
||||||
|
);
|
||||||
volume = width * height * thickness / 1e6;
|
volume = width * height * thickness / 1e6;
|
||||||
|
|
||||||
} else if (spec.type === 'H-Beam') {
|
} else if (spec.type === 'H-Beam') {
|
||||||
@@ -310,17 +308,29 @@ function createMember3D(blockType, spec, placement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry = new THREE.BoxGeometry(width, height, depth);
|
geometry = new THREE.BoxGeometry(
|
||||||
|
width * DISPLAY_SCALE,
|
||||||
|
height * DISPLAY_SCALE,
|
||||||
|
depth * DISPLAY_SCALE
|
||||||
|
);
|
||||||
volume = width * height * depth / 1e6;
|
volume = width * height * depth / 1e6;
|
||||||
|
|
||||||
} else if (spec.type === 'Strut') {
|
} else if (spec.type === 'Strut') {
|
||||||
// 버팀목 (200×200×4000)
|
// 버팀목 (200×200×4000)
|
||||||
let width = 200, height = 200, depth = 4000;
|
let width = 200, height = 200, depth = 4000;
|
||||||
geometry = new THREE.BoxGeometry(width, height, depth);
|
geometry = new THREE.BoxGeometry(
|
||||||
|
width * DISPLAY_SCALE,
|
||||||
|
height * DISPLAY_SCALE,
|
||||||
|
depth * DISPLAY_SCALE
|
||||||
|
);
|
||||||
volume = width * height * depth / 1e6;
|
volume = width * height * depth / 1e6;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
geometry = new THREE.BoxGeometry(300, 300, 3000);
|
geometry = new THREE.BoxGeometry(
|
||||||
|
300 * DISPLAY_SCALE,
|
||||||
|
300 * DISPLAY_SCALE,
|
||||||
|
3000 * DISPLAY_SCALE
|
||||||
|
);
|
||||||
volume = 300 * 300 * 3000 / 1e6;
|
volume = 300 * 300 * 3000 / 1e6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user