| 60 | namespace model { |
| 61 | |
| 62 | Point3dVectorVector ThreeJSReverseTranslator::getFaces(const ThreeGeometryData& data) const { |
| 63 | Point3dVectorVector result; |
| 64 | |
| 65 | const Point3dVector vertices = fromThreeVector(data.vertices()); |
| 66 | const std::vector<size_t> faces = data.faces(); |
| 67 | const size_t n = faces.size(); |
| 68 | |
| 69 | if (n < 1) { |
| 70 | return result; |
| 71 | } |
| 72 | |
| 73 | if (faces[0] == openstudioFaceFormatId()) { |
| 74 | // openstudio, all vertices belong to one face |
| 75 | Point3dVector face; |
| 76 | |
| 77 | // faces[0] is format |
| 78 | for (size_t i = 1; i < n; ++i) { |
| 79 | face.push_back(vertices[faces[i]]); |
| 80 | } |
| 81 | |
| 82 | // try{ |
| 83 | // Plane p(face); |
| 84 | // } catch (const std::exception&) |
| 85 | // { |
| 86 | // std::cout << "Vertices: " << vertices << '\n'; |
| 87 | // std::cout << "faces: " << '\n'; |
| 88 | // for (const auto& f : faces){ |
| 89 | // std::cout << " " << f << '\n'; |
| 90 | // } |
| 91 | // bool t = false; |
| 92 | // } |
| 93 | |
| 94 | result.push_back(face); |
| 95 | } |
| 96 | |
| 97 | return result; |
| 98 | } |
| 99 | |
| 100 | ConstructionAirBoundary ThreeJSReverseTranslator::getAirWallConstruction(Model& model) { |
| 101 | boost::optional<ConstructionAirBoundary> result = model.getConcreteModelObjectByName<ConstructionAirBoundary>("AirWall"); |
nothing calls this directly
no test coverage detected