SuperAPI AI 工具集

ifc-impl-geometry-extraction

数据与分析

查看项目

更新于 10-15 22:18

技能介绍

用途:从已有 IFC 文件提取指定构件的几何,用于渲染、生成网格或测量。IFC 把形状与位置分开存放:几何项位于局部坐标系,世界位置由 ObjectPlacement 单独承载,因此提取时必须同时解码形状项并把放置链解析为世界变换矩阵;不可只取原始几何项而跳过放置。

主要能力:

  1. 表示解析路径:IfcProduct.Representation → IfcProductDefinitionShape.Representations 列表 → 按 RepresentationIdentifier 选择 IfcShapeRepresentation → Items 几何图元。标识包括 Body(实体/曲面,用于渲染、网格、体积)、Axis、FootPrint、Box、Profile、Surface、Reference、CoG。渲染或算量应读 Body,不能取列表首个表示。
  2. 按 RepresentationType 解码:SweptSolid(扫掠截面)、Clipping(布尔差)、CSG(布尔树)、Brep、AdvancedBrep(IFC4+)、AdvancedSweptSolid(IFC4+)、Tessellation(IFC4+)、MappedRepresentation、SurfaceModel、BoundingBox。IFC2x3 无 Tessellation、AdvancedBrep、AdvancedSweptSolid。
  3. 放置链:由 IfcProduct.ObjectPlacement 沿 PlacementRelTo 上溯,将各 RelativePlacement 依次合成为世界矩阵,根在前、构件在后,乘序不可颠倒。
  4. 已知易错点:IFC 索引为 1 基(CoordIndex、PnIndex、IfcIndexedPolygonalFace),索引零基数组前须减 1;Brep 需区分 IfcFaceOuterBound 与 IfcFaceBound 以免填洞;MappedRepresentation 必须解析 MappingSource 与 MappingTarget,否则构件显示为空;若 product.Representation 为空则无几何(如 IfcBuildingStorey)。

使用方式与限制:具体调用代码与安装命令暂未提供。资料给出可用模式:解析 Body、构建放置矩阵、SweptSolid 扫掠、Tessellation 三角化、Brep 读取、MappedRepresentation 解析。精确体积/面积应使用参数实体,Tessellation 只是面片近似、只能报告为近似值。Clipping/CSG 布尔求值需要几何内核。参考文件包括 references/methods.md、references/examples.md、references/anti-patterns.md,规范来源为 buildingSMART IFC4.3、IFC4 ADD2 TC1、IFC2x3 TC1。相关技能:ifc-syntax-geometry-representations、ifc-syntax-geometry-placement、ifc-impl-reading-parsing。