POV-Ray : Newsgroups : povray.newusers : Transparency with touching bodies Server Time
1 Nov 2024 02:20:27 EDT (-0400)
  Transparency with touching bodies (Message 1 to 10 of 10)  
From: MrS1203
Subject: Transparency with touching bodies
Date: 16 Feb 2011 08:40:00
Message: <web.4d5bd212c949b2b1b5bb38ea0@news.povray.org>
Hi,

I want to use POV-Ray to simulate an physicalic correct x-ray image. To do that
I use completely transparent bodies (filter 1) and the physicalic correct fade
distance for the used materials. To test this, I create two boxes on top of each
other. The code looks like this (don't
wonder about the small values, I need to work with millimeters):

//----------------------------
#include "colors.inc"
#declare Nothing = texture {pigment {color White filter 1} }
#declare Metall1 = interior{ fade_power 1000  fade_distance 8.8865E-5}
#declare Metall2 = interior{ fade_power 1000  fade_distance 3.01368E-4}

light_source { <0,0,0.1> color rgb <1,1,1> }
camera {orthographic location <0,0,-0.1> look_at <0,0,0> angle 5 }
background { color White }


box { <-2E-3, -0.5E-3, 0>, <2E-3, 0.5E-3, 0.03E-3>
texture {Nothing}
interior {Metall1}
 }


box { <-0.5E-3, -2E-3, 0.03E-3>, <0.5E-3, 2E-3, 0.06E-3>
texture {Nothing}
interior {Metall2}
 }
//----------------------------


When you try this code you will notice, that the boxes are not transparent on
their touching area. If you "push" the upper box a little bit higher so they
don't touch each other any more (1E-6 is enough), then you get the expected and
correct image.


//----------------------------
#include "colors.inc"
#declare Nothing = texture {pigment {color White filter 1} }
#declare Metall1 = interior{ fade_power 1000  fade_distance 8.8865E-5}
#declare Metall2 = interior{ fade_power 1000  fade_distance 3.01368E-4}

light_source { <0,0,0.1> color rgb <1,1,1> }
camera {orthographic location <0,0,-0.1> look_at <0,0,0> angle 5 }
background { color White }


box { <-2E-3, -0.5E-3, 0>, <2E-3, 0.5E-3, 0.03E-3>
texture {Nothing}
interior {Metall1}
 }


box { <-0.5E-3, -2E-3, 0.03E-3+1E-6>, <0.5E-3, 2E-3, 0.06E-3+1E-6>
texture {Nothing}
interior {Metall2}
 }
//----------------------------


Has anybody an idea why this happens and how I can avoid that effect without
"pushing" bodies around?


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Transparency with touching bodies
Date: 16 Feb 2011 08:45:00
Message: <web.4d5bd47dee974b6981c811d20@news.povray.org>
Sounds like a coincident surface issue.  One thing you can do is use merge{}
with touching or overlapping objects, however this does tend to add to the
render time, sometimes significantly

-tgq


Post a reply to this message

From: MrS1203
Subject: Re: Transparency with touching bodies
Date: 16 Feb 2011 08:55:01
Message: <web.4d5bd69cee974b69b5bb38ea0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> Sounds like a coincident surface issue.  One thing you can do is use merge{}
> with touching or overlapping objects, however this does tend to add to the
> render time, sometimes significantly
>
> -tgq

Thank you for your quick response. I tried to merge the two boxes but then it
seems like the touching area is not effected by the fade distance any more -
this area gets comletely white, which is not correct. The problem is, that every
used material has to use it's own fade distances to generate a correct x-ray
image.

Other ideas to solve this problem with the coincident surfaces?


Post a reply to this message

From: clipka
Subject: Re: Transparency with touching bodies
Date: 16 Feb 2011 10:35:47
Message: <4d5beed3$1@news.povray.org>
Am 16.02.2011 14:54, schrieb MrS1203:

> Other ideas to solve this problem with the coincident surfaces?

No. It /is/ a known problem, and the only known solution is to avoid 
coincident surfaces wherever they're visible.


Post a reply to this message

From: MrS1203
Subject: Re: Transparency with touching bodies
Date: 16 Feb 2011 13:55:00
Message: <web.4d5c1c98ee974b69442a29570@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 16.02.2011 14:54, schrieb MrS1203:
>
> > Other ideas to solve this problem with the coincident surfaces?
>
> No. It /is/ a known problem, and the only known solution is to avoid
> coincident surfaces wherever they're visible.

Ok, thank you. Then I have to seperate these surfaces with a "push". Not very
nice but it's bearable.


Post a reply to this message

From: Alain
Subject: Re: Transparency with touching bodies
Date: 16 Feb 2011 20:25:16
Message: <4d5c78fc@news.povray.org>

> Hi,
>
> I want to use POV-Ray to simulate an physicalic correct x-ray image. To do that
> I use completely transparent bodies (filter 1) and the physicalic correct fade
> distance for the used materials. To test this, I create two boxes on top of each
> other. The code looks like this (don't
> wonder about the small values, I need to work with millimeters):
>
> //----------------------------
> #include "colors.inc"
> #declare Nothing = texture {pigment {color White filter 1} }
> #declare Metall1 = interior{ fade_power 1000  fade_distance 8.8865E-5}
> #declare Metall2 = interior{ fade_power 1000  fade_distance 3.01368E-4}
>
> light_source {<0,0,0.1>  color rgb<1,1,1>  }
> camera {orthographic location<0,0,-0.1>  look_at<0,0,0>  angle 5 }
> background { color White }
>
>
> box {<-2E-3, -0.5E-3, 0>,<2E-3, 0.5E-3, 0.03E-3>
> texture {Nothing}
> interior {Metall1}
>   }
>
>

You need to avoid coincident surfaces, so, you need to fudge your 
objects dimentions a little so that ther surfaces are very close without 
actualy touching.

A side note:
You don't need to use such small values, even working in mm. A POV-unit 
can be any "real world" unit you want, from Parsects (or more) down to 
Armstrong and smaller... All you need to do is to make your model 
assuming that 1 unit = 1 mm.
All you need to di is to remove those E-3 from your dimentions, or add 
+3 to the expoment.




Alain


Post a reply to this message

From: clipka
Subject: Re: Transparency with touching bodies
Date: 17 Feb 2011 04:59:45
Message: <4d5cf191$1@news.povray.org>
Am 17.02.2011 02:25, schrieb Alain:

> A side note:
> You don't need to use such small values, even working in mm. A POV-unit
> can be any "real world" unit you want, from Parsects (or more) down to
> Armstrong and smaller... All you need to do is to make your model
> assuming that 1 unit = 1 mm.

You probably mean Angstrom?

Well, given that visible light has a wavelength of ~400-800 nm = 
6000-8000 Angstrom, rendering results probably won't be too realistic at 
those dimensions :-P


Post a reply to this message

From: Alain
Subject: Re: Transparency with touching bodies
Date: 17 Feb 2011 22:43:55
Message: <4d5deafb@news.povray.org>

> Am 17.02.2011 02:25, schrieb Alain:
>
>> A side note:
>> You don't need to use such small values, even working in mm. A POV-unit
>> can be any "real world" unit you want, from Parsects (or more) down to
>> Armstrong and smaller... All you need to do is to make your model
>> assuming that 1 unit = 1 mm.
>
> You probably mean Angstrom?
>
> Well, given that visible light has a wavelength of ~400-800 nm =
> 6000-8000 Angstrom, rendering results probably won't be too realistic at
> those dimensions :-P

If you use hard gamma rays as a light source and false colour it...

When working in microscopic scale, NO imaging is going to be realistic, 
even a photo. Usualy, when going under the micrometer scale, colours 
tend to loose any meaning. The same also appens to highlights soon after 
that.
In the photos we see, any colour is from extremely concentrated dies and 
post processing. Under a microscope, without dies, any cell looks prety 
much colourless transparent, with the occasional speck of colour.



Alain


Post a reply to this message

From: MrS1203
Subject: Re: Transparency with touching bodies
Date: 18 Feb 2011 04:35:00
Message: <web.4d5e3ce0ee974b69b5bb38ea0@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> You need to avoid coincident surfaces, so, you need to fudge your
> objects dimentions a little so that ther surfaces are very close without
> actualy touching.
>
> A side note:
> You don't need to use such small values, even working in mm. A POV-unit
> can be any "real world" unit you want, from Parsects (or more) down to
> Armstrong and smaller... All you need to do is to make your model
> assuming that 1 unit = 1 mm.
> All you need to di is to remove those E-3 from your dimentions, or add
> +3 to the expoment.

Thanks for your response. My plan is to import objects from another software
into POV-Ray. From this software I only get a huge amount of points, which have
to meshed in POV-Ray. To change the value of one coordinate (such as the
z-value) before meshing those points is no problem. To change the whole
dimension of the objects is sadly not possible, the objects are not symmetric.
Or is there any way to shrink an object which is made out of meshed points?

I have to use these small values because I get them from the other software
where I have to use SI-units. To test my approach I used small values too. It
would be possible to multiply all coordinates with 1000 to get "normal" values.
But I don't see any advantages if I would do that. Or do I overlook something?


Post a reply to this message

From: Alain
Subject: Re: Transparency with touching bodies
Date: 19 Feb 2011 21:55:50
Message: <4d6082b6$1@news.povray.org>

> Alain<aze### [at] qwertyorg>  wrote:
>> You need to avoid coincident surfaces, so, you need to fudge your
>> objects dimentions a little so that ther surfaces are very close without
>> actualy touching.
>>
>> A side note:
>> You don't need to use such small values, even working in mm. A POV-unit
>> can be any "real world" unit you want, from Parsects (or more) down to
>> Armstrong and smaller... All you need to do is to make your model
>> assuming that 1 unit = 1 mm.
>> All you need to di is to remove those E-3 from your dimentions, or add
>> +3 to the expoment.
>
> Thanks for your response. My plan is to import objects from another software
> into POV-Ray. From this software I only get a huge amount of points, which have
> to meshed in POV-Ray. To change the value of one coordinate (such as the
> z-value) before meshing those points is no problem. To change the whole
> dimension of the objects is sadly not possible, the objects are not symmetric.
> Or is there any way to shrink an object which is made out of meshed points?
If you multiply all the coordinates of an object by a constant value, 
you effectively scale that object. If the object is not at the origin, 
the object will also move radialy.
Once the mesh have been created, you can scale it like any other object.
A scale like: scale<1, 1, 0.999999> will cause almost no distortion, 
shrink by 1 millionth along the Z axis, and is enough to prevent a 
coincident surfaces.
>
> I have to use these small values because I get them from the other software
> where I have to use SI-units. To test my approach I used small values too. It
> would be possible to multiply all coordinates with 1000 to get "normal" values.
> But I don't see any advantages if I would do that. Or do I overlook something?
>
>
>
>

Working in mm with units of 1 m, not realy problematic unless you also 
have some rather small values. By small, I think under 0.001mm or less.

If you use to small values, you can begin to have floating point 
precision and rounding errors.
It can manifest by areas that are suposed to be lighted been dark or 
areas that are suposed to be shadowed been lighted. It also can manifest 
itself by having light "leaking" from some corners.

If that appens, then, yes, you may need to scale everything up. Place 
all your objects into one big union and scale that union up as needed.

BUT. If all your values are within some reasonable range, there should 
be no real problem. Reasonable usualy been a range of about 4 order of 
magnitude.

Just try to not put your light to far away, like over 1000m away when 
working in mm. If you need a very distant light, use the parallel 
attribute and place it closer. "parallel" simulate a light situated at 
an "infinite" distance.



Alain


Post a reply to this message

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