MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / getFaces

Method getFaces

src/model/ThreeJSReverseTranslator.cpp:62–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60namespace 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");

Callers

nothing calls this directly

Calls 6

fromThreeVectorFunction · 0.85
openstudioFaceFormatIdFunction · 0.85
facesMethod · 0.80
verticesMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected