-
Notifications
You must be signed in to change notification settings - Fork 2
Fixes spaceWidth #27
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
Fixes spaceWidth #27
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4825,7 +4825,7 @@ def spaceWidth(space = nil) | |
| end | ||
| end | ||
|
|
||
| res = realignedFace(polyg.to_a.reverse) | ||
| res = realignedFace(polyg.to_a.reverse, true) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A gross omission, inserted more than 12 months ago. Forcing |
||
| 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' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Basic tests demonstrating that |
||
|
|
||
| # --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # | ||
| file = File.join(__dir__, "files/osms/in/warehouse.osm") | ||
| path = OpenStudio::Path.new(file) | ||
| model = translator.loadModel(path) | ||
|
|
||
There was a problem hiding this comment.
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.