问题
Has anyone already used the IFC (Industry Foundation Classes) from BuildingSmart, typically adopted for BIM projects and building domain ? I would like to know how to navigate the IFC objects to get the coordinates of a IfcWallStandardCase or of an affine object (i.e., yet a Wall).
I am interesting in getting the coordinates of all or at least one of the vertices delimiting the Wall. Please indicate the navigation through the Ifc objects of an Ifc file, to know where to locate the coordinates information in the Ifc file starting from an IfcWallStandardCase or affine object.
回答1:
First go for the Representation
attribute which is optional for IfcProduct
. You want shape representations (IfcProductDefinitionShape
), not material representations. If there are representations at all, you may get multiple representations, each with a context specifying dimensionality, precision, and coordinate system. Since you are hunting for coordinates, you probably want a representation of type IfcShapeRepresentation
, not IfcTopologyRepresentation
. Each representation then consists of multiple representation items.
There are several types of geometry representations - check the inheritance tree of IfcGeometricRepresentationItem
. Here is an example for a faceted BREP: each representation item is then of type IfcFacetedBrep
, which is explained nicely in the IFC2x4 specs. With attribute outer
you get a closed shell, which consist of a set of faces (IfcFace
) reachable trough the attribute CfsFaces
. Each face has a set of bounds (IfcFaceBound
, attribute Bounds
), each of which is defined by a loop (IfcLoop
, attribute Bound
) and an orientation. The loops again may be of different type, let's assume IfcPolyLoop
. Those have a list of points (IfcCartesianPoint
) under the attribute Polygon
, which finally give you the coordinates (of type IfcLengthMeasure
which is a REAL
) with attribute Coordinates
.
Be aware that those coordinates are relative to the coordinate system of the geometric context mentioned in the beginning. Contexts may be nested with multiple coordinate transformations to be resolved in order to get absolute world coordinates.
The path of attribute names is: Representation
, Items
, CfsFaces
, Bounds
, Bound
, Polygon
, Coordinates
.
来源:https://stackoverflow.com/questions/29650409/ifc-objects-navigation-to-retrieve-wall-coordinates