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

    [Plugin] Face Sun

    Scheduled Pinned Locked Moved Plugins
    9 Posts 6 Posters 16.2k Views 6 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 thomthom

      In response to: http://forums.sketchucation.com/viewtopic.php?f=323%26amp;t=27477

      1. Make selection containing faces
      2. Plugins -> Face Sun

      Positions all the faces in the selection to face the sun's current position.

      No live update.

      Update 1.1 (Jim Edition)
      Thanks to Jim that modded the script so that connected geometry to the selected faces also rotates accordingly.

      http://sketchucation.com/pluginstore?pln=tt_facesun

      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

        The astronomer who requested this, replied to the post at GG complaining (about Sketchup, not you ThomThom,) that's it's not easy to change the year in the Shadow info dialog. (Actually he thinks there's no way to change the year; he must have missed those left/right tick buttons.)
        I replied, with this:

        The Sun position would be controlled by ShadowInfo class
        http://code.google.com/apis/sketchup/docs/ourdoc/shadowinfo.html

        #-- Ruby
        new_time = Time.gm(1981,"jan",1,20,15,1) model = Sketchup.active_model shadowinfo = model.shadow_info shadowinfo['ShadowTime']=new_time
        #-- end Ruby

        The Time.gm method parameters are:
        (YEAR,month,day,hour,min,sec,usec)
        The year is required, all others are optional and default to their minimum values.
        Time.gm creates a new time object based on UTC (GMT) time.
        http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_time.html

        Info on extended Date class:
        http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_standard.html
        Below class Complex, scroll down ...

        I'm not here much anymore.

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

          So he has no knowledge on how to use the info I gave him, to write an Inputbox script for setting time, and I'm too busy with home repairs the rest of the week to help him out.

          I also have no idea if Sketchup would honor the Date class. The guy is obviously interested in ancient dates because he studies ancient architecture. I just don't know if Sketchup could handle going back 6723 years.

          I'm not here much anymore.

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

            hmm..
            I don't have much time to work on this. Certainly not this week. And in general I'm atm busy with Vertex Edit.
            Just put something quickly together when I had a spare 5 mins. Will make it also orient connected geometry to the faces in an update next week. But I really can't promise anything more.

            If anyone else want to jump in on this then feel free. Use my code as a base if you want. (not much code really - very simple script.)

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

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

              Update - Thanks to Jim!

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

              1 Reply Last reply Reply Quote 0
              • C Offline
                construsol
                last edited by

                Dan, Thom:

                Dan, you are right, years can be inputed, just seen how to do it, and thanks for the links, altough I don't have the necessary knowledge I will read them and try to be familiar with Ruby at least with this script to see if I can make adaptations to it according to own needs. Thom and Jim, thanks for the uptdate.

                @dan rathbun said:

                The astronomer who requested this, replied to the post at GG complaining (about Sketchup, not you ThomThom,) that's it's not easy to change the year in the Shadow info dialog. (Actually he thinks there's no way to change the year; he must have missed those left/right tick buttons.)
                I replied, with this:

                The Sun position would be controlled by ShadowInfo class
                http://code.google.com/apis/sketchup/docs/ourdoc/shadowinfo.html

                #-- Ruby
                new_time = Time.gm(1981,"jan",1,20,15,1) model = Sketchup.active_model shadowinfo = model.shadow_info shadowinfo['ShadowTime']=new_time
                #-- end Ruby

                The Time.gm method parameters are:
                (YEAR,month,day,hour,min,sec,usec)
                The year is required, all others are optional and default to their minimum values.
                Time.gm creates a new time object based on UTC (GMT) time.
                http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_c_time.html

                Info on extended Date class:
                http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_standard.html
                Below class Complex, scroll down ...

                1 Reply Last reply Reply Quote 0
                • kenK Offline
                  ken
                  last edited by

                  This is a good plugin. Now here comes the however, would it be possible to make a selection, such as face "front", "top" or "Sun". This would make it a lot easier to take apart a model and align the faces for export to ACAD file.

                  Jim, this would make it easier to use your "Make Orthographic Views" plugin.

                  If not, thanks for the plugin.

                  Ken

                  Fight like your the third monkey on Noah's Ark gangway.

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    bau.arch
                    last edited by

                    Hi Thom,

                    I've just stumbled upon this little plugin. I though it would be great as an "Always face sun" option for a component (similar to "Always face camera").

                    It would be nice for rendering billboard people\trees with accurate shadows (creating a shadow "dummy" that always faces sun).

                    Is there a way to make this happen?

                    thnks,

                    Assaf

                    www.viagrasansordonnancefr.com acheter sildenafil 50 mg

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      Gultekinmg
                      last edited by

                      I want sun right inside my house at moon. How about that.
                      COuld you also position sun in a room as light source?

                      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