POV-Ray : Newsgroups : povray.general : Object clipping issue Server Time: 19 May 2019 10:45:25 GMT
  Object clipping issue (Message 1 to 7 of 7)  
From: Mike Horvath
Subject: Object clipping issue
Date: 18 Feb 2019 12:53:48
Message: <5c6aaadc@news.povray.org>
I am having issues in the following code. The cylinder segment boxes 
appear to be clipped and hollow, but I'm not actually using `clipped_by` 
anywhere. Does anyone have a clue what is happening? Thanks.

Mike


//--------------------------------------------------------------Table
#declare Muns_cen_table = array[11][6]
{
//   h  V   C        R        G        B
{    0, 0,  0,   0/255,   0/255,   0/255},
{    0, 1,  0,  28/255,  28/255,  28/255},
{    0, 2,  0,  48/255,  48/255,  48/255},
{    0, 3,  0,  70/255,  70/255,  70/255},
{    0, 4,  0,  97/255,  97/255,  97/255},
{    0, 5,  0, 124/255, 124/255, 124/255},
{    0, 6,  0, 150/255, 150/255, 150/255},
{    0, 7,  0, 179/255, 179/255, 179/255},
{    0, 8,  0, 203/255, 203/255, 203/255},
{    0, 9,  0, 232/255, 232/255, 232/255},
{    0, 10, 0, 255/255, 255/255, 255/255}
}

//--------------------------------------------------------------Parameters

#macro SetClock(StartTime, EndTime)
     #local R = (clock - StartTime)/(EndTime - StartTime);
     #local S = min(max(0, R), 1);
     S
#end

#declare Muns_slice_angle	= 360/40;
#declare Muns_gap_width		= 1/40;		// this is actually 1/2 the true gap
#declare Muns_cam_view		= 3;		// 0 = isometric; 1 = overhead; 2 = front 
or side; 3 = custom
#declare Muns_hue_adjust	= Muns_slice_angle * 4;
#declare Muns_time_spin		= SetClock(0/3, 1/3);
#declare Muns_time_wipe		= SetClock(1/3, 2/3);
#declare Muns_time_tilt		= SetClock(2/3, 3/3);
#declare Muns_color_clamp	= 0.9;

//--------------------------------------------------------------CSG objects

#local Muns_coo_count = 0;
#local Muns_coo_max = 11;
#while (Muns_coo_count < Muns_coo_max)
   #local Muns_param_h = Muns_cen_table[Muns_coo_count][0] * 360/100;
   #local Muns_param_V = Muns_cen_table[Muns_coo_count][1] - 5;
   #local Muns_param_C = Muns_cen_table[Muns_coo_count][2]/2;
   #local Muns_param_r = Muns_cen_table[Muns_coo_count][3];
   #local Muns_param_g = Muns_cen_table[Muns_coo_count][4];
   #local Muns_param_b = Muns_cen_table[Muns_coo_count][5];
   #local Muns_coo_RGB = <Muns_param_r,Muns_param_g,Muns_param_b> * 
Muns_color_clamp;
   difference
   {
	cylinder
	{
	  -y * (1/2 - Muns_gap_width),
	  +y * (1/2 - Muns_gap_width),
	  1/2 - Muns_gap_width
	  translate  +y * Muns_param_V
	  rotate    +y * Muns_param_h
	}
	intersection
	{
	  plane {+x, 0}
	  plane {-x, 0 rotate +y * Muns_time_wipe * 180}
	  rotate    -y * Muns_hue_adjust
	}
	pigment {color srgb Muns_coo_RGB}
	finish {emission 0.3 diffuse 1}
   }
   #local Muns_coo_count = Muns_coo_count + 1;
#end


Post a reply to this message


Attachments:
Download 'munsell_srgb_example.png' (179 KB)

Preview of image 'munsell_srgb_example.png'
munsell_srgb_example.png


 

From: Mike Horvath
Subject: Re: Object clipping issue
Date: 18 Feb 2019 12:54:59
Message: <5c6aab23@news.povray.org>
Better if I should attach the whole scene, no?


Mike


Post a reply to this message


Attachments:
Download 'munsell_srgb_final.pov.txt' (90 KB)

From: clipka
Subject: Re: Object clipping issue
Date: 18 Feb 2019 20:44:32
Message: <5c6b1930$1@news.povray.org>
Am 18.02.2019 um 13:53 schrieb Mike Horvath:
> I am having issues in the following code. The cylinder segment boxes 
> appear to be clipped and hollow, but I'm not actually using `clipped_by` 
> anywhere. Does anyone have a clue what is happening? Thanks.
...
>    difference
>    {
>      cylinder
>      {
>        -y * (1/2 - Muns_gap_width),
>        +y * (1/2 - Muns_gap_width),
>        1/2 - Muns_gap_width
>        translate  +y * Muns_param_V
>        rotate    +y * Muns_param_h
>      }
>      intersection
>      {
>        plane {+x, 0}
>        plane {-x, 0 rotate +y * Muns_time_wipe * 180}
>        rotate    -y * Muns_hue_adjust
>      }
>      pigment {color srgb Muns_coo_RGB}
>      finish {emission 0.3 diffuse 1}
>    }

You're running into a coincident surface issue when Muns_time_wipe is 1. 
At this value, you're essentially intersecting a plane with a copy of 
that plane, which makes things wobbly.


Post a reply to this message

From: Mike Horvath
Subject: Re: Object clipping issue
Date: 19 Feb 2019 05:12:03
Message: <5c6b9023$1@news.povray.org>
On 2/18/2019 3:44 PM, clipka wrote:
> You're running into a coincident surface issue when Muns_time_wipe is 1. 
> At this value, you're essentially intersecting a plane with a copy of 
> that plane, which makes things wobbly.

That worked! Thanks!


Mike


Post a reply to this message

From: Mike Horvath
Subject: Re: Object clipping issue
Date: 19 Feb 2019 05:23:40
Message: <5c6b92dc$1@news.povray.org>
On 2/18/2019 7:55 AM, Mike Horvath wrote:
> Better if I should attach the whole scene, no?
> 
> 
> Mike

Performance is really poor in this scene. Each 600x600px frame of my 
test animation takes about 5 minutes to render on my machine. I am doing 
120 frames. I guess I need to add some `bounded_by` statements in there 
somewhere...


Mike


Post a reply to this message

From: Alain
Subject: Re: Object clipping issue
Date: 20 Feb 2019 19:57:31
Message: <5c6db12b$1@news.povray.org>
Le 19-02-19 à 00:23, Mike Horvath a écrit :
> On 2/18/2019 7:55 AM, Mike Horvath wrote:
>> Better if I should attach the whole scene, no?
>>
>>
>> Mike
> 
> Performance is really poor in this scene. Each 600x600px frame of my 
> test animation takes about 5 minutes to render on my machine. I am doing 
> 120 frames. I guess I need to add some `bounded_by` statements in there 
> somewhere...
> 
> 
> Mike


In this case, you have a difference of cylinders intersected by some 
planes. Each block may end up with a bounding box large enough to 
contain the whole outer cylinder. This is a case where manually bounding 
with a tight box or a sphere can help.

Do a test with only a small subset of the blocks, using only the 
difference and intersection, where each part is paired with a box made 
from the max_extent() and min_extent() for that block.
If there is much unused space, then, you may try using some manual bounding.

This may be your critical part :
intersection{
	plane {+x, -Muns_gap_width rotate +y * Muns_slice_angle/2}
	plane {-x, -Muns_gap_width rotate -y * Muns_slice_angle/2}
	difference{
		cylinder{-y*(1/2 -Muns_gap_width),+y*(1/2-Muns_gap_width),Muns_param_C 
+ (1/2 - Muns_gap_width)}
		cylinder{-y*(1/2),+y*(1/2),Muns_param_C -(1/2 -Muns_gap_width)}
		}
	translate	+y * Muns_param_V
	rotate		+y * Muns_param_h
	}


Post a reply to this message

From: Mike Horvath
Subject: Re: Object clipping issue
Date: 21 Feb 2019 07:39:41
Message: <5c6e55bd$1@news.povray.org>
On 2/20/2019 2:57 PM, Alain wrote:
> Le 19-02-19 à 00:23, Mike Horvath a écrit :
>> On 2/18/2019 7:55 AM, Mike Horvath wrote:
>>> Better if I should attach the whole scene, no?
>>>
>>>
>>> Mike
>>
>> Performance is really poor in this scene. Each 600x600px frame of my 
>> test animation takes about 5 minutes to render on my machine. I am 
>> doing 120 frames. I guess I need to add some `bounded_by` statements 
>> in there somewhere...
>>
>>
>> Mike
> 
> 
> In this case, you have a difference of cylinders intersected by some 
> planes. Each block may end up with a bounding box large enough to 
> contain the whole outer cylinder. This is a case where manually bounding 
> with a tight box or a sphere can help.

Yes, I added bounding boxes and performance is very good now. Less than 
10 seconds per frame.

Mike


Post a reply to this message

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