用途 本技能处理 IFC 中“对象是什么”(IfcWall、IfcBeam、IfcDoor 等语义)与“看起来怎样”(几何)之间的桥梁:表示框架(representation framework)及其接线。适用于为 IFC 产品挂接几何、读取模型形状数据,或排查表示为何被拒绝。适用于 IFC2x3、IFC4、IFC4.3。
主要能力
- 产品到形状的固定解析链:IfcProduct.Representation -> IfcProductDefinitionShape -> IfcShapeRepresentation(或 IfcTopologyRepresentation)-> IfcRepresentationItem。读写几何时必须走这条链。
- IfcProduct:ObjectPlacement 为对象坐标系,Representation 对承载形状的产品须为其子类型 IfcProductDefinitionShape。WHERE 规则 PlacementForShapeRepresentation 要求:若 Representation 为 IfcProductDefinitionShape,则 ObjectPlacement 必须给出;带几何的产品不可将 ObjectPlacement 留空。
- IfcProductDefinitionShape:承载一个产品的全部形状信息;OnlyShapeModel 规则限制 Representations 只能包含 IfcShapeModel 的两个子类型。IFC4 起 ShapeOfProduct 为 1:N,一个形状定义可被多个产品共享。
- IfcShapeRepresentation:四属性为 ContextOfItems、RepresentationIdentifier、RepresentationType、Items。五条 WHERE 规则中的 HasRepresentationIdentifier 与 HasRepresentationType 使后两者实际必填。CorrectContext 要求 ContextOfItems 必须是 IfcGeometricRepresentationContext。
- RepresentationIdentifier 常见值:Body、Axis、FootPrint、Box、Profile、Surface、Reference、CoG、Clearance、Annotation;IFC4.3 增加 Body-FallBack、Lighting。
- RepresentationType 常见值:SweptSolid、AdvancedSweptSolid、Brep、AdvancedBrep、CSG、Clipping、Tessellation、MappedRepresentation、Curve2D/Curve3D、BoundingBox、SurfaceModel。CorrectItemsForType 要求标签与几何种类一致。
- 表示上下文:IfcGeometricRepresentationContext 为根框架;IFC 项目若有 3D 几何须声明 ContextType = 'Model' 的上下文。IfcGeometricRepresentationSubContext 针对具体视图,其世界坐标系、维度、真北、精度由父上下文派生,在 STEP 文件中写为 * 占位符。
- IfcTopologyRepresentation:携带拓扑结构,可无坐标几何,常用于分析与结构连接模型。
- IfcShapeAspect:为几何的可寻址子特征命名,如某层材料、幕墙某面板。
- 映射表示:IfcRepresentationMap 定义基础几何,IfcMappedItem 插入实例;Items 为 IfcMappedItem 时 RepresentationType 为 'MappedRepresentation',可显著减小重复构件文件体积。
使用方式 按自下而上构建链条:先建几何项,包入 IfcShapeRepresentation(ContextOfItems 为对应子上下文,填写 Identifer 与匹配的 Type),放入 IfcProductDefinitionShape.Representations,令产品 Representation 指向它,并给产品 ObjectPlacement。多个表示(Body、Axis、FootPrint、Box)作为独立 IfcShapeRepresentation 放入同一列表,各绑定自己的标识与视图子上下文,互为补充视图。
限制 无限递归禁止:IfcMappedItem 不得映射传递性包含自身的表示。子上下文不可嵌套子上下文(ParentNoSub 仅允许一级)。子上下文不得携带坐标操作(NoCoordOperation);TargetView 为 USERDEFINED 时须给出 UserDefinedTargetView。各具体几何图元(拉伸、Brep、细分)由各自专门的技能负责;IFC2x3、IFC4、IFC4.3 的值表随版本增长,应按目标版本取值。