POV-Ray : Newsgroups : povray.newusers : Quadratic Spline Question Server Time
30 Dec 2024 15:25:16 EST (-0500)
  Quadratic Spline Question (Message 1 to 4 of 4)  
From: Hershel Robinson
Subject: Quadratic Spline Question
Date: 23 Aug 2001 13:27:06
Message: <3b853cea@news.povray.org>
I am no expert in quadratic splines.  Actually, I have forgotten most of
what I once knew about them.  I have a question about how POV-Ray generates
splines.  I have included at the bottom of this epistle the sample page
found in the POV-Ray 3.1 docs in the tutorial section.

If I redefine the points from the example to be this:

  #declare Red_Point    = <0.00, 0.000, 0>;
  #declare Orange_Point = <1., 1.00, 0>;
  #declare Yellow_Point = <2.50, 2.00, 0>;
  #declare Green_Point  = <2.00, 3.00, 0>;
  #declare Blue_Point   = <1.50, 4.00, 0>;

I get a lovely lathe object.  If, however, I move the Red_Point a bit up in
the Y direction, like this:

  #declare Red_Point    = <0.00, 0.100, 0>;

then I suddenly get a bunch of white lines in the lower half of my lathe
object instead of a solid white object.  The lines appear for values from .1
to 1.2.  I also get lines for negative values.

Can someone explain what's going on?

Thanks,
Hershel

PS: In case you don't have it handy, here is the full code:
#include "colors.inc"
  camera {
    orthographic
    up <0, 5, 0>
    right <5, 0, 0>
    location <2.5, 2.5, -100>
    look_at <2.5, 2.5, 0>
  }
  /* set the control points to be used */
  #declare Red_Point    = <1.00, 0.00, 0>;
  #declare Orange_Point = <1.75, 1.00, 0>;
  #declare Yellow_Point = <2.50, 2.00, 0>;
  #declare Green_Point  = <2.00, 3.00, 0>;
  #declare Blue_Point   = <1.50, 4.00, 0>;
  /* make the control points visible */
  cylinder { Red_Point, Red_Point - 20*z, .1
    pigment { Red }
    finish { ambient 1 }
  }
  cylinder { Orange_Point, Orange_Point - 20*z, .1
    pigment { Orange }
    finish { ambient 1 }
  }
  cylinder { Yellow_Point, Yellow_Point - 20*z, .1
    pigment { Yellow }
    finish { ambient 1 }
  }
  cylinder { Green_Point, Green_Point - 20*z, .1
    pigment { Green }
    finish { ambient 1 }
  }
  cylinder { Blue_Point, Blue_Point- 20*z, .1
    pigment { Blue }
    finish { ambient 1 }
  }
  /* something to make the curve show up */
  lathe {
    linear_spline
    5,
    Red_Point,
    Orange_Point,
    Yellow_Point,
    Green_Point,
    Blue_Point
    pigment { White }
    finish { ambient 1 }
  }


Post a reply to this message

From: Rune
Subject: Re: Quadratic Spline Question
Date: 23 Aug 2001 14:25:15
Message: <3b854a8b$1@news.povray.org>
Try to rotate either your camera or your object by a small amount.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Mike Williams
Subject: Re: Quadratic Spline Question
Date: 23 Aug 2001 17:26:33
Message: <BkpLkLAmPWh7Ewf$@econym.demon.co.uk>
Wasn't it Hershel Robinson who wrote:
>I am no expert in quadratic splines.  Actually, I have forgotten most of
>what I once knew about them.  I have a question about how POV-Ray generates
>splines.  I have included at the bottom of this epistle the sample page
>found in the POV-Ray 3.1 docs in the tutorial section.
>
>If I redefine the points from the example to be this:
>
>  #declare Red_Point    = <0.00, 0.000, 0>;
>  #declare Orange_Point = <1., 1.00, 0>;
>  #declare Yellow_Point = <2.50, 2.00, 0>;
>  #declare Green_Point  = <2.00, 3.00, 0>;
>  #declare Blue_Point   = <1.50, 4.00, 0>;
>
>I get a lovely lathe object.  If, however, I move the Red_Point a bit up in
>the Y direction, like this:
>
>  #declare Red_Point    = <0.00, 0.100, 0>;
>
>then I suddenly get a bunch of white lines in the lower half of my lathe
>object instead of a solid white object.  The lines appear for values from .1
>to 1.2.  I also get lines for negative values.
>
>Can someone explain what's going on?

The help file says:

    Sturm

    Some of POV-Ray's objects allow you to choose between a fast but    
    sometimes inaccurate root solver and a slower but more accurate one. 
    This is the case for all objects that involve the solution of a 
    cubic or quartic polynomial. 

If you add the keyword "sturm" to your lathe object you'll find that the
lines disappear. This just happens to be a case where the inaccuracy of
the fast root solver is particularly noticeable.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Hershel Robinson
Subject: Re: Quadratic Spline Question
Date: 24 Aug 2001 08:02:43
Message: <3b864263@news.povray.org>
If I recall correctly, it was Mike Williams who wrote:

> If you add the keyword "sturm" to your lathe object you'll find that the
> lines disappear. This just happens to be a case where the inaccuracy of
> the fast root solver is particularly noticeable.

Well done.  I read about this and then promptly forgot about it.

Hershel


Post a reply to this message

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