Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry improvements #4221

Merged
merged 90 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
cc3a0b7
Polygon3d class with various useful methods (area etc). join method t…
ggartside Feb 22, 2021
b160f4b
Fnishes joinAll for Polygon3d. Added uniut test to repro issue 1614 a…
ggartside Feb 22, 2021
c8b56ff
Some basic Polygon3d unit tests in Geometry
ggartside Feb 22, 2021
00f711b
Merge branch 'develop' into Geometry_Improvements
ggartside Feb 22, 2021
5d1d00f
Changed the names of class methods for Polygon3d to match naming con…
ggartside Feb 24, 2021
2df7b7e
Added joinAllPolygons method that takes Point3dVectors as arguments a…
ggartside Feb 24, 2021
08b8946
Fixes an accidenmtal compile error
ggartside Feb 24, 2021
784f028
Fixes a compile error reported in the pull request
ggartside Feb 24, 2021
f2b8d95
Fixing cppcheck/clang format issues
ggartside Feb 24, 2021
3ae5b31
clang-format (with clang-format-12)
jmarrec Feb 25, 2021
5550a1d
Fix some cppcheck errors
jmarrec Feb 25, 2021
ea25e0e
These are reported as cppcheck style warnings (unused variables). Con…
jmarrec Feb 25, 2021
78c96eb
Renamed more methods to conform to coding standards (removed get prefix)
ggartside Feb 25, 2021
ced8117
joinAllPolygons was broken by a rename
ggartside Feb 25, 2021
8b86198
Update src/utilities/geometry/Polygon.cpp to use size_t to avoid -Wer…
jmarrec Feb 25, 2021
3ac5f46
adding joinAllWithBuffer
ggartside Mar 8, 2021
d234a47
Merge differences from recent pull
ggartside Mar 8, 2021
3371648
Updated comments, added new Polygon3d constructor. Hoping thios one g…
ggartside Mar 8, 2021
e004637
Merge remote-tracking branch 'origin/develop' into Geometry_Improvements
jmarrec Mar 9, 2021
15db807
Lint geometry_improvements and use const refs + rename to NewallVector
jmarrec Mar 9, 2021
5f7742b
Merge pull request #4238 from NREL/geometry_improvements_mod
ggartside Mar 9, 2021
d2a075f
Adds method removeSpikesEx. This method uses buffer to shrink and exp…
ggartside Mar 9, 2021
362bb8d
Merges joinAllWithBuffer branch (2527)
ggartside Mar 9, 2021
dca4325
Removes unused variables that are causing buildind fails
ggartside Mar 11, 2021
8b5e98a
One last effort to fix these warnings
ggartside Mar 12, 2021
212aea6
Added RemoveSpikesAndOverlaps test to verify removeSpikes fixes issue…
ggartside Mar 15, 2021
9d3b85f
Suppress cppcheck warnings
jmarrec Mar 16, 2021
947ef2e
Fix build error. The OSM file(s) referenced isn't in source control t…
jmarrec Mar 16, 2021
b68c10a
Fix build error in Intersection_GTest due to unused variables
jmarrec Mar 16, 2021
51d5648
Fix more issues in Space_GTest
jmarrec Mar 16, 2021
9dfc54a
Give an example of how to register and use test OSM(s) for use in test.
jmarrec Mar 16, 2021
94f4521
clang format [chore]
jmarrec Mar 16, 2021
fe52006
Merge remote-tracking branch 'upstream/develop' into Geometry_Improve…
jmarrec Mar 16, 2021
d7ff466
Adds stripped down test for removing spikes where process was stuck i…
ggartside Mar 19, 2021
7c2cb9a
Added overlap method to Polygon3d. Created Polygon3d_overlap unit test
ggartside Mar 22, 2021
1553650
Create example of selectively adding tests for windows only
kbenne Mar 22, 2021
ac2580c
Adds a unit test for calculating exposed perimeter
ggartside Mar 22, 2021
7060587
Adds exterior perimeter to Building and space
ggartside Mar 23, 2021
b19f89d
Renamed Space.exposedPerimeter added call to ExposedPerimeter test
ggartside Mar 23, 2021
4d95d0f
Using unused variable result2
ggartside Mar 23, 2021
82ee291
Merge branch 'Geometry_Improvements' of https://github.com/NREL/OpenS…
ggartside Mar 23, 2021
260901d
Polygon.overlap, Building.exteriorPerimeter, Space.exposedPerimeter, …
ggartside Mar 23, 2021
c6da5c5
Adds a test to repro 1683, adds a test to repro 3982, ensures all Geo…
ggartside Mar 23, 2021
8e3acb3
Removed surface shattering test as it is not in the current scope
ggartside Mar 23, 2021
d52f56f
(Hopefully) removed warnings that translate into errors
ggartside Mar 23, 2021
d9e2a59
Exzclude two tests that rely on model files (one takes 16 minutes to …
ggartside Mar 24, 2021
6785082
clang-format changes
ggartside Mar 24, 2021
08e7d19
Added unit test for 3982 - am not getting any triangulated surfaces b…
ggartside Mar 24, 2021
d01ea5f
Unit test for issue 2560, changes to Geometry.i
ggartside Mar 24, 2021
0e025e9
Test for issue 3982
ggartside Mar 25, 2021
1e00fee
Adds unit test for issue 2560
ggartside Mar 25, 2021
480971b
Fixes to unit tests Issue_3982 and Surface_Intersect_ConcaveSurfaces …
ggartside Mar 25, 2021
e1e1429
Adjust BoundingBox intersection tolerance to 10mm from 1mm.
ggartside Mar 25, 2021
78dc6d8
Renamed Polygon.hpp(cpp) -> Polygon3d.hpp(cpp)
ggartside Mar 25, 2021
b624855
Relaxes the tolerances for the area check in Surface::comupteIntersec…
ggartside Mar 26, 2021
dba1300
Merge branch 'GeometryShared' into Geometry_Improvements
ggartside Mar 26, 2021
3d768ef
Fixes a build/merge issue
ggartside Mar 26, 2021
05a44a9
clang!!!
ggartside Mar 26, 2021
feed490
Fixes issues that are causing Space_intersectSurfaces_degenerate2 to …
ggartside Mar 26, 2021
d17df78
Adds exposedPerimeter for Surface
ggartside Mar 29, 2021
b5657e1
Formatting corrections
ggartside Mar 29, 2021
28f842a
Added ruby tests for the geometry improvements
ggartside Mar 31, 2021
8474eb1
Changes geometry.i for polygon3d
ggartside Mar 31, 2021
4f4c7fc
SOm enew tests some updated tests
ggartside Mar 31, 2021
d94a96c
Moved model files to resources/model, updated cmake file
ggartside Mar 31, 2021
0f38555
Removing failing tests
ggartside Mar 31, 2021
bf23615
Fixes error in file name
ggartside Mar 31, 2021
c0e8704
Fixing a missing swig type optional Point3dVectorVector
ggartside Apr 5, 2021
33ae7be
Merge branch 'develop' into Geometry_Improvements
jmarrec Apr 7, 2021
5777ebb
Whitespace changes in ruby tests
jmarrec Apr 7, 2021
8a4a5d3
Use correct name for `7-7_Windows_Complete.osm`
jmarrec Apr 7, 2021
ddf711b
Adjust and disable via commenting all saving of output (which is for …
jmarrec Apr 7, 2021
fb25ab9
Infer where to save, but also disable saving models in ruby test (thi…
jmarrec Apr 7, 2021
ef3201b
Some cleanup in comments
jmarrec Apr 7, 2021
52daa4f
Space_Gtest: use EXPECT_ insert of ASSERT_ where possible
jmarrec Apr 7, 2021
0ba9769
Space_Gtest: Remove macro code: enable tests on other than win32. For…
jmarrec Apr 7, 2021
2f1fa96
change model version back down to 3.1.0 (or they won't load, 3.1.1 is…
jmarrec Apr 7, 2021
284002c
Move disabled tests at end. surface shattering fails (logically), the…
jmarrec Apr 7, 2021
ac3d471
TEMPORARY: change jenkinsfile to point to the geometry_improvements b…
jmarrec Apr 7, 2021
c32ba21
output log file in a folder that exists.
jmarrec Apr 7, 2021
ad99016
Use const ref where possible, remove unused variables, break one-line…
jmarrec Apr 7, 2021
0be4881
Change comments in Surface by adjusting units from mm2 to cm2 as I th…
jmarrec Apr 7, 2021
8c07f5a
Use std::abs(float) instead of cstdlib abs(int)
jmarrec Apr 7, 2021
eed6954
Remove kyle's example of selectively adding test files in CMakeLists.txt
jmarrec Apr 7, 2021
f7ca31e
Merge pull request #4275 from NREL/Geometry_improvements_review
tijcolem Apr 7, 2021
1063eb0
Added method to create a test model for perimeter calculations, rempv…
ggartside Apr 8, 2021
7efb19f
Merge develop to branch
ggartside Apr 9, 2021
26ee1fc
Resolved merge conflicts
ggartside Apr 9, 2021
fa14e8a
Fixed clan clanger (all clang did was remove an extra blank line from…
ggartside Apr 9, 2021
debd914
Added ruby scripts that create the floorplan_school model via the api
ggartside Apr 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ developer/msvc/Visualizers/all_concat.natvis
.clangd/
cppcheck.txt*
clang_format.patch
/0003-Added-ruby-tests-for-the-geometry-improvements.patch
/0002-Formatting-corrections.patch
/0001-Adds-exposedPerimeter-for-Surface.patch
2 changes: 1 addition & 1 deletion Jenkinsfile_develop_osx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs

@Library('cbci_shared_libs') _
@Library('cbci_shared_libs@geometry_improvements') _

// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) {
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile_develop_ubuntu_1804
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs

@Library('cbci_shared_libs') _
@Library('cbci_shared_libs@geometry_improvements') _

// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) {
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile_develop_ubuntu_2004
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs

@Library('cbci_shared_libs') _
@Library('cbci_shared_libs@geometry_improvements') _

// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) {
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile_develop_windows
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Jenkins pipelines are stored in shared libaries. Please see: https://github.com/NREL/cbci_jenkins_libs

@Library('cbci_shared_libs') _
@Library('cbci_shared_libs@geometry_improvements') _

// Build for PR to develop branch only.
if ((env.CHANGE_ID) && (env.CHANGE_TARGET) ) {
Expand Down
5 changes: 5 additions & 0 deletions resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ set(ENERGYPLUS_OUTPUTS "")
set(model_resources_src
model/OpenStudio.idd
model/schedulefile.csv

model/two_stories_pre_intersect.osm
jmarrec marked this conversation as resolved.
Show resolved Hide resolved
model/floorplan_school.osm
model/7-7_Windows_Complete.osm
jmarrec marked this conversation as resolved.
Show resolved Hide resolved
model/15023_Model12.osm
)


Expand Down
55,540 changes: 55,540 additions & 0 deletions resources/model/15023_Model12.osm

Large diffs are not rendered by default.

81,406 changes: 81,406 additions & 0 deletions resources/model/7-7_Windows_Complete.osm

Large diffs are not rendered by default.

4,468 changes: 4,468 additions & 0 deletions resources/model/floorplan_school.osm

Large diffs are not rendered by default.

Empty file.
292 changes: 292 additions & 0 deletions ruby/test/Building_exteriorPerimeter_Test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
########################################################################################################################
# OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with the distribution.
#
# (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
# derived from this software without specific prior written permission from the respective party.
#
# (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
# may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
# written permission from Alliance for Sustainable Energy, LLC.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
# STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS OF
# USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
########################################################################################################################
require 'openstudio'
require_relative 'model.rb'
require 'logger'
require 'openstudio/measure/ShowRunnerOutput'
require 'fileutils'
require 'minitest/autorun'
require 'csv'

class Building_exteriorPerimeter_Test < Minitest::Test
def test_Building_exteriorPerimeter

model = OpenStudio::Model::Model.new

tz1 = OpenStudio::Model::ThermalZone.new(model)
story1 = OpenStudio::Model::BuildingStory.new(model)

p1 = OpenStudio::Point3dVector.new


p1.push(OpenStudio::Point3d.new(36, 168, 0))
p1.push(OpenStudio::Point3d.new(36, 138, 0))
p1.push(OpenStudio::Point3d.new(0, 138, 0))
p1.push(OpenStudio::Point3d.new(0, 168, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 101")

p1.clear()
p1.push(OpenStudio::Point3d.new(220, 168, 0))
p1.push(OpenStudio::Point3d.new(220, 150, 0))
p1.push(OpenStudio::Point3d.new(220, 124, 0))
p1.push(OpenStudio::Point3d.new(220, 70, 0))
p1.push(OpenStudio::Point3d.new(220, 30, 0))
p1.push(OpenStudio::Point3d.new(200, 30, 0))
p1.push(OpenStudio::Point3d.new(200, 168, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Mechanical 114")

p1.clear()
p1.push(OpenStudio::Point3d.new(288, 70, 0))
p1.push(OpenStudio::Point3d.new(288, 0, 0))
p1.push(OpenStudio::Point3d.new(220, 0, 0))
p1.push(OpenStudio::Point3d.new(220, 30, 0))
p1.push(OpenStudio::Point3d.new(220, 70, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Offices 117")

p1.clear()
p1.push(OpenStudio::Point3d.new(288, 124, 0))
p1.push(OpenStudio::Point3d.new(288, 70, 0))
p1.push(OpenStudio::Point3d.new(220, 70, 0))
p1.push(OpenStudio::Point3d.new(220, 124, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Gym 118")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 168, 0))
p1.push(OpenStudio::Point3d.new(158, 138, 0))
p1.push(OpenStudio::Point3d.new(98, 138, 0))
p1.push(OpenStudio::Point3d.new(98, 168, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Artroom 103")

p1.clear()
p1.push(OpenStudio::Point3d.new(288, 150, 0))
p1.push(OpenStudio::Point3d.new(288, 124, 0))
p1.push(OpenStudio::Point3d.new(220, 124, 0))
p1.push(OpenStudio::Point3d.new(220, 150, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Kitchen 119")

p1.clear()
p1.push(OpenStudio::Point3d.new(288, 200, 0))
p1.push(OpenStudio::Point3d.new(288, 150, 0))
p1.push(OpenStudio::Point3d.new(220, 150, 0))
p1.push(OpenStudio::Point3d.new(220, 168, 0))
p1.push(OpenStudio::Point3d.new(220, 200, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Cafeteria 120")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 138, 0))
p1.push(OpenStudio::Point3d.new(158, 128, 0))
p1.push(OpenStudio::Point3d.new(36, 128, 0))
p1.push(OpenStudio::Point3d.new(0, 128, 0))
p1.push(OpenStudio::Point3d.new(0, 138, 0))
p1.push(OpenStudio::Point3d.new(36, 138, 0))
p1.push(OpenStudio::Point3d.new(98, 138, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Corridor 104")

p1.clear()
p1.push(OpenStudio::Point3d.new(36, 128, 0))
p1.push(OpenStudio::Point3d.new(36, 98, 0))
p1.push(OpenStudio::Point3d.new(0, 98, 0))
p1.push(OpenStudio::Point3d.new(0, 128, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 105")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 128, 0))
p1.push(OpenStudio::Point3d.new(158, 98, 0))
p1.push(OpenStudio::Point3d.new(36, 98, 0))
p1.push(OpenStudio::Point3d.new(36, 128, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 106")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 30, 0))
p1.push(OpenStudio::Point3d.new(158, 40, 0))
p1.push(OpenStudio::Point3d.new(158, 70, 0))
p1.push(OpenStudio::Point3d.new(158, 98, 0))
p1.push(OpenStudio::Point3d.new(158, 128, 0))
p1.push(OpenStudio::Point3d.new(158, 138, 0))
p1.push(OpenStudio::Point3d.new(158, 168, 0))
p1.push(OpenStudio::Point3d.new(200, 168, 0))
p1.push(OpenStudio::Point3d.new(200, 30, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Corridor 107")

p1.clear()
p1.push(OpenStudio::Point3d.new(36, 40, 0))
p1.push(OpenStudio::Point3d.new(36, 70, 0))
p1.push(OpenStudio::Point3d.new(158, 70, 0))
p1.push(OpenStudio::Point3d.new(158, 40, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 108")

p1.clear()
p1.push(OpenStudio::Point3d.new(0, 40, 0))
p1.push(OpenStudio::Point3d.new(0, 70, 0))
p1.push(OpenStudio::Point3d.new(36, 70, 0))
p1.push(OpenStudio::Point3d.new(36, 40, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 109")

p1.clear()
p1.push(OpenStudio::Point3d.new(98, 168, 0))
p1.push(OpenStudio::Point3d.new(98, 138, 0))
p1.push(OpenStudio::Point3d.new(36, 138, 0))
p1.push(OpenStudio::Point3d.new(36, 168, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 102")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 40, 0))
p1.push(OpenStudio::Point3d.new(158, 30, 0))
p1.push(OpenStudio::Point3d.new(36, 30, 0))
p1.push(OpenStudio::Point3d.new(0, 30, 0))
p1.push(OpenStudio::Point3d.new(0, 40, 0))
p1.push(OpenStudio::Point3d.new(36, 40, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Corridor 110")

p1.clear()
p1.push(OpenStudio::Point3d.new(36, 30, 0))
p1.push(OpenStudio::Point3d.new(36, 0, 0))
p1.push(OpenStudio::Point3d.new(0, 0, 0))
p1.push(OpenStudio::Point3d.new(0, 30, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 111")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 30, 0))
p1.push(OpenStudio::Point3d.new(158, 0, 0))
p1.push(OpenStudio::Point3d.new(36, 0, 0))
p1.push(OpenStudio::Point3d.new(36, 30, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Classroom 112")

p1.clear()
p1.push(OpenStudio::Point3d.new(158, 0, 0))
p1.push(OpenStudio::Point3d.new(158, 30, 0))
p1.push(OpenStudio::Point3d.new(200, 30, 0))
p1.push(OpenStudio::Point3d.new(220, 30, 0))
p1.push(OpenStudio::Point3d.new(220, 0, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Lobby 113")

p1.clear()
p1.push(OpenStudio::Point3d.new(220, 200, 0))
p1.push(OpenStudio::Point3d.new(220, 168, 0))
p1.push(OpenStudio::Point3d.new(200, 168, 0))
p1.push(OpenStudio::Point3d.new(158, 168, 0))
p1.push(OpenStudio::Point3d.new(158, 200, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Bathroom 115")

p1.clear()
p1.push(OpenStudio::Point3d.new(220, 268, 0))
p1.push(OpenStudio::Point3d.new(220, 200, 0))
p1.push(OpenStudio::Point3d.new(158, 200, 0))
p1.push(OpenStudio::Point3d.new(158, 268, 0))
sp1 = OpenStudio::Model::Space::fromFloorPrint(p1, 13.125, model)
sp1 = sp1.get
sp1.setBuildingStory(story1)
sp1.setThermalZone(tz1)
sp1.setName("Media Center 116")

assert(model)
buildings = model.getBuilding

# buildings.each do |building|
perimeter = buildings.exteriorPerimeter
assert_in_delta(1428.0,perimeter,0.01)
#end
end
end
Loading