[Plugin] Face Sun
-
In response to: http://forums.sketchucation.com/viewtopic.php?f=323%26amp;t=27477
- Make selection containing faces
- 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.SketchUp Plugins | PluginStore | SketchUcation
SketchUp Plugin and Extension Store by SketchUcation provides free downloads of hundreds of SketchUp extensions and plugins
(sketchucation.com)
-
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 RubyThe 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.htmlInfo on extended Date class:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_standard.html
Below class Complex, scroll down ... -
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.
-
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.)
-
Update - Thanks to Jim!
-
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 RubyThe 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.htmlInfo on extended Date class:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/lib_standard.html
Below class Complex, scroll down ... -
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
-
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
-
I want sun right inside my house at moon. How about that.
COuld you also position sun in a room as light source?
Advertisement