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
Advertisement