pythonocc基础使用:导入模型——ifc格式(ifcopenshell)

借用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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值