从IFC(python)提取坐标

2024-10-02 14:23:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我对从IFC模型中提取坐标感兴趣,比如墙坐标(python)和/或至少一些几何图形,然后在cgal库(python版本)中使用它们。(我是ifcopenshell包和ifc格式的新手)。在

有人知道怎么做吗?我从以下代码开始:

import ifcopenshell as ifc
from ifcopenshell import geom
file = ifc.open("/home/myIFC.ifc")
settings = geom.settings()
settings.set(settings.USE_PYTHON_OPENCASCADE, True)
# Get a list of all walls in the file
walls = file.by_type("IfcWall")
# Create a list of wall representation shapes
wall_shapes = []
for wall in walls:
    shape = geom.create_shape(settings, wall).geometry
    wall_shapes.append((wall, shape))
    geom.utils.display_shape(shape) # Line does not work: Got an error: AttributeError: 'NoneType' object has no attribute 'DisplayShape'

也许这样做不合适,我真的希望有人能帮助我。在

这是我模型的结构。在

enter image description here

谢谢你!在


Tags: ofin模型importsettingslistfileshape