sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    Overflow bug?

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 163 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

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

        Advertisement