How to Get " are there shadows on a face?"
-
Hi to all,
I have a problem.
I would like to make a ruby script plugin that get information about shadows, when they are crossing on a selected face in the model..A simple code, like "is this face faded by a shadow? "..
I tryed to find something on the official Sketchup API reference, looking methods and classes, but without results

Someone has ideas?
Thanks in advance!
Fabio -
No such method in the API. You would have to calculate this.
-
you have to emit a ray from a testing point in the direction of the sun, if there is an intersection - your point lies in a shadow
if you know your way around scripting - i suggest to tailor/mix your script from existing plugins
http://sketchuptips.blogspot.com/2008/01/plugin-map-sun.html (for finding the sun position)
and the drop ruby (for the Model.raytest implementation)
-
I recall that there's a '1001 shadow tool' to draw shadows on faces as new grouped faces - this is possibly the basis of what you want... http://www.1001shadows.com/en/index.html
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement