POV-Ray : Newsgroups : povray.beta-test : Twisted sp(l)ine : Re: Twisted sp(l)ine Server Time
30 Jul 2024 22:27:39 EDT (-0400)
  Re: Twisted sp(l)ine  
From: David Wallace
Date: 29 Sep 2001 16:07:17
Message: <3BB629E8.341EF59@earthlink.net>
Well, I went to look at the spreadsheet I used to set the parameter values
(their separation is proportional to the distance between points) and found that
some of the point locations there were inaccurate.  After fixing them, the
spline looks like this:

#declare spHull2 = spline {
 cubic_spline
 -0.20924, < 488, -66>
  0.00000, < 525,   0>
  0.20924, < 488,  66>
  0.46462, < 400,  94>
  1.57080, <   0,  95>
  2.67697, <-400,  94>
  2.93235, <-488,  66>
  3.14159, <-525,   0>
  3.35084, <-488, -66>
  3.60621, <-400, -94>
  4.71239, <   0, -95>
  5.81856, < 400, -94>
  6.07394, < 488, -66>
  6.28319, < 525,   0>
  6.49243, < 488,  66>
}

The resulting shape still bends in on itself somewhat in the middle (x value=0),
but the gross curlicues are gone.


Mark Wagner wrote:

> David Wallace wrote in message <3BB25EFE.719F8B0E@earthlink.net>...
> >I hope this is just a user screw-up, but I think it bears mentioning.
> >The spline calculations could well have some arcane bug.  Consider the
> >test code below:
>
> [code snipped]
>
> >The code (as written) draws the outline of a shape similar to a Pac-Man
> >ghost, which is what I want.  The second spline, spHull2, is supposed to
> >draw something akin to an oval, but it draws weird curlicues near the
> >middle (where the parameter is pi).  I've been racking my brain trying
> >to find the error in my spline which causes this with no success.  So...
> >can you untwist the knot in my spline via the code, or is the spline
> >calculation in POV-Ray flawed?
>
> The spline code in POV-Ray is working exactly as it should.  It just doesn't
> work quite the way you expect it to.  POV-Ray's splines are actually the
> combination of three splines: a "x as a function of time" spline, a "y as a
> function of time" spline, and a "z as a function of time" spline, where
> "time" is the first number in each spline entry.
>
> What's happening in your case is that you are asking the "y as a function of
> time" spline to turn a sharper corner than it is able to.  As a result, the
> spline does the best it can, and produces those curlicues.  I'd suggest
> fixing it by playing around with the exact positioning of the control
> points, possibly adding or removing some.  Another solution would be to
> split the spline into two splines.
>
> --
> Mark


Post a reply to this message

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