Overflow bug?
-
This is part of a snippet I use to get the orientation of the custom set axis.
<span class="syntaxdefault"><br />entities </span><span class="syntaxkeyword">= @</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br />tr </span><span class="syntaxkeyword">= </span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">entities</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">add_group</span><span class="syntaxkeyword">).</span><span class="syntaxdefault">transformation<br /></span>
I've used it to extract the x, y and z axis from the transformation.
However, today I tried to use the transformation object directly and got some strange results. Upon further inspections I found that the origin of the transformation was far out!
[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0e+030, 1.0e+030, 1.0e+030, 1.0]
Just to visualize the value:
1.0e+030.to_l.to_s (eval):1017: warning: Float 1.0e+030 out of range 25399999999999999000000000000000,0mm
The axis when I run is isn't in fact moved - so it the origin should be 0,0,0. I'm wondering if it's an overflow bug in SketchUp?
-
Probably the result of dividing by "almost zero". Which in turn could result from a floating point roundoff error.
Advertisement