lib/tbd/psi.rb in tbd-3.4.0 vs lib/tbd/psi.rb in tbd-3.4.1
- old
+ new
@@ -1596,18 +1596,18 @@
group = group.get
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) }
minz = ( points.map { |p| p.z } ).min
@@ -1693,19 +1693,15 @@
origin = edge[:v0].point
terminal = edge[:v1].point
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
+ next if edge_V.magnitude < TOL
- if edge_V.magnitude < TOL
- invalid("1x edge length < TOL", mth, 0, ERROR)
- next
- end
-
edge_plane = Topolys::Plane3D.new(origin, edge_V)
if vertical
reference_V = north.dup
elsif horizontal
@@ -1764,13 +1760,11 @@
farther = point_V_magnitude > farthest_V.magnitude
farthest = point if farther
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
adjust = true if east.dot(farthest_V) < -TOL
else