sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Overflow bug?

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 98 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.
    • thomthomT Offline
      thomthom
      last edited by

      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
      • daikuD Offline
        daiku
        last edited by

        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
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement