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

Method skylightToProjectedFloorRatio

src/model/Surface.cpp:1535–1562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1533 }
1534
1535 double Surface_Impl::skylightToProjectedFloorRatio() const {
1536 double result = 0.0;
1537
1538 if (!istringEqual(this->surfaceType(), "RoofCeiling")) {
1539 return result;
1540 }
1541
1542 Point3dVector vertices = this->vertices();
1543 Plane horizontal(Point3d(0, 0, 0), Vector3d(0, 0, 1));
1544 std::vector<Point3d> projectedVertics = horizontal.project(vertices);
1545
1546 boost::optional<double> grossArea = getArea(projectedVertics);
1547
1548 if (!grossArea || grossArea.get() == 0) {
1549 return result;
1550 }
1551
1552 double skylightArea = 0.0;
1553 for (const SubSurface& subSurface : this->subSurfaces()) {
1554 if (istringEqual(subSurface.subSurfaceType(), "Skylight")) {
1555 skylightArea += subSurface.multiplier() * subSurface.netArea();
1556 }
1557 }
1558
1559 result = skylightArea / grossArea.get();
1560
1561 return result;
1562 }
1563
1564 boost::optional<SubSurface> Surface_Impl::setWindowToWallRatio(double wwr) {
1565 return setWindowToWallRatio(wwr, 0.762, true);

Callers 1

TEST_FFunction · 0.80

Calls 12

surfaceTypeMethod · 0.95
subSurfacesMethod · 0.95
istringEqualFunction · 0.85
getAreaFunction · 0.85
subSurfaceTypeMethod · 0.80
Point3dClass · 0.70
Vector3dClass · 0.70
verticesMethod · 0.45
projectMethod · 0.45
getMethod · 0.45
multiplierMethod · 0.45
netAreaMethod · 0.45

Tested by 1

TEST_FFunction · 0.64