diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b0339fb..d0b957a 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -70,7 +70,7 @@ jobs: docker exec -t test bundle update docker exec -t test bundle exec rake docker kill test - test_380x: + test_390x: runs-on: ubuntu-22.04 steps: - name: Check out repository @@ -79,14 +79,14 @@ jobs: run: | echo $(pwd) echo $(ls) - docker pull nrel/openstudio:3.8.0 - docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.8.0 + docker pull nrel/openstudio:3.9.0 + docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.9.0 docker exec -t test pwd docker exec -t test ls docker exec -t test bundle update docker exec -t test bundle exec rake docker kill test - test_390x: + test_310x: runs-on: ubuntu-22.04 steps: - name: Check out repository @@ -95,14 +95,14 @@ jobs: run: | echo $(pwd) echo $(ls) - docker pull nrel/openstudio:3.9.0 - docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.9.0 + docker pull nrel/openstudio:3.10.0 + docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.10.0 docker exec -t test pwd docker exec -t test ls docker exec -t test bundle update docker exec -t test bundle exec rake docker kill test - test_3100x: + test_311x: runs-on: ubuntu-22.04 steps: - name: Check out repository @@ -111,8 +111,8 @@ jobs: run: | echo $(pwd) echo $(ls) - docker pull nrel/openstudio:3.10.0 - docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.10.0 + docker pull nrel/openstudio:3.11.0 + docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.11.0 docker exec -t test pwd docker exec -t test ls docker exec -t test bundle update diff --git a/lib/osut/utils.rb b/lib/osut/utils.rb index 09bb951..2e96f59 100644 --- a/lib/osut/utils.rb +++ b/lib/osut/utils.rb @@ -4825,7 +4825,7 @@ def spaceWidth(space = nil) end end - res = realignedFace(polyg.to_a.reverse) + res = realignedFace(polyg.to_a.reverse, true) return 0 if res[:box].nil? # A bounded box's 'height', at its narrowest, is its 'width'. @@ -4904,7 +4904,7 @@ def genAnchors(s = nil, set = [], tag = :box) # to 'genAnchors'), it inherits key :out - a Hash holding (among others) a # 'realigned' set of points (by default a 'realigned' :box). The latter is # typically generated from an outdoor-facing roof (e.g. when called from - # 'lights'). Subsequent calls to 'genAnchors' may send (as first + # 'addSkylights'). Subsequent calls to 'genAnchors' may send (as first # argument) a corresponding ceiling tile below (also from 'addSkylights'). # Roof vs ceiling may neither share alignment transformation nor space # site transformation identities. All subsequent calls to 'genAnchors' diff --git a/lib/osut/version.rb b/lib/osut/version.rb index 2c1149c..ae7c89d 100644 --- a/lib/osut/version.rb +++ b/lib/osut/version.rb @@ -29,5 +29,5 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. module OSut - VERSION = "0.8.1".freeze + VERSION = "0.8.2".freeze end diff --git a/spec/osut_tests_spec.rb b/spec/osut_tests_spec.rb index 8d4a243..eb1c24a 100644 --- a/spec/osut_tests_spec.rb +++ b/spec/osut_tests_spec.rb @@ -5783,6 +5783,33 @@ module M expect(mod1.level).to eq(DBG) expect(mod1.clean!).to eq(DBG) + # Basic test: 'deep' space (vs X-axis). + vtx = OpenStudio::Point3dVector.new + vtx << OpenStudio::Point3d.new(2,9,1) + vtx << OpenStudio::Point3d.new(2,1,1) + vtx << OpenStudio::Point3d.new(1,1,1) + vtx << OpenStudio::Point3d.new(1,9,1) + + model = OpenStudio::Model::Model.new + space = OpenStudio::Model::Space.new(model) + floor = OpenStudio::Model::Surface.new(vtx, model) + floor.setSpace(space) + expect(mod1.spaceWidth(space).round(2)).to eq(1) + + vtx = OpenStudio::Point3dVector.new + vtx << OpenStudio::Point3d.new(9,2,1) + vtx << OpenStudio::Point3d.new(9,1,1) + vtx << OpenStudio::Point3d.new(1,1,1) + vtx << OpenStudio::Point3d.new(1,2,1) + + # Basic test: 'narrow' space (vs X-axis). + model = OpenStudio::Model::Model.new + space = OpenStudio::Model::Space.new(model) + floor = OpenStudio::Model::Surface.new(vtx, model) + floor.setSpace(space) + expect(mod1.spaceWidth(space).round(2)).to eq(1) + + # --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # file = File.join(__dir__, "files/osms/in/warehouse.osm") path = OpenStudio::Path.new(file) model = translator.loadModel(path)