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

Method buildingTransformation

src/energyplus/GeometryTranslator.cpp:305–321  ·  view source on GitHub ↗

get the transformation from building to world

Source from the content-addressed store, hash-verified

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 {

Callers 4

convertSimpleShadingMethod · 0.95
convertSimpleSurfacesMethod · 0.95

Calls 5

degToRadFunction · 0.85
Vector3dClass · 0.50
getObjectsByTypeMethod · 0.45
sizeMethod · 0.45
getDoubleMethod · 0.45

Tested by

no test coverage detected