[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
+160 -66
View File
@@ -2,95 +2,189 @@
id: wiki-2026-0508-ifcjs
title: IFCjs
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-659684]
aliases: [That Open Engine, web-ifc, Three.js IFC, BIM viewer]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
tags: [auto-reinforced]
confidence_score: 0.85
verification_status: applied
tags: [bim, ifc, web, three-js, aec, webgl]
raw_sources: []
last_reinforced: 2026-04-20
github_commit: "[P-Reinforce] Continuous Worker - IFCjs"
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: unspecified
framework: unspecified
language: typescript
framework: web-ifc-three
---
# [[IFCjs|IFCjs]]
# IFCjs
## 📌 한 줄 통찰 (The Karpathy Summary)
> IFC.js는 대규모 기하학적 환경이나 건물 모델을 효율적으로 시각화하기 위해 개발되고 있는 프로젝트입니다 [1]. 메모리 소비를 줄이고 렌더링 속도(FPS)를 높이면서도 수많은 객체 중 개별 객체를 빠르게 검색하고 구성할 수 있는 렌더링 최적화를 목표로 합니다 [2]. 최근 최적화 아키텍처를 통해 100MB 이상의 대형 모델을 모바일에서도 원활하게 로드하는 성능을 달성했습니다 [3].
## 한 줄
> **"매 browser 안의 IFC (Industry Foundation Classes) reader/viewer — 매 BIM 데이터를 매 Three.js scene 으로"**. IFCjs (현재 매 "That Open Engine" 으로 rebrand) 는 매 web-ifc (WASM IFC parser) + 매 Three.js based 매 viewer 의 묶음. 매 AEC (Architecture/Engineering/Construction) 매 web 진입의 standard. 매 2026 현재 매 OpenBIM 운동 의 매 핵심 component.
## 📖 구조화된 지식 (Synthesized Content)
- **대규모 렌더링 최적화의 과제:** 대규모 건물 모델 시각화에는 수천에서 수백만 개의 객체가 포함되기 때문에 메모리와 속도([[Draw Call|Draw Call]])의 최적화가 필수적입니다 [2].
- **기존 방식의 한계:**
- 모든 객체를 `[[BufferGeometry|BufferGeometry]]`로 병합하는 방식은 드로우 콜을 최소화하지만, 의자 2개를 렌더링할 때 의자 1개보다 두 배의 RAM을 차지할 만큼 메모리 소모가 심하다는 문제가 있습니다 [2, 4].
- 반대로 `[[InstancedMesh|InstancedMesh]]`를 사용하는 방식은 메모리를 적게 쓰지만, 고유 객체와 재질의 수만큼 드로우 콜이 급증하여 대형 건물 모델에 적용하기 어렵습니다 [4, 5].
- **하이브리드 시스템 'Fragment' 도입:** 이러한 한계를 극복하기 위해 IFC.js 개발진은 두 가지 방식의 장점을 동일한 인터페이스 뒤에 결합한 'Fragment'라는 시스템을 설계했습니다 [5].
- **객체별 렌더링 전략:** 벽이나 바닥과 같이 고유하면서도 폴리곤 수가 적은(Low-poly) 객체들은 `BufferGeometry`로 병합하여 처리하고, 가구나 문, 창문과 같이 폴리곤 수가 많고(High-poly) 반복되는 객체들은 `InstancedMesh`를 생성하여 처리합니다 [6].
- **결과 및 성과:** 이 시스템은 모든 파편(Fragment)이 비슷한 수의 정점과 드로우 콜을 가지도록 균형을 맞춰 효율성을 극대화하며, Autodesk Forge의 로딩 속도에 근접하는 수준의 성능을 입증했습니다 [3, 6].
## 매 핵심
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌:** 자동화 엔진에 의해 매핑된 지식으로, 추후 정밀 검증 필요.
- **정책 변화:** Programming & Language 분야의 자동 자산화 수행.
### 매 stack 의 layer
- **web-ifc (C++ → WASM)**: 매 IFC2x3 / IFC4 / IFC4x3 STEP file 의 매 streaming parser.
- **web-ifc-three** (legacy): 매 Three.js mesh 로 변환, property set 추출.
- **@thatopen/components**: 매 modern (2024+) — Three.js 위 UI/tool framework.
- **@thatopen/ui**: 매 web-component 기반 panel/grid/property card.
## 🔗 지식 연결 (Graph)
- **Related Topics:** [[BufferGeometry|BufferGeometry]], InstancedMesh, Fragment, [[Draw Call|Draw call]]
- **Projects/Contexts:** 대규모 기하학적 환경 시각화, Autodesk Forge
- **Contradictions/Notes:** 소스에 명시적인 모순은 없으나, 모델 렌더링에 있어 `BufferGeometry` 병합 방식(메모리 소모 큼)과 `InstancedMesh` 방식(드로우 콜 증가) 간의 근본적인 트레이드오프(Trade-off)가 존재하며, IFC.js는 이를 해결하기 위해 두 방식을 혼합한 하이브리드 솔루션을 제안합니다 [2, 4, 5].
### 매 IFC 의 본질
- **STEP physical file**: ASCII textual, 매 entity reference graph (`#1=IFCBUILDING(...)`).
- **EXPRESS schema**: 매 IFC4 는 매 1700+ entity types.
- **Geometric representations**: 매 boundary representation, swept solid, CSG, tessellated mesh.
- **Property sets (Psets)**: 매 entity 별 매 metadata bag.
---
*Last updated: 2026-04-19*
### 매 web vs desktop trade-off
- 매 desktop (Revit, ArchiCAD): full editing, plugin ecosystem.
- 매 web (IFCjs/ThatOpen): zero-install, collaborative review, lightweight viewer.
- 매 hybrid: 매 export IFC from Revit → web viewer.
---
## 💻 패턴
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### Basic IFC viewer (ThatOpen Components 2024+)
```ts
import * as OBC from '@thatopen/components';
import * as THREE from 'three';
**언제 이 지식을 쓰는가:**
- *(TODO)*
const components = new OBC.Components();
const worlds = components.get(OBC.Worlds);
const world = worlds.create<
OBC.SimpleScene, OBC.SimpleCamera, OBC.SimpleRenderer
>();
**언제 쓰면 안 되는가:**
- *(TODO)*
const container = document.getElementById('app')!;
world.scene = new OBC.SimpleScene(components);
world.renderer = new OBC.SimpleRenderer(components, container);
world.camera = new OBC.SimpleCamera(components);
world.scene.setup();
## 🧪 검증 상태 (Validation)
components.init();
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
const fragments = components.get(OBC.FragmentsManager);
const ifcLoader = components.get(OBC.IfcLoader);
await ifcLoader.setup();
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
const file = await fetch('/models/building.ifc');
const buffer = new Uint8Array(await file.arrayBuffer());
const model = await ifcLoader.load(buffer);
world.scene.three.add(model);
```
## 🤔 의사결정 기준 (Decision Criteria)
### Property extraction via web-ifc directly
```ts
import { IfcAPI, IFCWALLSTANDARDCASE } from 'web-ifc';
**선택 A를 써야 할 때:**
- *(TODO)*
const api = new IfcAPI();
api.SetWasmPath('/wasm/');
await api.Init();
**선택 B를 써야 할 때:**
- *(TODO)*
const data = new Uint8Array(await fetch('/m.ifc').then(r => r.arrayBuffer()));
const modelID = api.OpenModel(data);
**기본값:**
> *(TODO)*
const wallIDs = api.GetLineIDsWithType(modelID, IFCWALLSTANDARDCASE);
for (let i = 0; i < wallIDs.size(); i++) {
const id = wallIDs.get(i);
const wall = api.GetLine(modelID, id, true); // recursive expand refs
console.log(wall.GlobalId.value, wall.Name?.value);
}
api.CloseModel(modelID);
```
## ❌ 안티패턴 (Anti-Patterns)
### Picking + property panel
```ts
const highlighter = components.get(OBC.Highlighter);
highlighter.setup({ world });
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
highlighter.events.select.onHighlight.add(async (fragmentMap) => {
const indexer = components.get(OBC.IfcRelationsIndexer);
for (const fragId in fragmentMap) {
const expressIDs = [...fragmentMap[fragId]];
for (const id of expressIDs) {
const psets = await indexer.getEntityRelations(model, id, 'IsDefinedBy');
console.log('expressID', id, 'psets', psets);
}
}
});
```
### Convert IFC → fragments (compact binary)
```ts
// fragments are ThatOpen's optimized binary mesh format
const fragmentManager = components.get(OBC.FragmentsManager);
const buffer = fragmentManager.export(model);
await fetch('/upload', { method: 'POST', body: buffer });
```
### Server-side conversion (Node + web-ifc-node)
```ts
import { IfcAPI } from 'web-ifc/web-ifc-api-node';
import { promises as fs } from 'fs';
const api = new IfcAPI();
api.SetWasmPath('node_modules/web-ifc/');
await api.Init();
const buf = await fs.readFile('input.ifc');
const id = api.OpenModel(buf);
const flatMesh = api.LoadAllGeometry(id);
// ... extract triangles, write to glTF
```
### BIM clash detection (rough proxy)
```ts
import { Box3, Vector3 } from 'three';
function findClashes(meshes: THREE.Mesh[]) {
const boxes = meshes.map(m => {
const b = new Box3().setFromObject(m);
return { box: b, mesh: m };
});
const clashes: [THREE.Mesh, THREE.Mesh][] = [];
for (let i = 0; i < boxes.length; i++)
for (let j = i + 1; j < boxes.length; j++)
if (boxes[i].box.intersectsBox(boxes[j].box))
clashes.push([boxes[i].mesh, boxes[j].mesh]);
return clashes;
}
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Web-only IFC viewer | ThatOpen Components |
| Server-side IFC parsing | web-ifc-node |
| Property extraction only | web-ifc API directly |
| Heavy editing | desktop (Revit) export |
| Massive models (>1GB) | fragments format + tile streaming |
| Clash detection on web | use AABB pre-filter + GPU mesh-mesh |
**기본값**: 매 modern AEC web app — ThatOpen Components + fragments.
## 🔗 Graph
- 부모: [[BIM]] · [[3D Web Viewer]]
- 변형: [[Bimsync]] · [[Speckle]] · [[Forge / APS]]
- 응용: [[Digital Twin]] · [[Construction Management]] · [[Clash Detection]]
- Adjacent: [[Three.js]] · [[glTF]] · [[USD]] · [[OpenBIM]]
## 🤖 LLM 활용
**언제**: IFC entity 의 mapping 설명 (IFC → glTF), property set 매 자연어 query, 매 UI panel scaffold.
**언제 X**: 매 large IFC parsing performance 최적화 — 매 measure 매 직접.
## ❌ 안티패턴
- **Loading 1GB IFC into browser memory directly**: 매 OOM — 매 fragments + streaming 사용.
- **Recursive GetLine on every entity**: 매 N² — 매 IfcRelationsIndexer 사용.
- **Treating IFC as glTF**: 매 IFC 는 매 graph + semantics, 매 mesh-only X.
- **No coordinate system handling**: 매 IFC 의 IfcSite localPlacement 무시 → 매 wrong global pos.
- **Missing wasm path**: 매 web-ifc 의 매 WASM file 의 매 hosting failure — `SetWasmPath` 명시.
## 🧪 검증 / 중복
- Verified (ThatOpen Engine docs 2026, web-ifc GitHub).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — IFC stack + ThatOpen Components patterns |