SketchUcation Premium Membership

 

 

[Plugin] Put shadow on current day and hour

[Plugin] Put shadow on current day and hour

Postby Matt666 » Wed Mar 25, 2009 12:23 pm

Hi all!
I created a mini-plugin that puts shadows on current date and hour. But when I try it, SU "forgets" one hour... I don't know why!
Perhaps it depends of country it is installed and customized...
So: Can you test it, and tell me if SU forgets this hour out of France??? Or can you tell me why?

Thank you! ;)

EDIT: Problem solved. Plugin works!
EDIT2: Works well on SU V7 free and Pro. If you use an older version, please Jim's plugin to set your location.
Please, register (free) to access all the attachments on the forums.
Last edited by Matt666 on Sat Mar 28, 2009 9:59 pm, edited 5 times in total.
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: Put shadow on current day and hour

Postby Pilou » Wed Mar 25, 2009 12:32 pm

Is that work also with the free version who has only a default Days hours location place?
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10213
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: Put shadow on current day and hour

Postby Daniel S » Wed Mar 25, 2009 12:49 pm

I´m in Argentina. My current time is 8:49 am and the plugin says 11:49 am.
I think that the difference of three hours is because i´m in GMT -3.

Daniel S
Please, register (free) to access all the attachments on the forums.
Daniel S
 
Posts: 349
Joined: Mon Nov 12, 2007 6:06 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Put shadow on current day and hour

Postby Matt666 » Wed Mar 25, 2009 1:13 pm

Ok, thank you Daniel!
Can you try code updated in the first post, please?
Is that work also with the free version who has only a default Days hours location place?
Hi Pilou! I have a free version. So yes, it could works on it! ;)
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: Put shadow on current day and hour

Postby Daniel S » Wed Mar 25, 2009 1:34 pm

Now is working right...
I´m happy with this version... my country is happy too!! :P

Thank you,
Daniel S
Daniel S
 
Posts: 349
Joined: Mon Nov 12, 2007 6:06 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Put shadow on current day and hour

Postby Matt666 » Wed Mar 25, 2009 1:35 pm

:roflmao:
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: [Plugin] Put shadow on current day and hour

Postby watkins » Wed Mar 25, 2009 6:39 pm

Dear Matthieu,

A brief explanation would be useful. I take it that your plugin updates shadows to the current, local time when selected. So, if I select the plugin at 15:25 Oxford UK time, the shadows show correctly for that location and time. Is that correct?

Regards,
Bob
watkins
 
Posts: 1367
Joined: Wed Nov 14, 2007 5:47 pm

Re: [Plugin] Put shadow on current day and hour

Postby KevinKarney » Wed Mar 25, 2009 8:50 pm

Hi All
To correctly display the shadow of an object, one needs the
"Local Apparent Solar Time" - which is a function of the Sun's altitude and azimuth in the sky at your particular location. The local apparent solar time is 12:00 when the Sun is due South (or North in the Southern Hemisphere).

Your watch and your computer indicate Civil Mean Time which is related to "UTC (Universal Time Coordinated)" - which is Atomic Time (and within a hair's breadth is the same as the out-of-date Greenwich Mean Time). Atomic Time is maintained by the Bureau International des Poids et Meseurs, which is a UN Agency. It averages out the time from a large number of atomic Cesium clocks around the world

Civil Mean Time = UTC + Time Zone + Daylight Saving Hours

Local Mean Time = Civil Mean Time +/- (the Longitude difference between your time zone longitude and your local Longitude) * 4 minutes

Local Apparent Solar Time = Local Mean Time + "The Equation of Time"

The Equation of Time is the difference between mean and apparent time. There is a difference between the two, since the Mean Sun (by definition!) is a virtual object that goes around the equator at a uniform speed, while the True Sun moves around the Ecliptic (23 deg to the Equator) at a non-uniform speed (in a ellipse). I attach a graph of the Equation of Time.

Confused.... But Sketchup has all this technology built in! It's shadows are spot-on for local apparent solar time.

Check this out 1) set June 14th when the equation of time is zero. 2) set your local Latitude and Longitude. 3) Draw a vertical stick. 4) Select the time around midday when the shadow is due North or South. The time you get +/- 12 will be the difference in longitude between your time zone longitude and your local longitude * 4.
Please, register (free) to access all the attachments on the forums.
Best Regards
Kevin Karney
KevinKarney
 
Posts: 3
Joined: Wed Mar 25, 2009 12:03 am
Location: Monmouth, Wales
Name: Kevin Karney

Re: [Plugin] Put shadow on current day and hour

Postby Pilou » Thu Mar 26, 2009 12:41 am

Hi Pilou! I have a free version. So yes, it could works on it!

Yes but what about good Latitude, longitude inside the free?
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10213
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Put shadow on current day and hour

Postby Matt666 » Fri Mar 27, 2009 11:24 am

Hi Pilou!
I don't know. I do some tests, and Longitude/latitude parameter is customized in menu Window/Model info->Location.
Sans titre 1.jpg

Copy and paste code below in the ruby console, you will have all shadow infos.
Code: Select all
Sketchup.active_model.shadow_info.keys.each{|k|puts(k+": "+Sketchup.active_model.shadow_info[k].to_s)}


Hi KevinKarney!
Sorry, but I don't understand you problem (my poor english!!)... This plugin just putd SU shadows on the current date & time... Can you tell me what I should do to correctly display the shadow of an object? Thank you! :D If I able to..
Please, register (free) to access all the attachments on the forums.
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: [Plugin] Put shadow on current day and hour

Postby Pilou » Fri Mar 27, 2009 12:39 pm

@Matt : this don't exist in the free :roll:
Console gives that

City: Boulder (CO)
Country: USA

Latitude: 40.017
Longitude: -105.283

ShadowTime: Fri Nov 08 14:30:00 Paris, Madrid 2002 (Normal I have this regulate at this time)
I must verify what place is
Latitude: 40.017
Longitude: -105.283
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10213
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Put shadow on current day and hour

Postby TIG » Fri Mar 27, 2009 2:26 pm

http://download.sketchup.com/OnlineDoc/ ... cation.htm

Explains difference between Pro and Free Location Tools...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: [Plugin] Put shadow on current day and hour

Postby Jim » Fri Mar 27, 2009 2:38 pm

This is my solution for version 6 Free users:

http://sketchuptips.blogspot.com/2008/0 ... ation.html


Version 7 Free does include the Location settings.
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] Put shadow on current day and hour

Postby Pilou » Fri Mar 27, 2009 2:44 pm

Thx for all these tricky solutions :enlight:
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou
Top SketchUcator
 
Posts: 10213
Joined: Wed Jan 23, 2008 10:33 pm
Operating system: Windows
SketchUp version: 6
License type: Free/Make
SketchUp use: hobby
Level of SketchUp: Advanced

Re: [Plugin] Put shadow on current day and hour

Postby Matt666 » Sat Mar 28, 2009 12:14 pm

Aah, ok... Pilou uses V6!
You are completely out, man! :roflmao:
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: [Plugin] Put shadow on current day and hour

Postby Gaieus » Sat Mar 28, 2009 5:20 pm

Yup,Location was not put into the free (Windows*) SU 5 and 6 but now with SU 7 it's there. Nevertheless by taking a GE snapshot, you can always "geolocate" your model (or use Jim's plugin)
_______

*Interestingly, it was only a Windows "(un)feature" only, as the Free SU 6 for the Mac has location. :roll:
Gai...
User avatar
Gaieus
Administrator
 
Posts: 27725
Joined: Sat Oct 20, 2007 8:24 am
Location: Pécs, Hungary
Name: Csaba Pozsárkó
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: historical reconstruction
Level of SketchUp: Advanced

Re: [Plugin] Put shadow on current day and hour

Postby Matt666 » Sat Mar 28, 2009 10:01 pm

Ok, thank you Gaieus!
watkins wrote:A brief explanation would be useful. I take it that your plugin updates shadows to the current, local time when selected. So, if I select the plugin at 15:25 Oxford UK time, the shadows show correctly for that location and time. Is that correct?
Exactly, watkins ;)
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: [Plugin] Put shadow on current day and hour

Postby Pout » Mon Mar 30, 2009 2:26 pm

i would at this to your script:

Sketchup.active_model.shadow_info["DisplayShadows"]=true
This will immediately also show the shadow in the model.
Otherwise one will not see the shadows if the are not set on
Pout
 
Posts: 272
Joined: Thu Aug 21, 2008 10:46 am

Re: [Plugin] Put shadow on current day and hour

Postby remus » Mon Mar 30, 2009 2:30 pm

Pout, turning on shadows as soon as you set them could be a little annoying, as it would lock SU up in a large model. Better to leave them off (if they are already off) and let the user turn them on, i reckon.
remus
 
Posts: 8055
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus

Re: [Plugin] Put shadow on current day and hour

Postby Matt666 » Mon Mar 30, 2009 2:36 pm

Yep, that's why I didn't set shadows on in the code... ;)
Frenglish at its best !
My scripts
Matt666
 
Posts: 829
Joined: Wed Dec 05, 2007 8:38 am
Location: 48.1184, -1.675
Name: Matt

Re: [Plugin] Put shadow on current day and hour

Postby Pout » Mon Mar 30, 2009 2:47 pm

remus wrote:Pout, turning on shadows as soon as you set them could be a little annoying, as it would lock SU up in a large model. Better to leave them off (if they are already off) and let the user turn them on, i reckon.


True, but isn't it also a bit confusing for the user? The user sets the shadow to 'now' and i suppose that when a user does this, he wants to see the result of that action. Not?

I don't know if there are any guidelines an what to use as default behaviour on functions like this... It would be usefull to know so i can adjust some of my functions according to that guideline.
Pout
 
Posts: 272
Joined: Thu Aug 21, 2008 10:46 am

Re: [Plugin] Put shadow on current day and hour

Postby remus » Mon Mar 30, 2009 2:50 pm

I suppose if the user is using this plugin they already have a good idea of what its going to look like, so showing them isnt neccesary.

More generally, most people just use common sense.
remus
 
Posts: 8055
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Not a Premium Member yet? Check out the great time-limited deal we are offering.

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: Flippie123, giolio, Maciek, PChung and 16 guests