POV-Ray : Newsgroups : povray.advanced-users : Slicing media - is it possible ? Server Time
31 Oct 2024 06:14:23 EDT (-0400)
  Slicing media - is it possible ? (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: yesbird
Subject: Slicing media - is it possible ?
Date: 24 Sep 2024 13:40:22
Message: <66f2f986@news.povray.org>
Hi,
I am trying to apply CSG operations to objects filled with media without
any success (results also attached):
https://povlab.online/?scene=dicom.pov

Who knows if it's really possible or I am only wasting the time trying
to force it to work ?

Thanks in advance.
--
YB


Post a reply to this message


Attachments:
Download 'dicom.png' (351 KB)

Preview of image 'dicom.png'
dicom.png


 

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 24 Sep 2024 13:51:58
Message: <66f2fc3e$1@news.povray.org>
On 24/09/2024 20:40, yesbird wrote:

PS: I know, that by changing the cube size this effect can be achieved,
but applying CSG operations is still mystery to me.
--
YB


Post a reply to this message

From: Bald Eagle
Subject: Re: Slicing media - is it possible ?
Date: 24 Sep 2024 14:15:00
Message: <web.66f3018ad5a4caf1d2a18eff25979125@news.povray.org>
yesbird <sya### [at] gmailcom> wrote:
> Hi,
> I am trying to apply CSG operations to objects filled with media without
> any success (results also attached):
> https://povlab.online/?scene=dicom.pov
>
> Who knows if it's really possible or I am only wasting the time trying
> to force it to work ?
>
> Thanks in advance.
> --
> YB

Media is . . . tricky.
(Thus why I haven't used it a lot)

Just curious:
Have you tried the reverse - applying CSG operations to a container and THEN
filling it with media?

I think that if you read the documentation on the details of how media works, it
might help - or it may not.  It's so very dependent on what you're trying to do
and how you're going about doing it.

- BW


Post a reply to this message

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 24 Sep 2024 14:34:21
Message: <66f3062d@news.povray.org>
On 24/09/2024 21:14, Bald Eagle wrote:
> Just curious:
> Have you tried the reverse - applying CSG operations to a container and THEN
> filling it with media?

Hmm, interesting - I will try ...
--
YB


Post a reply to this message

From: MichaelJF
Subject: Re: Slicing media - is it possible ?
Date: 24 Sep 2024 15:37:31
Message: <66f314fb@news.povray.org>
Am 24.09.2024 um 20:14 schrieb Bald Eagle:
> yesbird <sya### [at] gmailcom> wrote:
>> Hi,
>> I am trying to apply CSG operations to objects filled with media without
>> any success (results also attached):
>> https://povlab.online/?scene=dicom.pov
>>
>> Who knows if it's really possible or I am only wasting the time trying
>> to force it to work ?
>>
>> Thanks in advance.
>> --
>> YB
> 
> Media is . . . tricky.

Indeed!

> (Thus why I haven't used it a lot)
> 
> Just curious:
> Have you tried the reverse - applying CSG operations to a container and THEN
> filling it with media?
> 
> I think that if you read the documentation on the details of how media works, it
> might help - or it may not.  It's so very dependent on what you're trying to do
> and how you're going about doing it.
> 
The section "Multiple Density vs. Multiple Media" may be of help. One 
can simulate intersections and unions of media with this approach.

Most freedom you can achieve with user defined functions to control the 
density. But it can be very time-consuming to find the right parameters.



Best regards
Michael


Post a reply to this message

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 24 Sep 2024 16:33:56
Message: <66f32234$1@news.povray.org>
On 24/09/2024 22:37, MichaelJF wrote:
> The section "Multiple Density vs. Multiple Media" may be of help. One 
> can simulate intersections and unions of media with this approach.
> 
> Most freedom you can achieve with user defined functions to control the 
> density. But it can be very time-consuming to find the right parameters.

Thanks a lot, I will explore it !
--
YB


Post a reply to this message

From: Alain Martel
Subject: Re: Slicing media - is it possible ?
Date: 25 Sep 2024 11:35:56
Message: <66f42ddc$1@news.povray.org>
Le 2024-09-24 à 13:40, yesbird a écrit :
> Hi,
> I am trying to apply CSG operations to objects filled with media without
> any success (results also attached):
> https://povlab.online/?scene=dicom.pov
> 
> Who knows if it's really possible or I am only wasting the time trying
> to force it to work ?
> 
> Thanks in advance.
> -- 
> YB
Looks like that box is opaque.

If you start by applying the media THEN cut away, you need to make sure 
that the other object also have rgbt 1 as it's pigment.

The best approach here is to do all of your CSG before adding your 
media, add the transparent pigment at once to the totality of the 
composite object, then add the media.

DO NOT use union. You can use merge, intersection and difference. As 
union don't remove any internal surface, it'll wreak havoc with your media.


Post a reply to this message

From: Alain Martel
Subject: Re: Slicing media - is it possible ?
Date: 25 Sep 2024 11:58:57
Message: <66f43341@news.povray.org>
Le 2024-09-24 à 13:40, yesbird a écrit :
> Hi,
> I am trying to apply CSG operations to objects filled with media without
> any success (results also attached):
> https://povlab.online/?scene=dicom.pov
> 
> Who knows if it's really possible or I am only wasting the time trying
> to force it to work ?
> 
> Thanks in advance.
> -- 
> YB

I see that your code use intervals 60.
That's REAL bad.
This will render faster with better results :

#declare themedia = interior{
media{
	samples 100
	// stating method 3 is not needed as it's the default
	// ratio is not used with method 3
	// confidence and variance are also not used
	emission 1/20 //OK
	absorption 1/1000 //OK
	scattering {1, -0.3} //OK
	density{
		<density items>
		// As interpolate 0 mean no interpolation,
		// you can omit it
		}
	}
}

Using intervals with any value >1 massively increase the rendering time 
and can introduce artifacts and glitches.

Then. Change your container as follow :
difference{
	box{	0, 1
		translate -0.5
		scale 200
	}// NO pigment
	box{	0, 1
		translate -0.5
		scale <100, 100, 201>//400 is uselessly large
	}//still no pigment
	hollow //apply to the difference as a whole
	pigment{rgbf 1}
	interior{ theinterior}
	}


Using the default method 3, you need to avoid using intervals 
altogether. Using intervals is a huge performance killer.
Then, the parameters ratio, confidence and variance are specific to 
method 1 and 2 and are used to control how many samples are to be used 
for each intervals. As you work with only 1 intervals, they have no effect.


Post a reply to this message

From: MichaelJF
Subject: Re: Slicing media - is it possible ?
Date: 25 Sep 2024 16:54:24
Message: <66f47880$1@news.povray.org>
Sorry, yesterday I addressed the general question of the possibility of 
CSG operations with media and not your special example. Now reading 
Alains post, I think your actual problem has nothing to do with media at 
all, but with the way POV handles textures in case of a CSG difference. 
May be sections 3.6.1.9 and 3.6.1.10 in the docs about interior and 
cutaway textures solve your special riddle since the default of an 
undefined texture is black as is your background. In your case the 
texture of the subtracted second box is undefined as well as the 
interior/cutaway texture of the first with the df3-interior. Anyway, 
Alains remedies shuld help.

Best regards
Michael


Post a reply to this message

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 26 Sep 2024 16:25:51
Message: <66f5c34f@news.povray.org>
On 25/09/2024 18:58, Alain Martel wrote:
> I see that your code use intervals 60.
> That's REAL bad.
> This will render faster with better results :
>  
> #declare themedia = interior{
> media{
>      samples 100
>      // stating method 3 is not needed as it's the default
>      // ratio is not used with method 3
>      // confidence and variance are also not used
>      emission 1/20 //OK
>      absorption 1/1000 //OK
>      scattering {1, -0.3} //OK
>      density{
>          <density items>
>          // As interpolate 0 mean no interpolation,
>          // you can omit it
>          }
>      }
> }

Alan !
Many, many thanks for this correction - rendering now is really faster
with better quality. All your information about parameter's
interference is also very valuable - you saved a lot of time for me.
I like your deep and serious  approach.

> Then. Change your container as follow :
> difference{
>      box{    0, 1
>          translate -0.5
>          scale 200
>      }// NO pigment
>      box{    0, 1
>          translate -0.5
>          scale <100, 100, 201>//400 is uselessly large
>      }//still no pigment
>      hollow //apply to the difference as a whole
>      pigment{rgbf 1}
>      interior{ theinterior}
>      }
> 

Unfortunately here still no success (please see 1st attached image).
It looks like scaling / translation issue - I will try to fix it.

In any case slicing by orthogonal planes by changing the box size
(as on 2nd image) will be enough - CSG operations was only exercise for
me. And now I believe - the media is really tricky :)
--
YB


Post a reply to this message


Attachments:
Download 'dicom_diff.png' (328 KB) Download 'dicom_slice.png' (348 KB)

Preview of image 'dicom_diff.png'
dicom_diff.png

Preview of image 'dicom_slice.png'
dicom_slice.png


 

Goto Latest 10 Messages Next 5 Messages >>>

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