tbd 3.4.1 → 3.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pull_request.yml +16 -0
- data/Rakefile +1 -1
- data/lib/measures/tbd/measure.xml +6 -6
- data/lib/measures/tbd/resources/psi.rb +20 -43
- data/lib/measures/tbd/resources/tbd.rb +10 -10
- data/lib/measures/tbd/resources/ua.rb +3 -3
- data/lib/measures/tbd/resources/utils.rb +1354 -895
- data/lib/tbd/psi.rb +20 -43
- data/lib/tbd/ua.rb +3 -3
- data/lib/tbd/version.rb +1 -1
- data/lib/tbd.rb +13 -13
- data/tbd.gemspec +1 -1
- metadata +5 -5
data/lib/tbd/psi.rb
CHANGED
@@ -1717,49 +1717,26 @@ module TBD
|
|
1717
1717
|
t_model.wires.each do |wire|
|
1718
1718
|
next unless surface[:wire] == wire.id # should be a unique match
|
1719
1719
|
|
1720
|
-
normal
|
1721
|
-
normal
|
1722
|
-
normal
|
1723
|
-
farthest
|
1724
|
-
farthest_V
|
1725
|
-
|
1726
|
-
i_origin = wire.points.index(origin)
|
1727
|
-
i_terminal = wire.points.index(terminal)
|
1728
|
-
i_last = wire.points.size - 1
|
1729
|
-
|
1730
|
-
if i_terminal == 0
|
1731
|
-
inverted = true unless i_origin == i_last
|
1732
|
-
elsif i_origin == i_last
|
1733
|
-
inverted = true unless i_terminal == 0
|
1734
|
-
else
|
1735
|
-
inverted = true unless i_terminal - i_origin == 1
|
1736
|
-
end
|
1720
|
+
normal = tbd[:surfaces][id][:n] if tbd[:surfaces].key?(id)
|
1721
|
+
normal = holes[id].attributes[:n] if holes.key?(id)
|
1722
|
+
normal = shades[id][:n] if shades.key?(id)
|
1723
|
+
farthest = Topolys::Point3D.new(origin.x, origin.y, origin.z)
|
1724
|
+
farthest_V = farthest - origin # zero magnitude, initially
|
1725
|
+
farthest_mag = 0
|
1737
1726
|
|
1738
1727
|
wire.points.each do |point|
|
1739
1728
|
next if point == origin
|
1740
1729
|
next if point == terminal
|
1741
1730
|
|
1742
|
-
point_on_plane
|
1743
|
-
origin_point_V
|
1744
|
-
|
1745
|
-
next unless
|
1746
|
-
|
1747
|
-
# Generate a plane between origin, terminal & point. Only consider
|
1748
|
-
# planes that share the same normal as wire.
|
1749
|
-
if inverted
|
1750
|
-
plane = Topolys::Plane3D.from_points(terminal, origin, point)
|
1751
|
-
else
|
1752
|
-
plane = Topolys::Plane3D.from_points(origin, terminal, point)
|
1753
|
-
end
|
1754
|
-
|
1755
|
-
dnx = (normal.x - plane.normal.x).abs
|
1756
|
-
dny = (normal.y - plane.normal.y).abs
|
1757
|
-
dnz = (normal.z - plane.normal.z).abs
|
1758
|
-
next unless dnx < TOL && dny < TOL && dnz < TOL
|
1731
|
+
point_on_plane = edge_plane.project(point)
|
1732
|
+
origin_point_V = point_on_plane - origin
|
1733
|
+
point_V_mag = origin_point_V.magnitude
|
1734
|
+
next unless point_V_mag > TOL
|
1735
|
+
next unless point_V_mag > farthest_mag
|
1759
1736
|
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1737
|
+
farthest = point
|
1738
|
+
farthest_V = origin_point_V
|
1739
|
+
fathest_mag = point_V_mag
|
1763
1740
|
end
|
1764
1741
|
|
1765
1742
|
angle = reference_V.angle(farthest_V)
|
@@ -2125,7 +2102,7 @@ module TBD
|
|
2125
2102
|
end
|
2126
2103
|
|
2127
2104
|
# Label edge as :ceiling if linked to:
|
2128
|
-
# +1 deratable
|
2105
|
+
# +1 deratable surface(s)
|
2129
2106
|
# 1x underatable CONDITIONED floor linked to an unoccupied space
|
2130
2107
|
# 1x adjacent CONDITIONED ceiling linked to an occupied space
|
2131
2108
|
edge[:surfaces].keys.each do |i|
|
@@ -2139,9 +2116,9 @@ module TBD
|
|
2139
2116
|
next if floors[i][:occupied ]
|
2140
2117
|
|
2141
2118
|
ceiling = floors[i][:boundary]
|
2142
|
-
next
|
2143
|
-
next
|
2144
|
-
next
|
2119
|
+
next unless ceilings.key?(ceiling)
|
2120
|
+
next unless ceilings[ceiling][:conditioned]
|
2121
|
+
next unless ceilings[ceiling][:occupied ]
|
2145
2122
|
|
2146
2123
|
other = deratables.first unless deratables.first == id
|
2147
2124
|
other = deratables.last unless deratables.last == id
|
@@ -3308,9 +3285,9 @@ module TBD
|
|
3308
3285
|
match2 = /files/.match(file_paths[1].to_s.strip)
|
3309
3286
|
match = match1 || match2
|
3310
3287
|
|
3311
|
-
if file_paths.size >= 2 && File.
|
3288
|
+
if file_paths.size >= 2 && File.exist?(file_paths[1].to_s.strip) && match
|
3312
3289
|
out_dir = file_paths[1].to_s.strip
|
3313
|
-
elsif !file_paths.empty? && File.
|
3290
|
+
elsif !file_paths.empty? && File.exist?(file_paths.first.to_s.strip)
|
3314
3291
|
out_dir = file_paths.first.to_s.strip
|
3315
3292
|
end
|
3316
3293
|
|
data/lib/tbd/ua.rb
CHANGED
@@ -799,8 +799,8 @@ module TBD
|
|
799
799
|
blc.each do |b|
|
800
800
|
bloc = b1
|
801
801
|
bloc = b2 if b == :b2
|
802
|
-
pro_sum = bloc[:pro].values.
|
803
|
-
ref_sum = bloc[:ref].values.
|
802
|
+
pro_sum = bloc[:pro].values.sum
|
803
|
+
ref_sum = bloc[:ref].values.sum
|
804
804
|
|
805
805
|
if pro_sum > TOL || ref_sum > TOL
|
806
806
|
ratio = nil
|
@@ -1000,7 +1000,7 @@ module TBD
|
|
1000
1000
|
model = "* modèle : #{ua[:file]}" if ua.key?(:file) && lang == :fr
|
1001
1001
|
model += " (v#{ua[:version]})" if ua.key?(:version)
|
1002
1002
|
report << model unless model.empty?
|
1003
|
-
report << "* TBD : v3.4.
|
1003
|
+
report << "* TBD : v3.4.3"
|
1004
1004
|
report << "* date : #{ua[:date]}"
|
1005
1005
|
|
1006
1006
|
if lang == :en
|
data/lib/tbd/version.rb
CHANGED
data/lib/tbd.rb
CHANGED
@@ -31,21 +31,21 @@ rescue LoadError
|
|
31
31
|
require_relative "topolys/version"
|
32
32
|
end
|
33
33
|
|
34
|
-
begin # try to load from the
|
34
|
+
begin # try to load from the OSlg gem
|
35
35
|
require "oslg"
|
36
36
|
rescue LoadError
|
37
37
|
require_relative "oslg/oslog"
|
38
|
-
require_relative "
|
38
|
+
require_relative "oslg/version"
|
39
39
|
end
|
40
40
|
|
41
|
-
begin # try to load from the
|
41
|
+
begin # try to load from the OSut gem
|
42
42
|
require "osut"
|
43
43
|
rescue LoadError
|
44
44
|
require_relative "osut/utils"
|
45
45
|
require_relative "osut/version"
|
46
46
|
end
|
47
47
|
|
48
|
-
begin # try to load from the
|
48
|
+
begin # try to load from the TBD gem
|
49
49
|
require "tbd/psi"
|
50
50
|
require "tbd/geo"
|
51
51
|
require "tbd/ua"
|
@@ -58,16 +58,16 @@ rescue LoadError
|
|
58
58
|
end
|
59
59
|
|
60
60
|
module TBD
|
61
|
-
extend OSut
|
61
|
+
extend OSut # OpenStudio utilities
|
62
62
|
|
63
|
-
TOL = OSut::TOL
|
64
|
-
TOL2 = OSut::TOL2
|
65
|
-
DBG = OSut::DEBUG
|
66
|
-
INF = OSut::INFO
|
67
|
-
WRN = OSut::WARN
|
68
|
-
ERR = OSut::ERR
|
69
|
-
FTL = OSut::FATAL
|
70
|
-
NS =
|
63
|
+
TOL = OSut::TOL.dup # default distance tolerance (m)
|
64
|
+
TOL2 = OSut::TOL2.dup # default area tolerance (m2)
|
65
|
+
DBG = OSut::DEBUG.dup # github.com/rd2/oslg
|
66
|
+
INF = OSut::INFO.dup # github.com/rd2/oslg
|
67
|
+
WRN = OSut::WARN.dup # github.com/rd2/oslg
|
68
|
+
ERR = OSut::ERR.dup # github.com/rd2/oslg
|
69
|
+
FTL = OSut::FATAL.dup # github.com/rd2/oslg
|
70
|
+
NS = OSut::NS.dup # OpenStudio IdfObject nameString method
|
71
71
|
|
72
72
|
extend TBD
|
73
73
|
end
|
data/tbd.gemspec
CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
|
|
30
30
|
|
31
31
|
s.add_dependency "topolys", "~> 0"
|
32
32
|
s.add_dependency "osut", "~> 0"
|
33
|
-
s.add_dependency "json-schema", "~>
|
33
|
+
s.add_dependency "json-schema", "~> 4"
|
34
34
|
|
35
35
|
s.add_development_dependency "bundler", "~> 2.1"
|
36
36
|
s.add_development_dependency "rake", "~> 13.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tbd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Bourgeois & Dan Macumber
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: topolys
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '4'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '4'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,7 +166,7 @@ licenses:
|
|
166
166
|
- MIT
|
167
167
|
metadata:
|
168
168
|
homepage_uri: https://github.com/rd2/tbd
|
169
|
-
source_code_uri: https://github.com/rd2/tbd/tree/v3.4.
|
169
|
+
source_code_uri: https://github.com/rd2/tbd/tree/v3.4.3
|
170
170
|
bug_tracker_uri: https://github.com/rd2/tbd/issues
|
171
171
|
post_install_message:
|
172
172
|
rdoc_options: []
|