• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Overflow bug?

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 97 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    thomthom
    last edited by 22 Jul 2012, 19:38

    This is part of a snippet I use to get the orientation of the custom set axis.

    <span class="syntaxdefault"><br />entities&nbsp;</span><span class="syntaxkeyword">=&nbsp;@</span><span class="syntaxdefault">model</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">active_entities<br />tr&nbsp;</span><span class="syntaxkeyword">=&nbsp;</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?

    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund

    1 Reply Last reply Reply Quote 0
    • D Offline
      daiku
      last edited by 25 Jul 2012, 18:59

      Probably the result of dividing by "almost zero". Which in turn could result from a floating point roundoff error.

      Clark Bremer
      http://www.northernlightstimberframing.com

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement