Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping out v3.8.0 in favour of v3.11.0.

runs-on: ubuntu-22.04
steps:
- name: Check out repository
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/osut/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4825,7 +4825,7 @@ def spaceWidth(space = nil)
end
end

res = realignedFace(polyg.to_a.reverse)
res = realignedFace(polyg.to_a.reverse, true)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A gross omission, inserted more than 12 months ago. Forcing realignFace to rotate so a polygon bounded box is wider than deeper (vs X-axis).

return 0 if res[:box].nil?

# A bounded box's 'height', at its narrowest, is its 'width'.
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/osut/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 27 additions & 0 deletions spec/osut_tests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic tests demonstrating that spaceWidth (now) always returns the narrower dimension of a space's bounded box.


# --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- #
file = File.join(__dir__, "files/osms/in/warehouse.osm")
path = OpenStudio::Path.new(file)
model = translator.loadModel(path)
Expand Down