POV-Ray : Newsgroups : povray.newusers : hourly cast sun shadows Server Time
16 Apr 2024 14:49:36 EDT (-0400)
  hourly cast sun shadows (Message 1 to 5 of 5)  
From: JimJulian
Subject: hourly cast sun shadows
Date: 11 Oct 2017 17:55:01
Message: <web.59de92991993bb18717c4cf10@news.povray.org>
Hello,

   I'm not exactly new, but I haven't been involved in Pov-Ray or raytracing in
several years.
   I need to plot the shadows cast by objects surrounding my back yard. I have a
solar power station there and want to determine the best location for the array.
Perhaps I need to make the array mobile for best results. I don't know. I want
to write a program that will achieve that.
   I also have expereience in GIS(Geographic Information systems. I've created
3D versions of topographical maps using Pov-Ray, USGS topo maps and DEM (Digital
Elevation Map) files.
   In that project, the position of the Sun was based on aesthetics, the most
pleasing position of the sun.
   There used to be someone named Chris Dennis who had developed a macro
entitled '/map.inc' for accurately calculating the position of the Sun.
   That link is dead and I cannot locate him.
   I have used solar position calculation scripts in Python astronomical
library, PyEphem, to plot the solar azimuth and elevation against the power and
battery state-of-charge throughout the day. I'm not sure how, or if, I may
incorporate the results of the library, or a python script that uses the
library, into a Pov-Ray script.


Post a reply to this message

From: clipka
Subject: Re: hourly cast sun shadows
Date: 11 Oct 2017 18:23:12
Message: <59de99d0$1@news.povray.org>
Am 11.10.2017 um 23:52 schrieb JimJulian:

>    I need to plot the shadows cast by objects surrounding my back yard. I have a
> solar power station there and want to determine the best location for the array.
> Perhaps I need to make the array mobile for best results. I don't know. I want
> to write a program that will achieve that.

Maybe the `sunpos.inc` include file that ships with POV-Ray already does
the job.


Post a reply to this message

From: MustardMan
Subject: Re: hourly cast sun shadows
Date: 27 Oct 2017 17:45:00
Message: <web.59f3a8097c823ed414683cfa0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 11.10.2017 um 23:52 schrieb JimJulian:
>
> >    I need to plot the shadows cast by objects surrounding my back yard. I have a
> > solar power station there and want to determine the best location for the array.
> > Perhaps I need to make the array mobile for best results. I don't know. I want
> > to write a program that will achieve that.
>
> Maybe the `sunpos.inc` include file that ships with POV-Ray already does
> the job.

Hi, I've used 'sunpos' to great effect, and in fact I'm currently doing a
simulation of some solar panels on a roof with the horizon as a "wall" about a
kilometre away. The simulation produces a very good looking frame sequence (and
I can make an avi from those), and I can also generate a file with the power
percentage a panel will receive (in 5 minute increments) according to the angle
of the sun and the angle of the panel. [dot product of the angle vectors].
However, I would like to automatically determine if a panel (or a point on the
panel) is "in the shade". I've not seen anywhere a hint for determining if a
point can "see" the light source, or if it is in shadow. Is there a function for
doing that?
At present I have to look at the frame sequence and manually decide where I have
to start/stop integrating the power figures that pop out of my file. It would be
great if I could get those numbers automatically, especially for multiple days
throughout the year. It is so tiring to do it manually, and repeat it if I
change the panel positions.
Thanks!


Post a reply to this message

From: Bald Eagle
Subject: Re: hourly cast sun shadows
Date: 27 Oct 2017 20:10:00
Message: <web.59f3c9ed7c823ed45cafe28e0@news.povray.org>
"MustardMan" <nomail@nomail> wrote:

> However, I would like to automatically determine if a panel (or a point on the
> panel) is "in the shade". I've not seen anywhere a hint for determining if a
> point can "see" the light source, or if it is in shadow. Is there a function for
> doing that?

Not that I'm aware of, but consider:
if you define a vector - a "ray" from your point light source to any point on
the panel, then you can likely perform some sort of intersection test on that
line and an object.
"Easy" if you have geometric/mathematical primitives as obstructions, but likely
much more difficult if you have some complex geometry.


The other thing you could do is run a 3-stage simulation.
1. For the first simulation, set up your scene so that the camera is
normal/perpendicular to your panel, the camera type is orthographic, and your
panel fills an x or y dimension of the render.
Run your animation so that you get a set of frames showing the panel over the
course of changing light conditions.
This will give you a set of images.

2. Run a second "animation" - where no actual render is needed - so you can set
the render size to something tiny - and the point is to scan the frames from the
first animation with eval_pigment() across the x dimensions and down the y
dimensions of the panel.  Use an image_map of the automatically named frame on a
box.
For this, you don't need a light, a camera, or any objects in the scene, because
the eval_pigment works on the "definition" - the unrendered pigment on the box -
but that pixel's pigment is now a result of the full raytracer lighting
calculations done in the first animation.

#declare Image_File = concat("Filename",str(frame_number, -5, 0), ".png")

http://news.povray.org/povray.windows/thread/%3Cweb.51f184ded8de8676af3d580b0@news.povray.org%3E/

Write all of that eval_pigment data to a file, or just the results of your
calculations for that frame.

3. Do your regular animation, and read the data from the file in step 2 for
whatever purposes you need during the animation.

Those are the broad strokes - I think you can follow that and work out most of
the small details.


Post a reply to this message

From: Alain
Subject: Re: hourly cast sun shadows
Date: 27 Oct 2017 20:45:27
Message: <59f3d327$1@news.povray.org>
Le 17-10-27 à 17:41, MustardMan a écrit :
> clipka <ano### [at] anonymousorg> wrote:
>> Am 11.10.2017 um 23:52 schrieb JimJulian:
>>
>>>     I need to plot the shadows cast by objects surrounding my back yard. I have a
>>> solar power station there and want to determine the best location for the array.
>>> Perhaps I need to make the array mobile for best results. I don't know. I want
>>> to write a program that will achieve that.
>>
>> Maybe the `sunpos.inc` include file that ships with POV-Ray already does
>> the job.
> 
> Hi, I've used 'sunpos' to great effect, and in fact I'm currently doing a
> simulation of some solar panels on a roof with the horizon as a "wall" about a
> kilometre away. The simulation produces a very good looking frame sequence (and
> I can make an avi from those), and I can also generate a file with the power
> percentage a panel will receive (in 5 minute increments) according to the angle
> of the sun and the angle of the panel. [dot product of the angle vectors].
> However, I would like to automatically determine if a panel (or a point on the
> panel) is "in the shade". I've not seen anywhere a hint for determining if a
> point can "see" the light source, or if it is in shadow. Is there a function for
> doing that?
> At present I have to look at the frame sequence and manually decide where I have
> to start/stop integrating the power figures that pop out of my file. It would be
> great if I could get those numbers automatically, especially for multiple days
> throughout the year. It is so tiring to do it manually, and repeat it if I
> change the panel positions.
> Thanks!
> 
> 

You may want to use the trace() function from your interest point toward 
the light against an union of every objects in your scene.
Something like:
#declare Direction = Source_Point - Light_Pos;
#declare Norm=<1,1,1>;
#declare Intersect = trace(Source_Point, Direction, Norm);

"Norm" will contain the normal at the point of intersection, or Null if 
it don't hit the target object.
"Intersect" will contain the location of the point of intersection with 
the first surface encountered.

Where «Source_point» is a previously defined point just above your sun 
collector.
If the length of Norm = 0, then, the path is unobstructed. The test ray 
passed right through the light_source and ended against the background. 
Just be sure that you don't use some very large object as your background.

If not, then, there is something between you and the light = you are in 
a shadowed area.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.