有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何获取IFC对象的绝对坐标?

我正在开发一个小的java API,用来操纵IFC(工业基础类)对象。为此,我使用了外部工具,如BIMserver

现在,我正在尝试获取作为IfcProduct实例的每个对象的坐标。但是,我只是通过IfcLocalPlacement获取另一个IfcProduct的相对坐标,而不是对象的绝对坐标。因此,每个对象的引用是包含它的实体

我的目标是计算IFC对象之间的距离(只是向用户显示信息,我不尝试渲染对象等等)。例如IfcSpaceIfcDistributionControlElement之间的距离

是否有人知道如何获取每个IFC对象的绝对坐标(而不是相对坐标)?如果您知道一些API或库可以帮助我,您也可以发送它们


共 (1) 个答案

  1. # 1 楼答案

    您需要应用/堆叠树中所有不同的IfcLocalPlacement,直到到达IfcProject容器。您还可以找到解释here in the docs for IFC2X3here in the docs for IFC4(据我所知,IfcLocalPlacement的规范没有改变)

    The following conventions shall apply as default relative positions if the relative placement is used. The conventions are given for all five direct subtypes of IfcProduct, the IfcSpatialStructureElement, IfcElement, IfcAnnotation, IfcGrid, IfcPort. More detailed placement information is given at the level of subtypes of those five types mentioned.

    • For the subtypes of IfcSpatialStructureElement the following conventions apply
      • IfcSite shall be placed absolutely within the world coordinate system established by the geometric representation context of the IfcProject
      • IfcBuilding shall be placed relative to the local placement of IfcSite
      • IfcBuildingStorey shall be placed relative to the local placement of IfcBuilding
    • For IfcGrid and IfcAnnotation the convention applies that it shall be placed relative
      • to the local placement of its container (IfcSite, IfcBuilding, IfcBuildingStorey)
        • it should be the same container element that is referenced by the IfcRelContainedInSpatialStructure containment relationship,
    • For IfcPort the convention applies that it shall be placed relative
      • to the local placement of the element it belongs to (IfcElement)
        • it should be the same element that is referenced by the IfcRelConnectsPortToElement connection relationship,
    • For IfcElement the convention applies that it shall be placed relative:
      • to the local placement of its container (IfcSite, IfcBuilding, IfcBuildingStorey)
        • it should be the same container element that is referenced by the IfcRelContainedInSpatialStructure containment relationship,
      • to the local placement of the IfcElement to which it is tied by an element composition relationship
        • for features that are located relative to the main component (such as openings), as expressed by IfcRelVoidsElement and IfcRelProjectsElement,
        • for elements that fill an opening (such as doors or windows), as expressed by IfcRelFillsElement,
        • for coverings that cover the element, as expressed by IfcRelCoversBldgElements,
        • for sub components that are aggregated to the main component, as expressed by IfcRelAggregates and IfcRelNests)