POV-Ray : Newsgroups : povray.advanced-users : Slicing media - is it possible ? Server Time
28 Oct 2024 04:48:30 EDT (-0400)
  Slicing media - is it possible ? (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
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


 

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 26 Sep 2024 16:31:24
Message: <66f5c49c@news.povray.org>
On 25/09/2024 23:54, MichaelJF wrote:
> Sorry, yesterday I addressed the general question of the possibility of 
> CSG operations with media and not your special example.
> ...

No problem - in any case thanks for participating in solving this
sophisticated problem :). Thanks to Alan I have a serious progress now.
--
YB


Post a reply to this message

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 26 Sep 2024 16:35:53
Message: <66f5c5a9$1@news.povray.org>
Alain, sorry for mixing you name, I need a better glasses...
--
YB


Post a reply to this message

From: Alain Martel
Subject: Re: Slicing media - is it possible ?
Date: 27 Sep 2024 10:17:23
Message: <66f6be73$1@news.povray.org>
Le 2024-09-26 à 16:35, yesbird a écrit :
> Alain, sorry for mixing you name, I need a better glasses...
> -- 
> YB
😎🤣


Post a reply to this message

From: yesbird
Subject: Re: Slicing media - is it possible ?
Date: 27 Sep 2024 22:13:46
Message: <66f7665a@news.povray.org>
On 24/09/2024 20:40, yesbird wrote:
Can't resist to share a pair of beautiful slices produced by simple
box resizing.
--
YB


Post a reply to this message


Attachments:
Download 'dicom2.png' (275 KB) Download 'dicom3.png' (474 KB)

Preview of image 'dicom2.png'
dicom2.png

Preview of image 'dicom3.png'
dicom3.png


 

From: jr
Subject: Re: Slicing media - is it possible ?
Date: 28 Sep 2024 09:50:00
Message: <web.66f808e1d5a4caf1f5bfc9b06cde94f1@news.povray.org>
hi,

yesbird <sya### [at] gmailcom> wrote:
> On 24/09/2024 20:40, yesbird wrote:
> Can't resist to share a pair of beautiful slices produced by simple
> box resizing.

agree, nice, dicom_3 in particular.  thanks.


regards, jr.


Post a reply to this message

<<< Previous 5 Messages Goto Initial 10 Messages

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