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

    A faster way to obtain shadow_info?

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 50 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.
    • JuantxoJ Offline
      Juantxo
      last edited by

      Hello,

      I would like to obtain SunDirection vector a lot of times on a whole year.
      But the method below is too slow. Is there a fast form to find out SU shadow_info?

      
      vec=[]
      info=Sketchup.active_model.shadow_info
      atime=Time.now
      
      for i in 0..50000
        info["ShadowTime"]+=600
        vec<<info["SunDirection"]
      end
      
      
      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        hmm... I looked at it. But found no optimized way. I tried making constants of the string -in case the creation of the strings for every iteration had a cost - but no change.
        And you can't address the info with numeric indexes either...
        I also wrapped the whole block in a start_operation with the disable_ui argument to true - but still no performance difference.

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

        1 Reply Last reply Reply Quote 0
        • JuantxoJ Offline
          Juantxo
          last edited by

          Thanks thomthom, maybe could be added to wish list ruby access to SU Solar Position Algorithm in a fast way.

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

            It's not actually getting the info that's slow. It's setting it.

            When I ran the test it took ~11sec to run.

            When I removed info["ShadowTime"]+=600 it took ~0.15sec to run.
            That's why I hoped using start_operation would help - but alas. But at least, when you do this, ensure that Shadows are not on 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
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement