-
Notifications
You must be signed in to change notification settings - Fork 0
Adds geometry-related functions & tests #3
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
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
a3e8b7c
Adds geometry-related functions & tests
brgix aad82a5
Implements basic 3DVector functions (untested)
brgix c77bcf1
Fixes is_same ('0' as valid list index)
brgix e842406
Implements width/height functions, tests triangulation
brgix 0ba39ac
Adds (yet untested) line segment functions
brgix 8d82211
Rehauls vestibule, plenum conditional checks (tested)
brgix d4e0bd0
Reinstates previous tests
brgix 394a4e5
Completes (tested) ULC & BLC
brgix 8266f63
Fixes & tests collinearity methods
brgix aae7307
Fixes & tests point-line intersection methods
brgix 5ba1ace
Adds a handful of boolean functions
brgix 9f41e35
First try at 'overlaps' - buggy for now
brgix 838fb59
Fixes overlap method - initial tests only
brgix 34ad038
Minor cleanup - post overlap fix
brgix 1f8df35
Partial refactor of 'overlap' (tested)
brgix 8ea89c7
Adds (yet untested) 'offset' & 'outline' methods
brgix 82028fb
Initial tests of 'bounded boxes' methods
brgix d36561c
Tweaks 'overlap' (more testing needed)
brgix 623ebbb
Completes 'fits' & 'overlap' method testing
brgix 33600d1
Completes segments, triads and orientation tests
brgix 9d44c8a
Initial implementation of 'realignedFace' (untested)
brgix 9a4c20e
Completes 'poly' attributes testing
brgix c88bea5
Completes model transformation tests
brgix 2f8ab94
Adds (getter) 'roofs' (tested)
brgix d49f52a
Adds 'isDaylit' (untested)
brgix 8f27186
Minor cleanup
brgix 89ba373
Partial implementation of convexity tests
brgix 635adfd
Implements 'addSubs' (initial testing, more to come ...)
brgix 4fba8e3
Merge branch 'geo' of https://github.com/rd2/pyOSut into geo
brgix 1e4a90a
Updates pyproject.toml
brgix a0bf359
Adds numpy (dependency) in GH Actions pull_request.yml
brgix f838db4
Further testing of 'addSubs' (control case)
brgix 4f57555
Completes 1st round of 'addSubs' testing
brgix b331905
Completes aligned width/height tests
brgix 3f8ec9a
Completes 'WWR insertion' tests
brgix 765d328
Completes 'genShade' fixes/tests
brgix fd3c2d4
Adds 'grossRoofArea' and 'getHorizontalRidges' (untested)
brgix e57e6b6
Adds 'toToplit' - yet untested
brgix 45e1cbd
Adds 'genAnchors' - untested
brgix 7108439
Adds 'genextendedvertices' - untested
brgix 11397bb
Sets up 'addSkylights', fixes 'overlap'
brgix ef390a8
First draft of 'addSkylights': inoperable/inactive for now ...
brgix bfc9440
Purges 'set' variables (conflict with built-in)
brgix fb86a4b
First 'addSkylights' test 'green' (more to come)
brgix 0d99847
Fixes (inter alia) ceiling leader lines (skylights)
brgix 52dc079
Fixes roof leader line issues
brgix a6bca1b
Completes 'SmallOffice' skylight unittests
brgix 60f9f6f
Completes 'SEB' addSkylights unittest
brgix 62ec271
Completes 'Warehouse' addSkylights unittest
brgix 3a1e4f7
Pre-merge cleanup (e.g. resequencing functions)
brgix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5283,6 +5283,64 @@ def test34_generated_skylight_wells(self): | |
| self.assertEqual(o.status(), 0) | ||
| del model | ||
|
|
||
| # --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # | ||
| path = openstudio.path("./tests/files/osms/in/warehouse.osm") | ||
| model = translator.loadModel(path) | ||
| self.assertTrue(model) | ||
| model = model.get() | ||
|
|
||
| for space in model.getSpaces(): | ||
| ide = space.nameString() | ||
| if not space.partofTotalFloorArea(): continue | ||
|
|
||
| sidelit = osut.isDaylit(space, True, False) | ||
| toplit = osut.isDaylit(space, False) | ||
| if "Office" in ide: self.assertTrue(sidelit) | ||
| if "Storage" in ide: self.assertFalse(sidelit) | ||
| if "Office" in ide: self.assertFalse(toplit) | ||
| if "Storage" in ide: self.assertTrue(toplit) | ||
|
|
||
| bulk = model.getSpaceByName("Zone3 Bulk Storage") | ||
| fine = model.getSpaceByName("Zone2 Fine Storage") | ||
| self.assertTrue(bulk) | ||
| self.assertTrue(fine) | ||
| bulk = bulk.get() | ||
| fine = fine.get() | ||
|
|
||
| # No overhangs/attics. Calculation of roof area for SRR% is more intuitive. | ||
| gra_bulk = osut.grossRoofArea(bulk) | ||
| gra_fine = osut.grossRoofArea(fine) | ||
|
|
||
| bulk_roof_m2 = sum([ruf.grossArea() for ruf in osut.roofs(bulk)]) | ||
| fine_roof_m2 = sum([ruf.grossArea() for ruf in osut.roofs(fine)]) | ||
| self.assertAlmostEqual(gra_bulk, bulk_roof_m2, places=2) | ||
| self.assertAlmostEqual(gra_fine, fine_roof_m2, places=2) | ||
|
|
||
| # Initial SSR%. | ||
| bulk_skies = osut.facets(bulk, "Outdoors", "Skylight") | ||
| sky_area1 = sum([sk.grossArea() for sk in bulk_skies]) | ||
| ratio1 = sky_area1 / bulk_roof_m2 | ||
| self.assertAlmostEqual(sky_area1, 47.57, places=2) | ||
| self.assertAlmostEqual(ratio1, 0.01, places=2) | ||
|
|
||
| srr = 0.04 | ||
| opts = {} | ||
| opts["srr" ] = srr | ||
| opts["size" ] = 2.4 | ||
| opts["clear"] = True | ||
| rm2 = osut.addSkyLights(bulk, opts) | ||
|
|
||
| bulk_skies = osut.facets(bulk, "Outdoors", "Skylight") | ||
| sky_area2 = sum([sk.grossArea() for sk in bulk_skies]) | ||
| self.assertAlmostEqual(sky_area2, 128.19, places=2) | ||
| ratio2 = sky_area2 / rm2 | ||
| self.assertAlmostEqual(ratio2, srr, places=2) | ||
|
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. |
||
|
|
||
| model.save("./tests/files/osms/out/warehouse_sky.osm", True) | ||
|
|
||
| self.assertEqual(o.status(), 0) | ||
| del model | ||
|
|
||
| def test35_facet_retrieval(self): | ||
| o = osut.oslg | ||
| self.assertEqual(o.status(), 0) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

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.
Annoyed that Ruby'esque quirks remain in the Python implementation. Only catching these with runtime errors - my bad.
Otherwise, all unit tests (matching prior Ruby OSut unit tests) are green.
May test other US DOE Prototypes (and possible Canadian DND models) before merging.