get the transformation from building to world
| 303 | |
| 304 | // get the transformation from building to world |
| 305 | Transformation GeometryTranslator::buildingTransformation() const { |
| 306 | // get the Building |
| 307 | WorkspaceObjectVector objects = m_workspace.getObjectsByType(IddObjectType::Building); |
| 308 | if (objects.size() != 1) { |
| 309 | LOG(Warn, "Could not find Building object, assuming 0 rotation"); |
| 310 | return {}; |
| 311 | } |
| 312 | WorkspaceObject building = objects[0]; |
| 313 | |
| 314 | OptionalDouble northAxis = building.getDouble(BuildingFields::NorthAxis, true); |
| 315 | if (!northAxis) { |
| 316 | northAxis = 0; |
| 317 | LOG(Warn, "North Axis unknown, using 0"); |
| 318 | } |
| 319 | // rotate negative amount around the z axis, EnergyPlus defines rotation opposite to OpenStudio |
| 320 | return Transformation::rotation(Vector3d(0, 0, 1), -degToRad(*northAxis)); |
| 321 | } |
| 322 | |
| 323 | // get the transformation from zone to building |
| 324 | Transformation GeometryTranslator::zoneTransformation(const WorkspaceObject& zone) const { |
no test coverage detected