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

Function intersectSurfaces

src/model/Space.cpp:4040–4057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4038 /// @endcond
4039
4040 void intersectSurfaces(std::vector<Space>& t_spaces) {
4041 std::vector<Space> spaces(t_spaces);
4042 std::sort(spaces.begin(), spaces.end(), [](const Space& a, const Space& b) -> bool { return a.floorArea() < b.floorArea(); });
4043
4044 std::vector<BoundingBox> bounds;
4045 for (const Space& space : spaces) {
4046 bounds.push_back(space.transformation() * space.boundingBox());
4047 }
4048
4049 for (unsigned i = 0; i < spaces.size(); ++i) {
4050 for (unsigned j = i + 1; j < spaces.size(); ++j) {
4051 if (!bounds[i].intersects(bounds[j])) {
4052 continue;
4053 }
4054 spaces[i].intersectSurfaces(spaces[j]);
4055 }
4056 }
4057 }
4058
4059 void matchSurfaces(std::vector<Space>& spaces) {
4060 std::vector<BoundingBox> bounds;

Callers 2

TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 9

beginMethod · 0.80
intersectsMethod · 0.80
intersectSurfacesMethod · 0.80
endMethod · 0.45
floorAreaMethod · 0.45
push_backMethod · 0.45
transformationMethod · 0.45
boundingBoxMethod · 0.45
sizeMethod · 0.45

Tested by 2

TEST_FFunction · 0.68
TEST_FFunction · 0.68