sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Help with shadow_info and SunRise

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 126 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'm trying to debug this method but I could not find out why the same day has some seconds of difference in Sunrise.
      May be it's not the right form to find out the Sunrise for a given time?
      (I'm using Sketchup 8.04811)

      Please help!

      
      def fsun(year1,month1,day1,hours1, minuts1)
      	model=Sketchup.active_model
      	info=model.shadow_info
      	
      new_time=Time.local(year1, month1, day1, hours1, minuts1)
      info["ShadowTime"]=new_time
      
      	p(info["SunRise"])	
      end
      
      
      fsun(2011, 12, 21, 11, 59)
      fsun(2011,  6, 21,  9, 59)
      fsun(2011, 12, 21,  9, 59)
      fsun(2011,  6, 21,  9, 59)
      fsun(2011, 12, 21, 11, 59)
      
      
      #RESULT;
      # Wed Dec 21 08;24;22 +0100 2011 #SunRise should be equal?
      # Tue Jun 21 06;37;23 +0200 2011
      # Wed Dec 21 08;24;31 +0100 2011 #SunRise should be equal?
      # Tue Jun 21 06;37;23 +0200 2011
      # Wed Dec 21 08;24;22 +0100 2011
      # true
      
      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        It's probably just a minor tolerance issue.
        If you can actually measure the sunrise to the nearest minute you'll be lucky!
        The couple of seconds discrepancy are really nothing at all πŸ˜•
        The site's elevation and the relative height of adjacent landscape/buildings towards the rising sun direction will all affect the 'real' time much worse any, so why not be satisfied to the nearest minute or so ?
        PS: 'SunRise_time_t' gives comparable results to 'SunRise' so that's not the issue

        TIG

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

          I thought I was doing something wrong.
          Then, I don't worry about this discrepancy.

          Thanks Tig

          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