| 1007 | } |
| 1008 | |
| 1009 | bool Space_Impl::fixSurfacesWithIncorrectOrientation() { |
| 1010 | |
| 1011 | auto surfaces = findSurfacesWithIncorrectOrientation(); |
| 1012 | if (surfaces.empty()) { |
| 1013 | return false; |
| 1014 | } |
| 1015 | |
| 1016 | for (auto& surface : surfaces) { |
| 1017 | auto vertices = surface.vertices(); |
| 1018 | |
| 1019 | LOG(Error, "In Space '" << nameString() << "', Surface '" << surface.nameString() |
| 1020 | << "' has an outward normal pointing in the wrong direction. Flipping it."); |
| 1021 | std::reverse(vertices.begin(), vertices.end()); |
| 1022 | surface.setVertices(openstudio::reorderULC(vertices)); |
| 1023 | } |
| 1024 | return true; |
| 1025 | } |
| 1026 | |
| 1027 | double Space_Impl::volume() const { |
| 1028 | boost::optional<double> value = getDouble(OS_SpaceFields::Volume, true); |