POV-Ray : Newsgroups : povray.advanced-users : Optical modelling of LEDs....real world problem! Server Time
26 Dec 2024 14:29:47 EST (-0500)
  Optical modelling of LEDs....real world problem! (Message 1 to 6 of 6)  
From: rgbphil
Subject: Optical modelling of LEDs....real world problem!
Date: 23 Apr 2005 06:10:01
Message: <web.426a1dfbc667c1b1f35fd7850@news.povray.org>
Hi all,

Wondering if I could get some pointers to modelling optical components,
specially LEDs. My 'Real World' problem is designing RGB LED clusters and I
thought PovRay or MegaPOV could help. Have been having a bit of fun over at
candlepower forums....try searching for posts from rgbphil.

I'd like to model:

the lens on an LED :- need some help preferably some tools on getting
geometry of lenses right.....some LEDs have more than just two intersecting
spheres type lenses.

LED die :- I've tried modelling a small squashed cube and using an area
light the same size. The area is made to look_like the cube....didn't work.
I got a reasonable result just turning shadows off.....not sure whats
wrong. However the issue is that the physical size of the LED die is
important because the lens can sometimes image the die in the projected
beam. This has to be taken into account in the modelling so any help in
getting a nice glowing box object that truely emits light from all surfaces
would help.

Diffusers :- I've tried POVRAY 3.6 and having an interior with various
scattering parameters....but can't get close to what happens when light
hits a real world piece of opaque plastic......any help in this in
particular would be much appreciated. If I can get this right, I can
simplify my LED models.

You can be reasonably technical in any replys, I used to play with good old
DKBTrace all the time.....though I'm a bit rusty on the later releases.

thanks
phil


Post a reply to this message

From: Orchid XP v2
Subject: Re: Optical modelling of LEDs....real world problem!
Date: 23 Apr 2005 10:31:53
Message: <426a5c59$1@news.povray.org>
> Diffusers :- I've tried POVRAY 3.6 and having an interior with various
> scattering parameters....but can't get close to what happens when light
> hits a real world piece of opaque plastic......any help in this in
> particular would be much appreciated. If I can get this right, I can
> simplify my LED models.

Hmm... you're gonna have fun with this! POV-Ray doesn't really *scatter* 
light when it hits scattering media. That particular media just "shows 
up" when light hits it; the light itself is attenuated, but it sure 
isn't "scattered" in any meaningful way. AFAIK, not a way to simulate 
this accurately either...

POV-Ray is really designed for building nice-looking pictures. Is 
doesn't do "physically correct" quite so well... Still, maybe somebody 
else here can come up with something...?


Post a reply to this message

From: David Wallace
Subject: Re: Optical modelling of LEDs....real world problem!
Date: 25 Apr 2005 14:44:23
Message: <426d3a87$1@news.povray.org>
Orchid XP v2 wrote:
>> Diffusers :- I've tried POVRAY 3.6 and having an interior with various
>> scattering parameters....but can't get close to what happens when light
>> hits a real world piece of opaque plastic......any help in this in
>> particular would be much appreciated. If I can get this right, I can
>> simplify my LED models.
> 
> 
> Hmm... you're gonna have fun with this! POV-Ray doesn't really *scatter* 
> light when it hits scattering media. That particular media just "shows 
> up" when light hits it; the light itself is attenuated, but it sure 
> isn't "scattered" in any meaningful way. AFAIK, not a way to simulate 
> this accurately either...
> 
> POV-Ray is really designed for building nice-looking pictures. Is 
> doesn't do "physically correct" quite so well... Still, maybe somebody 
> else here can come up with something...?

Give the lit LED a high ambient value and use basic radiosity (recursion level 
1, count 30, error_bound 0.5, etc.)  Pigment is a solid rgbf<1,0,0,0.65> (play 
with other hues to taste).  Check the radiosity tutorial for an example of the 
effect.

--------------
David Wallace
TenArbor Consulting
"Just In Time Cash"
www.tenarbor.com
1-866-572-CASH


Post a reply to this message

From: Josh
Subject: Re: Optical modelling of LEDs....real world problem!
Date: 27 Apr 2005 08:18:35
Message: <426f831b@news.povray.org>
maybe the following will help...

#include "colors.inc"
#include "textures.inc"
#include "shapes.inc"
#include "stones.inc"
#include "metals.inc"

global_settings {
  radiosity {
    pretrace_start 0.08           // start pretrace at this size
    pretrace_end   0.04           // end pretrace at this size
    count 35                      // higher -> higher quality (1..1600) [35]
    nearest_count 5               // higher -> higher quality (1..10) [5]
    error_bound 1.8               // higher -> smoother, less accurate [1.8]
    recursion_limit 10             // how much interreflections are 
calculated (1..5+) [3]
    low_error_factor .5           // reduce error_bound during last pretrace 
step
    gray_threshold 0.0            // increase for weakening colors (0..1) 
[0]
    minimum_reuse 0.015           // reuse of old radiosity samples [0.015]
    brightness 5                 // brightness of radiosity effects (0..1) 
[1]

    adc_bailout 0.01/2
    normal on                   // take surface normals into account [off]
    media on                    // take media into account [off]
    //save_file "file_name"       // save radiosity data
    //load_file "file_name"       // load saved radiosity data
    //always_sample off           // turn sampling in final trace off [on]
    //max_sample 1.0              // maximum brightness of samples
  }
}



#declare SnakeWood =
texture {  /* Bottom wood-grain layer */
    pigment {
        wood
        turbulence 0.05
        color_map {
            [0.00 rgb <0.58, 0.45, 0.23>]
            [0.34 rgb <0.65, 0.45, 0.25>]
            [0.40 rgb <0.33, 0.23, 0.13>]
            [0.47 rgb <0.60, 0.40, 0.20>]
            [1.00 rgb <0.25, 0.15, 0.05>]
        }
    }
    finish {
        crand 0.02
        //ambient 0.32
        diffuse 0.63
        phong 0.2
        phong_size 10
    }
    normal { bumps 0.05 }
}
texture {     /* top layer, adds small dark spots */
    pigment {
        bozo
        color_map {
            [0.0 rgbt <1.00, 1.00, 1.00, 1.00>]
            [0.8 rgbt <1.00, 0.90, 0.80, 0.80>]
            [1.0 rgbt <0.30, 0.20, 0.10, 0.40>]
        }
    scale 0.25
    }
}



#macro LED(TurnedOn)
merge   {
        cylinder        {
                        <0,0,0>,
                        <0,.3,0>,
                        1
                        }
        cylinder        {
                        <0,0,0>,
                        <0,1.5,0>,
                        0.9
                        }
        sphere          {
                        <0,1.5,0>,
                        0.9
                        }
        texture {
                pigment {
                        Red*0.7
                        }

                finish  {
                        reflection { 0.1,0.7 }
                        specular 0.5
                        #if(TurnedOn=1)
                        ambient 1
                        #else
                        ambient 0
                        #end
                        diffuse 1
                        }
                }

        }
#end

#macro getLEDRow(theValue)
        #if(theValue = 0)
        union   {
                object { LED(0) }
                object { LED(0) translate <2.1,0,0>}
                object { LED(0) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 1)
        union   {
                object { LED(1) }
                object { LED(0) translate <2.1,0,0>}
                object { LED(0) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 2)
        union   {
                object { LED(0) }
                object { LED(1) translate <2.1,0,0>}
                object { LED(0) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 3)
        union   {
                object { LED(1) }
                object { LED(1) translate <2.1,0,0>}
                object { LED(0) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 4)
        union   {
                object { LED(0) }
                object { LED(0) translate <2.1,0,0>}
                object { LED(1) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 5)
        union   {
                object { LED(1) }
                object { LED(0) translate <2.1,0,0>}
                object { LED(1) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 6)
        union   {
                object { LED(0) }
                object { LED(1) translate <2.1,0,0>}
                object { LED(1) translate <4.2,0,0>}
                }
        #end
        #if(theValue = 7)
        union   {
                object { LED(1) }
                object { LED(1) translate <2.1,0,0>}
                object { LED(1) translate <4.2,0,0>}
                }
        #end
#end

#macro getLEDLetter(theLetter)
        union   {
        #if(theLetter = 0)
                object { getLEDRow(0) }
                object { getLEDRow(0) translate <0,0,-2.1>}
                object { getLEDRow(0) translate <0,0,-4.2>}
                object { getLEDRow(0) translate <0,0,-6.3>}
                object { getLEDRow(0) translate <0,0,-8.4>}
        #end
        #if(theLetter = 1)
                object { getLEDRow(2) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(7) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(5) translate <0,0,-8.4>}
        #end
        #if(theLetter = 4)
                object { getLEDRow(3) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(5) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(3) translate <0,0,-8.4>}
        #end
        #if(theLetter = 5)
                object { getLEDRow(7) }
                object { getLEDRow(1) translate <0,0,-2.1>}
                object { getLEDRow(3) translate <0,0,-4.2>}
                object { getLEDRow(1) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 6)
                object { getLEDRow(7) }
                object { getLEDRow(1) translate <0,0,-2.1>}
                object { getLEDRow(3) translate <0,0,-4.2>}
                object { getLEDRow(1) translate <0,0,-6.3>}
                object { getLEDRow(1) translate <0,0,-8.4>}
        #end
        #if(theLetter = 7)
                object { getLEDRow(7) }
                object { getLEDRow(1) translate <0,0,-2.1>}
                object { getLEDRow(5) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 8)
                object { getLEDRow(5) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(7) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(5) translate <0,0,-8.4>}
        #end
        #if(theLetter = 10)
                object { getLEDRow(4) }
                object { getLEDRow(4) translate <0,0,-2.1>}
                object { getLEDRow(4) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 12)
                object { getLEDRow(1) }
                object { getLEDRow(1) translate <0,0,-2.1>}
                object { getLEDRow(1) translate <0,0,-4.2>}
                object { getLEDRow(1) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 14)
                object { getLEDRow(7) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(5) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(5) translate <0,0,-8.4>}
        #end
        #if(theLetter = 15)
                object { getLEDRow(7) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(5) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 16)
                object { getLEDRow(7) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(7) translate <0,0,-4.2>}
                object { getLEDRow(1) translate <0,0,-6.3>}
                object { getLEDRow(1) translate <0,0,-8.4>}
        #end
        #if(theLetter = 18)
                object { getLEDRow(7) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(7) translate <0,0,-4.2>}
                object { getLEDRow(3) translate <0,0,-6.3>}
                object { getLEDRow(5) translate <0,0,-8.4>}
        #end
        #if(theLetter = 19)
                object { getLEDRow(7) }
                object { getLEDRow(1) translate <0,0,-2.1>}
                object { getLEDRow(7) translate <0,0,-4.2>}
                object { getLEDRow(4) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 20)
                object { getLEDRow(7) }
                object { getLEDRow(2) translate <0,0,-2.1>}
                object { getLEDRow(2) translate <0,0,-4.2>}
                object { getLEDRow(2) translate <0,0,-6.3>}
                object { getLEDRow(2) translate <0,0,-8.4>}
        #end
        #if(theLetter = 21)
                object { getLEDRow(5) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(5) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(7) translate <0,0,-8.4>}
        #end
        #if(theLetter = 22)
                object { getLEDRow(5) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(5) translate <0,0,-4.2>}
                object { getLEDRow(5) translate <0,0,-6.3>}
                object { getLEDRow(2) translate <0,0,-8.4>}
        #end
        #if(theLetter = 25)
                object { getLEDRow(5) }
                object { getLEDRow(5) translate <0,0,-2.1>}
                object { getLEDRow(2) translate <0,0,-4.2>}
                object { getLEDRow(2) translate <0,0,-6.3>}
                object { getLEDRow(2) translate <0,0,-8.4>}
        #end
        #if(theLetter = 27)
                object { getLEDRow(0) }
                object { getLEDRow(0) translate <0,0,-2.1>}
                object { getLEDRow(7) translate <0,0,-4.2>}
                object { getLEDRow(0) translate <0,0,-6.3>}
                object { getLEDRow(0) translate <0,0,-8.4>}
        #end
                }
#end

#macro getLEDStream(one, two, three, four, five, six, seven,eight)
union   {
        object  { getLEDLetter(one) }
        object  { getLEDLetter(two)  translate <8,0,0>}
        object  { getLEDLetter(three) translate <16,0,0>}
        object  { getLEDLetter(four)  translate <24,0,0>}
        object  { getLEDLetter(five) translate <32,0,0>}
        object  { getLEDLetter(six) translate <40,0,0>}
        object  { getLEDLetter(seven) translate <48,0,0>}
        object  { getLEDLetter(eight) translate <56,0,0>}
        }
#end



#macro LEDBox() union {
        difference      {
                object  {
                        Round_Box(<-35,5,3>, < 35, 0, -13>, 1, no)
                        texture {
                                pigment {
                                        Gray20 //DarkSlateGrey //Black
                                        }
                                finish  {
                                        ambient 0
                                        specular 0.5
                                        roughness .002
                                        reflection { 0.1,.5 }
                                        diffuse 0.8
                                        }
                                normal  {
                                        bumps .3
                                        scale 0.1
                                        }
                                }
                        }
                box     {
                        <-32.99999,6,.99999>,
                        <32.99999,0.99,-10.99999>
                        texture { T_Chrome_3B //1A
                                finish  {
                                        ambient 0
                                        diffuse 0.8
                                        }
                                }
                        }
                }
        box     {
        <-33,5,1>,
        <33,4.5,-11>
        texture {
                pigment {
                        Clear
                        }
                finish  {
                        reflection { 0.1,1 }
                        specular 0.5
                        diffuse 0.1
                        ambient 0
                        }
                }
        hollow
        interior        {
                        ior 1.5
                        }
        }

        object { getLEDStream(10,1,19,15,14,0,0,0)  translate <-30,1.1,-.6>}
        cylinder        {
                        <-35,2.5,0>,
                        <-35.3,2.5,0>
                        1.5
                        texture {
                                pigment { Black }
                                finish  {
                                        reflection { 0,.7 }
                                        specular 0.7
                                        diffuse 0.1
                                        ambient 0
                                        }
                                }
                        }
        sphere_sweep    {
                        cubic_spline
                        5,
                        <-32,2.5,0>,0.8,
                        <-35,2.5,0>,0.8,
                        <-50,2.5,0>,0.8,
                        <-75,-12.5,0>,0.8
                        <-95,-18.5,0>,0.8
                        texture {
                                pigment { Black }
                                finish  {
                                        reflection { 0.1,1 }
                                        specular 0.1
                                        diffuse 0.6
                                        ambient 0
                                        }
                                }
                        }
}
#end

/*
plane   { <0, 1, 0>, -0.0001
        texture { SnakeWood
                finish  {
                        reflection {0.1,0.3}
                        specular 0.5
                        ambient 0
                        }
                rotate <0,34,0>
                }
        }
*/
// atmospheric media can be generated by adding a media statement
// to the scene not attached to any specific object
/*
media {    // atmospheric media sample
  intervals 10
  scattering { 1, rgb 0.03 }
  samples 1, 10
  confidence 0.9999
  variance 1/1000
  ratio 0.9
}
*/

background { color <0.25,0.35,0.80> }

camera  { location <-30,35,-65> look_at <-5,5,0> }
background { color Black }
object { LEDBox() rotate <-90,0,0> translate <0,13,0>}
object  { Round_Box(<-42,0,-17>,<100,-5,1000>,0.2,no)
        texture {
                SnakeWood scale 1
                finish  {
                        ambient 0
                        }
                rotate <0,5,0>
                }
        texture {
                pigment { color rgbf< 0.7, 0.8, 0.98,1> }
                finish  {
                        reflection 0.05//{0.1,0.2}
                        specular 0.5
                        ambient 0
                        diffuse 0.7
                        }
                }
        }

//light_source { <40,70,-50> colour White spotlight point_at <-55,0,0> 
tightness 50 radius 7 falloff 10 photons { reflection on refraction on } }
//light_source { <60,100,50> colour White spotlight point_at <0,0,0> 
tightness 50 radius 7 falloff 10 photons { reflection on refraction on } }
////light_source { <0,80,-40> colour rgb <0.2, 0.25, 0.3> spotlight point_at 
<0,0,0> tightness 50 radius 7 falloff 10 photons { reflection on refraction 
on } }
//light_source { <0, 80, -40> color rgb <0.2, 0.25, 0.3> shadowless }


Post a reply to this message

From: scott
Subject: Re: Optical modelling of LEDs....real world problem!
Date: 5 May 2005 04:54:55
Message: <4279df5f@news.povray.org>
rgbphil wrote:
> Hi all,
>
> Wondering if I could get some pointers to modelling optical
> components, specially LEDs. My 'Real World' problem is designing RGB
> LED clusters and I thought PovRay or MegaPOV could help. Have been
> having a bit of fun over at candlepower forums....try searching for
> posts from rgbphil.

If you are actually wanting something to realistically model light output
for design work, don't use POV.  POV is great for producing pretty pictures,
but it cannot (and isn't designed to) produce accurate scientific results.
There are plenty of other optical modelling programs out there that *are*
designed for this purpose.  If you are designing LED clusters, surely you
have some of this already? ;-)  We have some here (I forget what it's
called, it's got a crappy UI) but we wrote our own because it didn't do
exactly what we wanted.  I doubt our company would release it as freeware!


Post a reply to this message

From: greencandle
Subject: Re: Optical modelling of LEDs....real world problem!
Date: 16 May 2005 11:05:01
Message: <web.4288b5ca311596f986b38f1a0@news.povray.org>
"rgbphil" <nomail@nomail> wrote:
> Hi all,
>
> Wondering if I could get some pointers to modelling optical components,
> specially LEDs. My 'Real World' problem is designing RGB LED clusters and I
> thought PovRay or MegaPOV could help. Have been having a bit of fun over at
> candlepower forums....try searching for posts from rgbphil.
>
>
I've modelled optical fibre with some success, but had to put up the number
of reflections allowed to a high number. Make the core slightly larger than
the cladding so as to get a "weld". Also, Winston cone type optical
concentrators

I think POV-RAY would make a good input definition for all sorts of 3-d
problems such as electromagnetic modelling or mechanical structure
analysis. Any insomniacs out there want to consider this?


Post a reply to this message

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