借用pythonocc强大的内核功能,我们同样可以读取建筑CAD信息,ifc 格式。
此处我们将参考ifcopenshell https://github.com/IfcOpenShell/IfcOpenShell
由于我们之前已经安装了pythonocc环境,因此在此基础上直接安装ifcopenshell
#使用conda安装的ifcopenshell,已经包括了convert
conda install -c ifcopenshell -c conda-forge ifcopenshell
简单的显示demo:
import os
import sys
from OCC.Core.gp import gp_Vec
from OCC.Core.Quantity import Quantity_Color, Quantity_TOC_RGB
from OCC.Core.Graphic3d import Graphic3d_ClipPlane
from OCC.Display.SimpleGui import init_display
try:
import ifcopenshell
import ifcopenshell.geom
except ModuleNotFoundError:
print("ifcopenshell package not found.")
sys.exit(0)
display, start_display, add_menu, add_function_to_menu = init_display()
settings = ifcopenshell.geom.settings()
settings.set(
settings