Skip to content

Commit

Permalink
Merge pull request #114 from rd2/osut050
Browse files Browse the repository at this point in the history
Pulls OSut v0.5.0
  • Loading branch information
brgix authored Apr 17, 2024
2 parents 402f9f5 + f15492e commit 9899a55
Show file tree
Hide file tree
Showing 14 changed files with 4,402 additions and 1,172 deletions.
12 changes: 6 additions & 6 deletions lib/measures/tbd/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>tbd_measure</name>
<uid>8890787b-8c25-4dc8-8641-b6be1b6c2357</uid>
<version_id>bd35a453-60b3-4329-9699-3c7e8e49b5bf</version_id>
<version_modified>2024-01-01T12:58:55Z</version_modified>
<version_id>4eec2792-b3ef-4152-95c8-a7dd6a6bf9c4</version_id>
<version_modified>2024-04-17T14:29:06Z</version_modified>
<xml_checksum>99772807</xml_checksum>
<class_name>TBDMeasure</class_name>
<display_name>Thermal Bridging and Derating - TBD</display_name>
Expand Down Expand Up @@ -499,7 +499,7 @@
<filename>geo.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>1D9996A0</checksum>
<checksum>6C7ACC99</checksum>
</file>
<file>
<filename>geometry.rb</filename>
Expand All @@ -517,13 +517,13 @@
<filename>oslog.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>E4978588</checksum>
<checksum>8CD57B9A</checksum>
</file>
<file>
<filename>psi.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>9B29CA06</checksum>
<checksum>5ABDEC60</checksum>
</file>
<file>
<filename>tbd.rb</filename>
Expand All @@ -547,7 +547,7 @@
<filename>utils.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>7385DFE0</checksum>
<checksum>E3B4AF4B</checksum>
</file>
<file>
<filename>version.rb</filename>
Expand Down
10 changes: 5 additions & 5 deletions lib/measures/tbd/resources/geo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def faces(s = {}, e = {})
#
# @return [Topolys::Vector3D] true normal vector of s
# @return [nil] if invalid input (see logs)
def trueNormal(s = nil, r = 0)
def truNormal(s = nil, r = 0)
mth = "TBD::#{__callee__}"
cl = OpenStudio::Model::PlanarSurface
return mismatch("surface", s, cl, mth) unless s.is_a?(cl)
Expand Down Expand Up @@ -285,18 +285,18 @@ def properties(surface = nil, argh = {})
surf = {}
subs = {}
fd = false
return invalid("#{nom}", mth, 1, FTL) if poly(surface).empty?
return invalid("#{nom}", mth, 1, ERR) if poly(surface).empty?
return empty("#{nom} space", mth, ERR) if surface.space.empty?

space = surface.space.get
stype = space.spaceType
story = space.buildingStory
tr = transforms(space)
return invalid("#{nom} transform", mth, 0, FTL) unless tr[:t] && tr[:r]
return invalid("#{nom} transform", mth, 0, ERR) unless tr[:t] && tr[:r]

t = tr[:t]
n = trueNormal(surface, tr[:r])
return invalid("#{nom} normal", mth, 0, FTL) unless n
n = truNormal(surface, tr[:r])
return invalid("#{nom} normal", mth, 0, ERR) unless n

type = surface.surfaceType.downcase
facing = surface.outsideBoundaryCondition
Expand Down
2 changes: 1 addition & 1 deletion lib/measures/tbd/resources/oslog.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BSD 3-Clause License
#
# Copyright (c) 2022-2023, Denis Bourgeois
# Copyright (c) 2022-2024, Denis Bourgeois
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down
24 changes: 9 additions & 15 deletions lib/measures/tbd/resources/psi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1598,14 +1598,14 @@ def process(model = nil, argh = {})
tr = transforms(group)
t = tr[:t] if tr[:t] && tr[:r]

log(FTL, "Can't process '#{id}' transformation (#{mth})") unless t
return tbd unless t
log(ERR, "Can't process '#{id}' transformation (#{mth})") unless t
next unless t

space = group.space
tr[:r] += space.get.directionofRelativeNorth unless space.empty?
n = trueNormal(s, tr[:r])
log(FTL, "Can't process '#{id}' true normal (#{mth})") unless n
return tbd unless n
n = truNormal(s, tr[:r])
log(ERR, "Can't process '#{id}' true normal (#{mth})") unless n
next unless n

points = (t * s.vertices).map { |v| Topolys::Point3D.new(v.x, v.y, v.z) }

Expand Down Expand Up @@ -1695,14 +1695,10 @@ def process(model = nil, argh = {})
dx = (origin.x - terminal.x).abs
dy = (origin.y - terminal.y).abs
dz = (origin.z - terminal.z).abs
horizontal = dz.abs < TOL
horizontal = dz < TOL
vertical = dx < TOL && dy < TOL
edge_V = terminal - origin

if edge_V.magnitude < TOL
invalid("1x edge length < TOL", mth, 0, ERROR)
next
end
next if edge_V.magnitude < TOL

edge_plane = Topolys::Plane3D.new(origin, edge_V)

Expand Down Expand Up @@ -1766,10 +1762,8 @@ def process(model = nil, argh = {})
farthest_V = origin_point_V if farther
end

angle = reference_V.angle(farthest_V)
invalid("#{id} polar angle", mth, 0, ERROR, 0) if angle.nil?
angle = 0 if angle.nil?

angle = reference_V.angle(farthest_V)
angle = 0 if angle.nil?
adjust = false # adjust angle [180°, 360°] if necessary

if vertical
Expand Down
Loading

0 comments on commit 9899a55

Please sign in to comment.