tbd 3.4.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/tbd/geo.rb CHANGED
@@ -251,7 +251,7 @@ module TBD
251
251
  #
252
252
  # @return [Topolys::Vector3D] true normal vector of s
253
253
  # @return [nil] if invalid input (see logs)
254
- def trueNormal(s = nil, r = 0)
254
+ def truNormal(s = nil, r = 0)
255
255
  mth = "TBD::#{__callee__}"
256
256
  cl = OpenStudio::Model::PlanarSurface
257
257
  return mismatch("surface", s, cl, mth) unless s.is_a?(cl)
@@ -285,18 +285,18 @@ module TBD
285
285
  surf = {}
286
286
  subs = {}
287
287
  fd = false
288
- return invalid("#{nom}", mth, 1, FTL) if poly(surface).empty?
288
+ return invalid("#{nom}", mth, 1, ERR) if poly(surface).empty?
289
289
  return empty("#{nom} space", mth, ERR) if surface.space.empty?
290
290
 
291
291
  space = surface.space.get
292
292
  stype = space.spaceType
293
293
  story = space.buildingStory
294
294
  tr = transforms(space)
295
- return invalid("#{nom} transform", mth, 0, FTL) unless tr[:t] && tr[:r]
295
+ return invalid("#{nom} transform", mth, 0, ERR) unless tr[:t] && tr[:r]
296
296
 
297
297
  t = tr[:t]
298
- n = trueNormal(surface, tr[:r])
299
- return invalid("#{nom} normal", mth, 0, FTL) unless n
298
+ n = truNormal(surface, tr[:r])
299
+ return invalid("#{nom} normal", mth, 0, ERR) unless n
300
300
 
301
301
  type = surface.surfaceType.downcase
302
302
  facing = surface.outsideBoundaryCondition
data/lib/tbd/psi.rb CHANGED
@@ -1598,14 +1598,14 @@ module TBD
1598
1598
  tr = transforms(group)
1599
1599
  t = tr[:t] if tr[:t] && tr[:r]
1600
1600
 
1601
- log(FTL, "Can't process '#{id}' transformation (#{mth})") unless t
1602
- return tbd unless t
1601
+ log(ERR, "Can't process '#{id}' transformation (#{mth})") unless t
1602
+ next unless t
1603
1603
 
1604
1604
  space = group.space
1605
1605
  tr[:r] += space.get.directionofRelativeNorth unless space.empty?
1606
- n = trueNormal(s, tr[:r])
1607
- log(FTL, "Can't process '#{id}' true normal (#{mth})") unless n
1608
- return tbd unless n
1606
+ n = truNormal(s, tr[:r])
1607
+ log(ERR, "Can't process '#{id}' true normal (#{mth})") unless n
1608
+ next unless n
1609
1609
 
1610
1610
  points = (t * s.vertices).map { |v| Topolys::Point3D.new(v.x, v.y, v.z) }
1611
1611
 
@@ -1695,14 +1695,10 @@ module TBD
1695
1695
  dx = (origin.x - terminal.x).abs
1696
1696
  dy = (origin.y - terminal.y).abs
1697
1697
  dz = (origin.z - terminal.z).abs
1698
- horizontal = dz.abs < TOL
1698
+ horizontal = dz < TOL
1699
1699
  vertical = dx < TOL && dy < TOL
1700
1700
  edge_V = terminal - origin
1701
-
1702
- if edge_V.magnitude < TOL
1703
- invalid("1x edge length < TOL", mth, 0, ERROR)
1704
- next
1705
- end
1701
+ next if edge_V.magnitude < TOL
1706
1702
 
1707
1703
  edge_plane = Topolys::Plane3D.new(origin, edge_V)
1708
1704
 
@@ -1766,10 +1762,8 @@ module TBD
1766
1762
  farthest_V = origin_point_V if farther
1767
1763
  end
1768
1764
 
1769
- angle = reference_V.angle(farthest_V)
1770
- invalid("#{id} polar angle", mth, 0, ERROR, 0) if angle.nil?
1771
- angle = 0 if angle.nil?
1772
-
1765
+ angle = reference_V.angle(farthest_V)
1766
+ angle = 0 if angle.nil?
1773
1767
  adjust = false # adjust angle [180°, 360°] if necessary
1774
1768
 
1775
1769
  if vertical
@@ -3314,9 +3308,9 @@ module TBD
3314
3308
  match2 = /files/.match(file_paths[1].to_s.strip)
3315
3309
  match = match1 || match2
3316
3310
 
3317
- if file_paths.size >= 2 && File.exists?(file_paths[1].to_s.strip) && match
3311
+ if file_paths.size >= 2 && File.exist?(file_paths[1].to_s.strip) && match
3318
3312
  out_dir = file_paths[1].to_s.strip
3319
- elsif !file_paths.empty? && File.exists?(file_paths.first.to_s.strip)
3313
+ elsif !file_paths.empty? && File.exist?(file_paths.first.to_s.strip)
3320
3314
  out_dir = file_paths.first.to_s.strip
3321
3315
  end
3322
3316
 
data/lib/tbd/ua.rb CHANGED
@@ -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.0"
1003
+ report << "* TBD : v3.4.2"
1004
1004
  report << "* date : #{ua[:date]}"
1005
1005
 
1006
1006
  if lang == :en
data/lib/tbd/version.rb CHANGED
@@ -21,5 +21,5 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  module TBD
24
- VERSION = "3.4.0".freeze # TBD release version
24
+ VERSION = "3.4.2".freeze # TBD release version
25
25
  end
data/tbd.gemspec CHANGED
@@ -25,12 +25,12 @@ Gem::Specification.new do |s|
25
25
  s.bindir = "exe"
26
26
  s.require_paths = ["lib"]
27
27
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- s.required_ruby_version = [">= 2.5.0", "< 3"]
28
+ s.required_ruby_version = [">= 2.5.0", "< 4"]
29
29
  s.metadata = {}
30
30
 
31
31
  s.add_dependency "topolys", "~> 0"
32
32
  s.add_dependency "osut", "~> 0"
33
- s.add_dependency "json-schema", "~> 2.7.0"
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.0
4
+ version: 3.4.2
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-01-01 00:00:00.000000000 Z
11
+ date: 2024-05-23 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: 2.7.0
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: 2.7.0
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.0
169
+ source_code_uri: https://github.com/rd2/tbd/tree/v3.4.2
170
170
  bug_tracker_uri: https://github.com/rd2/tbd/issues
171
171
  post_install_message:
172
172
  rdoc_options: []
@@ -179,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
179
  version: 2.5.0
180
180
  - - "<"
181
181
  - !ruby/object:Gem::Version
182
- version: '3'
182
+ version: '4'
183
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - ">="