POV-Ray : Newsgroups : povray.bugreports : Odd behaviour with sphere_sweep Server Time
15 Oct 2024 05:41:14 EDT (-0400)
  Odd behaviour with sphere_sweep (Message 1 to 6 of 6)  
From: MidiPlay
Subject: Odd behaviour with sphere_sweep
Date: 10 Jan 2016 11:20:01
Message: <web.5692847b8bcbbc2219f71b680@news.povray.org>
I'm using sphere_sweep with cubic_spline to try to get a nice smooth curve, but
part of it is missing:
----
#version 3.5;
global_settings { ambient_light 0 assumed_gamma 1 }
background { rgb 0.05 }
light_source { <0,+1000,0> rgb 1 }

sphere_sweep
{
    cubic_spline
        6,
        < 0 ,  48 ,  277 >, 1
        < 0 ,  88 ,  166 >, 1
        < 0 , 115 ,   55 >, 1
        < 0 , 115 ,  -55 >, 1
        < 0 ,  88 , -166 >, 1
        < 0 ,  48 , -277 >, 1
        tolerance 0.1
        pigment { color < 1 , 1 , 1 > }
        finish { emission 1 }
}

camera
{
    perspective
    location < 320 , 100 , 0 >
    angle 80
    look_at  <   0 ,   0 , 0 >
}
----
The behaviour with linear_spline is also odd, there's a spike in the middle.  I
can't see what I might be doing wrong.  I'm using version
3.7.0.msvc10-sse2.win32 on Windows XP.  Any suggestions?

Chris


Post a reply to this message

From: Le Forgeron
Subject: Re: Odd behaviour with sphere_sweep
Date: 10 Jan 2016 12:35:17
Message: <56929655@news.povray.org>
Le 10/01/2016 17:19, MidiPlay a écrit :
> I'm using sphere_sweep with cubic_spline to try to get a nice smooth cu
rve, but
> part of it is missing:
> ----
> #version 3.5;

Are you sure ? (if yes... then emission in finish is not a good idea )

> global_settings { ambient_light 0 assumed_gamma 1 }
> background { rgb 0.05 }
> light_source { <0,+1000,0> rgb 1 }
> 
> sphere_sweep
> {
>     cubic_spline
>         6,
>         < 0 ,  48 ,  277 >, 1
>         < 0 ,  88 ,  166 >, 1
>         < 0 , 115 ,   55 >, 1
>         < 0 , 115 ,  -55 >, 1
>         < 0 ,  88 , -166 >, 1
>         < 0 ,  48 , -277 >, 1
>         tolerance 0.1
>         pigment { color < 1 , 1 , 1 > }
>         finish { emission 1 }
> }
> 

There is something strange with cubic spline:
* povray 3.6 binary gives a continuous curve
* povray 3.7 (stable, master, and others...) gives a curve splitted in
the middle.

Such split does not happen with linear_spline


> camera
> {
>     perspective
>     location < 320 , 100 , 0 >
>     angle 80
>     look_at  <   0 ,   0 , 0 >
> }
> ----
> The behaviour with linear_spline is also odd, there's a spike in the mi
ddle.  I
> can't see what I might be doing wrong.  I'm using version
> 3.7.0.msvc10-sse2.win32 on Windows XP.  Any suggestions?


Post a reply to this message


Attachments:
Download 'strange.png' (8 KB) Download 'strange.pov.txt' (1 KB) Download 'strange36.png' (9 KB)

Preview of image 'strange.png'
strange.png

Preview of image 'strange36.png'
strange36.png


 

From: William F Pokorny
Subject: Re: Odd behaviour with sphere_sweep
Date: 10 Jan 2016 12:55:10
Message: <56929afe@news.povray.org>
On 01/10/2016 12:35 PM, Le_Forgeron wrote:
> Le 10/01/2016 17:19, MidiPlay a écrit :
>
> There is something strange with cubic spline:
> * povray 3.6 binary gives a continuous curve
> * povray 3.7 (stable, master, and others...) gives a curve splitted in
> the middle.
>
> Such split does not happen with linear_spline
>

I see the same, but will add if you gradually move the Y position of the 
camera 100 -> 500 results gradually look better until at about 500 
things look OK.

Internal bounding issue?

Bill P.


Post a reply to this message

From: clipka
Subject: Re: Odd behaviour with sphere_sweep
Date: 10 Jan 2016 15:12:58
Message: <5692bb4a$1@news.povray.org>
Am 10.01.2016 um 18:55 schrieb William F Pokorny:
> On 01/10/2016 12:35 PM, Le_Forgeron wrote:
>> Le 10/01/2016 17:19, MidiPlay a écrit :
>>
>> There is something strange with cubic spline:
>> * povray 3.6 binary gives a continuous curve
>> * povray 3.7 (stable, master, and others...) gives a curve splitted in
>> the middle.
>>
>> Such split does not happen with linear_spline
>>
> 
> I see the same, but will add if you gradually move the Y position of the
> camera 100 -> 500 results gradually look better until at about 500
> things look OK.
> 
> Internal bounding issue?

Looks pretty much like that. 3rd-order polynomial (e.g. cubic) splines
are known to sometimes botch the bounding box computation.


Post a reply to this message

From: William F Pokorny
Subject: Re: Odd behaviour with sphere_sweep
Date: 26 Apr 2016 09:44:13
Message: <571f70ad$1@news.povray.org>
On 01/10/2016 03:12 PM, clipka wrote:
> Am 10.01.2016 um 18:55 schrieb William F Pokorny:
>> On 01/10/2016 12:35 PM, Le_Forgeron wrote:
>>> Le 10/01/2016 17:19, MidiPlay a écrit :
>>>
>>> There is something strange with cubic spline:
>>> * povray 3.6 binary gives a continuous curve
>>> * povray 3.7 (stable, master, and others...) gives a curve splitted in
>>> the middle.
>>>
>>> Such split does not happen with linear_spline
>>>
>>
>> I see the same, but will add if you gradually move the Y position of the
>> camera 100 -> 500 results gradually look better until at about 500
>> things look OK.
>>
>> Internal bounding issue?
>
> Looks pretty much like that. 3rd-order polynomial (e.g. cubic) splines
> are known to sometimes botch the bounding box computation.
>

I was reminded of this issue the other day and have been doing some more 
investigation.

I spent a lot of time comparing 3.6 to 3.7 code given 3.6 works only to 
find nothing. I finally stumbled across the fact the bounding mechanism 
is always on in 3.7. In other words (-MB<n> / +MB<n>) doesn't function 3.7.

In 3.6 we need 3 shapes (I think) or more for the bounding mechanism to 
trigger and we have 1 so internal bounding is off.

Is this the -MB / +MB mechanism supposed to work in 3.7 ? We changed the 
default threshold in the docs to 25 so guessing yes. I could find no 3.6 
-> 3.7 change notes related to it.

The issue behind is just another issue with the bounding computation as 
you thought Christoph, and it is sitting there in 3.6 too - if we turn 
bounding on with +MB1.

Basically the current mechanism multiplies the radius of each sphere by 
2 and in this case here where the radius is small, but the range is a 
couple orders of magnitude larger, that 2x just isn't enough. This even 
though the curve is a pretty gentle cubic as curves go.

The multiplier should probably fudge upward from 2 by default if the 
range for the curve is large compared to the radius. Another more 
general option would be to add a new keyword to the sphere_sweep which 
lets the user optionally control the bounding radius multiplier?

Bill P.


Post a reply to this message

From: William F Pokorny
Subject: Re: Odd behaviour with sphere_sweep
Date: 27 Apr 2016 07:25:09
Message: <5720a195$1@news.povray.org>
On 04/26/2016 09:44 AM, William F Pokorny wrote:
>
> I was reminded of this issue the other day and have been doing some more
> investigation.
>

I opened a github issue for this. See:

https://github.com/POV-Ray/povray/issues/59

Bill P.


Post a reply to this message

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