OpenStudio 3.1 erases surfaces when surface matching. Not present in OpenStudio 2.9
See the image below for context. At the top, you'll see the model before surface matching. Below, you'll see the model in OS 2.9 and in 3.1. You'll notice how the boundary condition for the floors changes to Surface
for all the surfaces except a sliver that remains adjacent to Ground
.
If you look at the roof surfaces, you'll notice this sliver is now missing altogether in OS 3.1.
I'm unsure why this is happening. Here is a clue I get when doing the intersect surfaces in OS 3.1
[openstudio.model.Surface] <1> Initial area of surface 'Surface 18' 646.605 does not equal post intersection area 646.605
Things I have checked:
- The order in which spaces are matched is identical
- Both versions of OpenStudio agree upon which spaces intersect.
- The OpenStudio methods
OpenStudio::Model.intersectSurfaces(spaces)
andOpenStudio::Model.matchSurfaces(spaces)
do not resolve the issue (they made it worse somehow, not sure why).
LINK TO MINIMUM WORKING EXAMPLE:
https://github.com/jugonzal07/stack_o...
Meat of the surface code is under match_spaces
on L95
def match_spaces(spaces)
# Sort spaces for consistency between models
spaces = sort_spaces(spaces)
n = spaces.size
boundingBoxes = []
(0...n).each do |i|
boundingBoxes[i] = spaces[i].transformation * spaces[i].boundingBox
end
(0...n).each do |i|
(i+1...n).each do |j|
next unless boundingBoxes[i].intersects(boundingBoxes[j])
puts "#{spaces[i].name.to_s} intersects #{spaces[j].name.to_s}"
spaces[i].intersectSurfaces(spaces[j])
spaces[i].matchSurfaces(spaces[j])
end #j
end #i
end
@jugonzal07 is this a result of surface matching via SketchUp plug-in or an OpenStudio measure? Both would use Ruby.
hi Aaron - this is being done with the OpenStudio SDK. In the code snippet I posted, you can see
spaces[i].intersectSurfaces(spaces[j])
andspaces[i].matchSurfaces(spaces[j])
. That is where the surface intersecting and matching happens.@jugonzal07 thanks for all the details. The surface matching doesn't alter surface geometry, but only the outside boundary condition field and the outside condition object. This is definitely from intersection which does alter geometry. We have been working to improve it, and have added in some additional logging that you have seen, but in some fixes we go fix some instances, but create new issues. In your repo, I assume can test with either of the OSM files with
before
in the name, but didn't know whatos_matching_method.osm
was for.[Issue filed.](https://github.com/NREL/OpenStudio/issues/4526)
oh, sorry about that! I didn't mean to add
os_matching_method.osm
to the repo. That was a dummy file I was using to test different ideas.