POV-Ray : Newsgroups : povray.general : modelling parabolic reflectors in povray (photons issue) Server Time
28 Nov 2024 08:43:35 EST (-0500)
  modelling parabolic reflectors in povray (photons issue) (Message 1 to 5 of 5)  
From: Klaasvakie
Subject: modelling parabolic reflectors in povray (photons issue)
Date: 4 May 2007 10:15:02
Message: <web.463b3f3ddca05642758b6c7b0@news.povray.org>
Hi

I am trying to model a parabolic reflector. The beam pattern I am seeing is
not what I expect. I cannot post attachments, so I will post the scene file
and add some of my comments inbetween.

//standard stuff
#include "colors.inc"

//turn photons on
//As far as I can tell the only way for my light
//source to bounce off the sides of my reflector
//is to use photons, am I right?
global_settings {
        photons {
                count 200000  //a lot of them because I dont know any better
and it still renders quick

                autostop 1
        }
}


// a bit about the dimensions. I am working in
//metres with the reflector being 0.029 metres
//(30 millimetres) long and 0.0115 metres  (11.5
//millimetres) in diameter.
//The reflector is in the centre of a 20m cube
//The camara is placed roughly 2cm in front of our
//reflector looking straight down the barrel
camera {
        location <0, 0.05, 0>
        look_at <0, 2, 0>
}



//generate the constants for our parabola
//the parabola is calculated given that I know
//two points which it must pass through <x1,y1>
//and <x2,y2>. This makes it easy for me to spec
//the bottom and top diameters and parabola length
//and the rest is calculated.


//two known points.
#declare x1 = 0.004;
#declare y1 = 0;
#declare x2 = 0.011;
#declare y2 = 0.029;

// for a parabola centered on the y axis
// y = a*x^2 + c;


//calculate a from our two points
#declare a = (y1 - y2)/(pow(x1,2) - pow(x2,2));
//calculate c
#declare c = y1-a*pow(x1,2);

//find the focal point.
//the focal point is where the derivative is
//equal to 1;
#declare fp_x = 1/(2*a);
#declare fp = a*pow(fp_x,2) + c;

//macro for returning an xypoint on the parabola
//given the x position.
#macro return_point(X)
        #local P = <X,(a*pow(X,2)+c)>;
        P
#end


//finally, generate the reflector
#declare loopx=0;
lathe {
        linear_spline
        int(((0.0115)/0.0005)+1), //calculate how many points we have
        // generate the points
        #while (loopx<0.0115)
                return_point(loopx),
                #declare loopx=loopx+0.0005; //ove in half a millimetre
steps
        #end
        //put the last point in
        <0.0115,(a*pow(0.0115,2) + c)> // add the final point

        pigment { White } //white sounds decent no?
        finish {
                reflection {<0.9,0.9,0.9>} // make it nice and shiny
        }

        photons { target reflection on } //make sure photons reflect off of
it
}

// put a light source at the focal point of the reflector
light_source {
        <0,fp,0> color White
}


// make something for the beam to hit.
box {
        <-10, -10, -10>, <10, 10, 10>

        pigment { color Blue } hollow

        finish {
                phong 0.3
        }
}


When I rendre this scene I expect to get a nice collimated clump of light in
the centre and some side spread, but instead I get a set of saturny-type
rings with a white dot in the middle. I played with the number of photons
and also the finishes on the box (phong) but no luck.

Can anyone please point me in the right direction. What am I not getting?

Thanks in advance,

Cheers,

Johann


Post a reply to this message

From: Warp
Subject: Re: modelling parabolic reflectors in povray (photons issue)
Date: 4 May 2007 10:27:49
Message: <463b42e4@news.povray.org>
Klaasvakie <kla### [at] gmailcom> wrote:
> lathe {

  I don't know if this has anything to do with the problem, but you could
use a mathematical paraboloid created with an isosurface or a poly (the
latter might even be more accurate, albeit more difficult to write) instead
of using a lathe which only approximates the shape.

  If you don't know how to create an isosurface or a poly, see these
tutorials:

http://povray.org/documentation/view/3.6.1/73/
http://povray.org/documentation/view/3.6.1/74/

-- 
                                                          - Warp


Post a reply to this message

From: Lukas Winter
Subject: Re: modelling parabolic reflectors in povray (photons issue)
Date: 4 May 2007 11:06:58
Message: <pan.2007.05.04.15.06.57.666595@removeit.geloescht.net>
Am Fri, 04 May 2007 10:12:13 -0400 schrieb Klaasvakie:

> Hi
> 
> I am trying to model a parabolic reflector. The beam pattern I am seeing
> is not what I expect.
...
> 
> Can anyone please point me in the right direction. What am I not getting?
> 

There is an exact paraboloid in shapes_old.inc. You might want to invert,
scale, clip and bound it so that it fits your requirements. I never used
it myself, though.


Post a reply to this message

From: Alain
Subject: Re: modelling parabolic reflectors in povray (photons issue)
Date: 4 May 2007 21:33:03
Message: <463bdecf$1@news.povray.org>
Klaasvakie nous apporta ses lumieres en ce 04-05-2007 10:12:
> Hi
> 
> I am trying to model a parabolic reflector. The beam pattern I am seeing is
> not what I expect. I cannot post attachments, so I will post the scene file
> and add some of my comments inbetween.
> 
> //standard stuff
> #include "colors.inc"
> 
> //turn photons on
> //As far as I can tell the only way for my light
> //source to bounce off the sides of my reflector
> //is to use photons, am I right?
> global_settings {
>         photons {
>                 count 200000  //a lot of them because I dont know any better
> and it still renders quick
> 
>                 autostop 1
>         }
> }
> 
> 
> // a bit about the dimensions. I am working in
> //metres with the reflector being 0.029 metres
> //(30 millimetres) long and 0.0115 metres  (11.5
> //millimetres) in diameter.
> //The reflector is in the centre of a 20m cube
> //The camara is placed roughly 2cm in front of our
> //reflector looking straight down the barrel
> camera {
>         location <0, 0.05, 0>
>         look_at <0, 2, 0>
> }
> 
> 
> 
> //generate the constants for our parabola
> //the parabola is calculated given that I know
> //two points which it must pass through <x1,y1>
> //and <x2,y2>. This makes it easy for me to spec
> //the bottom and top diameters and parabola length
> //and the rest is calculated.
> 
> 
> //two known points.
> #declare x1 = 0.004;
> #declare y1 = 0;
> #declare x2 = 0.011;
> #declare y2 = 0.029;
> 
> // for a parabola centered on the y axis
> // y = a*x^2 + c;
> 
> 
> //calculate a from our two points
> #declare a = (y1 - y2)/(pow(x1,2) - pow(x2,2));
> //calculate c
> #declare c = y1-a*pow(x1,2);
> 
> //find the focal point.
> //the focal point is where the derivative is
> //equal to 1;
> #declare fp_x = 1/(2*a);
> #declare fp = a*pow(fp_x,2) + c;
> 
> //macro for returning an xypoint on the parabola
> //given the x position.
> #macro return_point(X)
>         #local P = <X,(a*pow(X,2)+c)>;
>         P
> #end
> 
> 
> //finally, generate the reflector
> #declare loopx=0;
> lathe {
>         linear_spline
>         int(((0.0115)/0.0005)+1), //calculate how many points we have
>         // generate the points
>         #while (loopx<0.0115)
>                 return_point(loopx),
>                 #declare loopx=loopx+0.0005; //ove in half a millimetre
> steps
>         #end
>         //put the last point in
>         <0.0115,(a*pow(0.0115,2) + c)> // add the final point
> 
>         pigment { White } //white sounds decent no?
>         finish {
>                 reflection {<0.9,0.9,0.9>} // make it nice and shiny
>         }
> 
>         photons { target reflection on } //make sure photons reflect off of
> it
> }
> 
> // put a light source at the focal point of the reflector
> light_source {
>         <0,fp,0> color White
> }
> 
> 
> // make something for the beam to hit.
> box {
>         <-10, -10, -10>, <10, 10, 10>
> 
>         pigment { color Blue } hollow
> 
>         finish {
>                 phong 0.3
>         }
> }
> 
> 
> When I rendre this scene I expect to get a nice collimated clump of light in
> the centre and some side spread, but instead I get a set of saturny-type
> rings with a white dot in the middle. I played with the number of photons
> and also the finishes on the box (phong) but no luck.
> 
> Can anyone please point me in the right direction. What am I not getting?
> 
> Thanks in advance,
> 
> Cheers,
> 
> Johann
> 
> 
You are using very small values. When I multiply all your values by 100, I get a 
bright and sharp bright spot without any ring. This point to precision related 
errors from the floating point processor.
Changing your base unit from meter to centimeter or milimeter could realy help.

-- 
Alain
-------------------------------------------------
'The Computer made me do it.'


Post a reply to this message

From: Klaasvakie
Subject: Re: modelling parabolic reflectors in povray (photons issue)
Date: 7 May 2007 01:35:02
Message: <web.463eb94b7c5478a4758b6c7b0@news.povray.org>
> You are using very small values. When I multiply all your values by 100, I get a
> bright and sharp bright spot without any ring. This point to precision related
> errors from the floating point processor.
> Changing your base unit from meter to centimeter or milimeter could realy help.
>

Alain seems to have hit the nail on the head. It was indeed a precision
issue. Using a millimeter base now with no problems.

Thank you all for your effort.

Regards,

Johann


Post a reply to this message

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