1. 개요
IfcOpenShell는 ISO 표준(국제 표준)인 IFC 포멧(IFC-SPF / IFC-XML등) 및 산업용 수준의 오픈소스 기하 커널(Geometry Kernel)로 유명한 Open CASCADE Technology(OCCT)엔진을 지원하는 BIM용 응용프로그램이다. 보다 정확히는 IFC라이브러리 집합체이다. [1][2][3]2. IFC와 파이썬
| 요소 | 설명 |
| `ifcopenshell.api` | 공통 Python IFC API |
| `Open CASCADE` | FreeCAD & IfcOpenShell 공용 기하 커널 |
| `IFC-SPF / IFC-XML` | 표준 IFC 파일 교환 포맷 |
| `Python3` | 공통 스크립팅 플랫폼(블렌더 포함) |
3. OpenBIM 연산 생태계
3.1. 예시(파이썬 기준)
하나의 IFC 파일을 3총사로 순환 처리① FreeCAD에서 IFC 생성 및 저장
import FreeCAD, Arch, Part
doc = FreeCAD.newDocument("IfcTest")
wall = Arch.makeWall(length=5000, height=3000)
doc.recompute()
doc.saveAs("test.FCStd")
# IFC export도 가능
import ImportGui
ImportGui.export([wall], "test.ifc")
여기서 \[wall\]은 IFC로 내보낼 객체 리스트doc = FreeCAD.newDocument("IfcTest")
wall = Arch.makeWall(length=5000, height=3000)
doc.recompute()
doc.saveAs("test.FCStd")
# IFC export도 가능
import ImportGui
ImportGui.export([wall], "test.ifc")
② IfcOpenShell로 IFC 데이터 구조 확인
import ifcopenshell
model = ifcopenshell.open("test.ifc")
for wall in model.by_type("IfcWall"):
print(wall.Name, wall.GlobalId)
③ BlenderBIM에서 해당 IFC 파일 시각화 및 수정model = ifcopenshell.open("test.ifc")
for wall in model.by_type("IfcWall"):
print(wall.Name, wall.GlobalId)
# BlenderBIM은 Blender 안에서 아래 함수 호출함:
import ifcopenshell.api
model = ifcopenshell.open("test.ifc")
ifcopenshell.api.run("geometry.add_representation", model, ...)
import ifcopenshell.api
model = ifcopenshell.open("test.ifc")
ifcopenshell.api.run("geometry.add_representation", model, ...)
3.2. 물량산출
당연히 IFC는 자재 데이터의 정의, 추출, 연산, 자동화가 전부 가능하다. 특히 IfcMaterial, IfcMaterialLayer, IfcQuantity, IfcCostItem 등의 IFC 클래스가 이미 자재와 수량, 단가 연산을 위한 구조를 갖추고 있다. 하지만 이를 현지 실정에 맞게 데이터를 얻어내기 위해서는 아직 디테일한 부분에서 커스터마이징의 추가 옵션을 해결해야하는 이슈가 남아있을수있다.4. 관련문서
*SVG*캐드
*복셀