POV-Ray : Newsgroups : povray.advanced-users : object with 2 different ior (doublet of lens) Server Time
3 Jul 2024 05:36:33 EDT (-0400)
  object with 2 different ior (doublet of lens) (Message 1 to 3 of 3)  
From:
Subject: object with 2 different ior (doublet of lens)
Date: 23 Apr 2008 15:25:01
Message: <web.480f8bebca4ee21bdcf53ead0@news.povray.org>
Hi
I'm looking to simulate a doublet of lens. I have a problem with photons when I
take the two lens separately. Photons are stopped in the interface.
For now, I'm trying to construct my doublet in one object but I don't know if
it's the best way.

For exemple, this is my lens

#declare lentille = merge
{
 intersection
 {
  cylinder{<0,0,16>,<0,0,1>,25.4}
  sphere{<0,0,15-83.2>,83.2}
  sphere{<0,0,71.1+3>,71.1}
  hollow
  pigment {Clear } interior { ior n1}
  photons {target reflection off refraction on collect off}
 }
 intersection
 {
  sphere{<0,0,247.7>, 247.7}
  cylinder{<0,0,7.7>,<0,0,-1>,25.4}
  hollow
  pigment {Clear } interior { ior n11}
  photons {target reflection off refraction on collect off}
 }
}

In this way, are my ior conserved in each part?
Does there another solution?

Thank you

Sylvain


Post a reply to this message

From: Alain
Subject: Re: object with 2 different ior (doublet of lens)
Date: 24 Apr 2008 12:18:18
Message: <4810b2ca$1@news.povray.org>
Sylvain Dubé nous illumina en ce 2008/04/23 15:20 -->
> Hi
> I'm looking to simulate a doublet of lens. I have a problem with photons when I
> take the two lens separately. Photons are stopped in the interface.
> For now, I'm trying to construct my doublet in one object but I don't know if
> it's the best way.
> 
> For exemple, this is my lens
> 
> #declare lentille = merge
> {
>  intersection
>  {
>   cylinder{<0,0,16>,<0,0,1>,25.4}
>   sphere{<0,0,15-83.2>,83.2}
>   sphere{<0,0,71.1+3>,71.1}
>   hollow
>   pigment {Clear } interior { ior n1}
>   photons {target reflection off refraction on collect off}
>  }
>  intersection
>  {
>   sphere{<0,0,247.7>, 247.7}
>   cylinder{<0,0,7.7>,<0,0,-1>,25.4}
>   hollow
>   pigment {Clear } interior { ior n11}
>   photons {target reflection off refraction on collect off}
>  }
> }
> 
> In this way, are my ior conserved in each part?
> Does there another solution?
> 
> Thank you
> 
> Sylvain
> 
> 
"hollow" is totaly, completely and uterly useless in your case, as your lense 
don't contain any media.

Make sure that there is a slighy gap between the two components to prevent any 
coincident surfaces. Also, make sure that the components never intersect as they 
do in your sample. It's unrealistic. The behaviour is also hard to predict.

You don't need to use a merge, a simple union is good enough.
It's beter to place the photons block in the union rather than to each 
individual component. If you use the same texture for all element, it's also 
beter to place your texture in the union and not in each component definition.

What is your max_trace_level? It default to 5, and your doublet counts 4 
surfaces. If your photons ever encounter even 1 surface prior to entering the 
double lense, they won't get out. You must count 2 steps for each transparent 
object, one for any reflection and one for the surface that will receive the 
photons. If you are unsure, take a larger value than what you guessed, up to 256.

Your solution may be as simple as adding:

global_settings{max_trace_level 7}

Make it the first line of your scene.

I've tested your sample, after moving the elements so that they no longer 
overlap, and with max_trace_level of 6.
The provided lense have a prety short focal lenght. Maybe your receiving surface 
was set to far away and the photons got to dispersed to still be visible...

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you tell stories to your kids that 
include stuff like "Once there was a polygon mesh who was very sad because he 
was only Gourard shaded."
     -- Taps a.k.a. Tapio Vocadlo


Post a reply to this message

From: Jan Dvorak
Subject: Re: object with 2 different ior (doublet of lens)
Date: 24 Apr 2008 15:04:37
Message: <4810d9c5@news.povray.org>
Alain napsal(a):
> Sylvain Dubé nous illumina en ce 2008/04/23 15:20 -->
>> Hi
>> I'm looking to simulate a doublet of lens. I have a problem with 
>> photons when I
>> take the two lens separately. Photons are stopped in the interface.
>> For now, I'm trying to construct my doublet in one object but I don't 
>> know if
>> it's the best way.
>>
>> For exemple, this is my lens
>>
>> #declare lentille = merge
>> {
>>  intersection
>>  {
>>   cylinder{<0,0,16>,<0,0,1>,25.4}
>>   sphere{<0,0,15-83.2>,83.2}
>>   sphere{<0,0,71.1+3>,71.1}
>>   hollow
>>   pigment {Clear } interior { ior n1}
>>   photons {target reflection off refraction on collect off}
>>  }
>>  intersection
>>  {
>>   sphere{<0,0,247.7>, 247.7}
>>   cylinder{<0,0,7.7>,<0,0,-1>,25.4}
>>   hollow
>>   pigment {Clear } interior { ior n11}
>>   photons {target reflection off refraction on collect off}
>>  }
>> }
>>
>> In this way, are my ior conserved in each part?
>> Does there another solution?
>>
>> Thank you
>>
>> Sylvain
>>
>>
> "hollow" is totaly, completely and uterly useless in your case, as your 
> lense don't contain any media.
> 
> Make sure that there is a slighy gap between the two components to 
> prevent any coincident surfaces. Also, make sure that the components 
> never intersect as they do in your sample. It's unrealistic. The 
> behaviour is also hard to predict.
> 
> You don't need to use a merge, a simple union is good enough.
> It's beter to place the photons block in the union rather than to each 
> individual component. If you use the same texture for all element, it's 
> also beter to place your texture in the union and not in each component 
> definition.
> 
> What is your max_trace_level? It default to 5, and your doublet counts 4 
> surfaces. If your photons ever encounter even 1 surface prior to 
> entering the double lense, they won't get out. You must count 2 steps 
> for each transparent object, one for any reflection and one for the 
> surface that will receive the photons. If you are unsure, take a larger 
> value than what you guessed, up to 256.
> 
> Your solution may be as simple as adding:
> 
> global_settings{max_trace_level 7}
> 
> Make it the first line of your scene.
> 
> I've tested your sample, after moving the elements so that they no 
> longer overlap, and with max_trace_level of 6.
> The provided lense have a prety short focal lenght. Maybe your receiving 
> surface was set to far away and the photons got to dispersed to still be 
> visible...
> 
If you move the objects slightly apart you will get a visible gap. I 
think the refraction works this way: It remembers the objects it is in 
and uses the IOR of the last object entered and not escaped. Not sure 
how this applies to a union but merge will cause problems.

-- 
the ultimate time-killer:
+a0.0 +am2 +r9

Johnny D


Post a reply to this message

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