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!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Complex numbers and other libraries

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 3 Posters 449 Views 3 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.
    • M Offline
      mptak
      last edited by

      Can anyone tell me how to use other ruby libraries like the complex number functions in the Ruby in Sketchup? Khalid at http://www.betterexplained.com has rocked my world and has got me scrambling to apply euler's formula to simple animation as a teaching tool. All of you wizards out there can take this as a general question about other libraries as well. Thanks heaps.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Thanks for that link!

        (Sorry I'm not sure about your question though. Is it a module part of the standard Ruby?)

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

        1 Reply Last reply Reply Quote 0
        • M Offline
          mptak
          last edited by

          I think so. Complex(10,2) should yield 10 + 2i. In ruby 1.9.2 it is a Class with a parent being numeric. If it sounds like I don't know what I'm talking about its cause I don't know what I'm talking about....However Complex numbers are a part of the TI83 Calculator Basic but not a standard function in Google Docs Spreadsheets.

          Thanks for your great work..

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            It's a class under Ruby 1.9. But I don't see it for 1.8.6 (which is what SU uses). http://www.ruby-doc.org/core-1.8.6/index.html

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

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              It's in the Standard (ie Extended,) Libraries for 1.8.6 (not in the Core.)

              In Files
              lib/complex.rb
              lib/mathn.rb

              You need a full ruby installation.
              You need to add paths to the $LOAD_PATH array.
              I have a topic on this and a utility script called !loadpaths.rb


              Addenda: -See these posts:

              • for the !loadpaths.rb script:
                [code] Ruby LOAD PATHs script for (Win32)

              • and for info: same topic near the bottom..

              • for the complete Ruby libraries (with precompiled .so files,) direct from ftp.ruby-lang.org:

              • to match SU 8.0M0 & M1: ruby 1.8.6-p287* for Ruby 1.8.6-p369 (latest as of this posting.)

              • requires you replace DLL in Sketchup program folder if on Windows.* See instructions: Ruby Interpreter DLLs (Win32)

              Also see: Ruby Newbie's Guide to Getting Started

              I'm not here much anymore.

              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