国际金融公司的绝对墙位

时间:2017-05-30 09:14:09

标签: c++ ifc

因为我想将窗户与墙壁相关联,所以我试图使用IFCOpenShell找到墙壁的端点。

#include <ifcgeom/IfcGeom.h>
#include <ifcparse/IfcFile.h>

using namespace Ifc2x3;
using namespace IfcSchema;
using namespace IfcParse;
using namespace IfcUtil;
using namespace IfcGeom;

std::string tostr(gp_XYZ a) {
  std::stringstream ss;
  ss << a.X() << "," << a.Y() << "," << a.Z();
  return ss.str();
}

int main(int argc, char** argv) {
  IfcFile file;
  if (!file.Init(argc > 1 ? argv[1] : "windows connected to walls Archicad.ifc")) abort();
  Kernel k;

  gp_Pnt start;
  gp_Pnt end;

  auto list = file.entitiesByType<IfcWall>();
  for ( auto it = list->begin(); it != list->end(); ++it) {
    auto w1 = *it;
    std::cout << "wall " << w1->entity->id() << std::endl;
    bool suc = k.find_wall_end_points(w1, start, end);

    std::cout << suc << std::endl;
    std::cout << tostr(start.XYZ()) << std::endl;
    std::cout << tostr(end.XYZ()) << std::endl;
  }
}

这目前产生10.1596,0,09.08038,0,0作为两个墙的端点,0作为两者的起点。这意味着它们是平行的。但是当我在Archicad中打开IFC文件时,它们是正交的。文件中甚至还有一个IFC标记,指定一个墙连接到另一个ATSTART / ATEND。如何得出正确的坐标?

编译命令行:g++ -I/usr/include/oce wallpoints.cpp -l IfcGeom -l IfcParse $(for i in $(cd /usr/lib/x86_64-linux-gnu/; ls libTK*.so | cut -d. -f1 | cut -c4-); do echo "-l $i"; done) $(icu-config --ldflags) -ggdb3

IFC档案:https://hushfile.it/592c22c69af2a#AwrpRI2O3ecDuAmP_pIjNmCAV3BWvwr30tfrazqJ

1 个答案:

答案 0 :(得分:-1)

the standard所述,展示位置是相对的,因此我必须将其与几个矩阵相乘。

相关问题