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,0mmThe 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement