POV-Ray : Newsgroups : povray.binaries.images : Parametrics with pointy tips : Re: Parametrics with pointy tips Server Time
14 Nov 2024 06:16:10 EST (-0500)
  Re: Parametrics with pointy tips  
From: Thies Heidecke
Date: 17 Mar 2004 08:06:55
Message: <40584d6f@news.povray.org>
"Skip Talbot" <sta### [at] uiucedu> schrieb im Newsbeitrag
news:40581849$1@news.povray.org...
> I was playing around with the examples on Mike William's Isosurface
Tutorial
> page (excellent site, I bookmarked it and refer to it constantly).  The
one
> I'm focused on is a parametric lathe that uses a spline to define
different
> profiles in two axes.  I'm wondering if there is a way to produce a
similar
> object without the point at the top.  I tried moving the endpoint of the
> spline closer to the second point but the object distorts as if there is
an
> asymptote there.  What I'm looking for is an object bound by splines with
> rounded ends.  Here is an example rendering and the code used to generate
> it:

Hi Skip,
to get a smooth tip you ideally would have an infinite gradient where your
splinefunction reaches the tip (has value 0.0). But since the spline is
still a function it can only have a finite gradient, so with your technique
you will always have a more or less spiky tip. But in practice it's in most
cases sufficient to have a moderately high gradient at the tip.
You have to experiment a bit with your spline, especially because if you
take
the gradient to the extreme you will distort the shape of your object too
much.

> // The open 1D spline (lathe)
> #declare S = function {
>    spline {
>     natural_spline
>       -1, < 0.0, 0, 0.0>,
>     -0.8, < 0.4, 0, 0.5>,
>     -0.5, < 0.2, 0, 0.2>,
>     -0.2, < 0.2, 0, 0.2>,
>      0.3, < 0.8, 0, 0.4>,
>        0.4, < 0.0, 0, 0.0>
>    }
>  }

I fiddled a bit with the spline..


This looks reasonably well for me :

#declare S = function {
   spline {
    natural_spline
    -1.1, <-1.00, 0,-1.25>,
    -1.0, < 0.00, 0, 0.00>,
    -0.8, < 0.40, 0, 0.50>,
    -0.5, < 0.20, 0, 0.20>,
    -0.2, < 0.20, 0, 0.20>,
     0.3, < 0.80, 0, 0.40>,
     0.4, < 0.00, 0, 0.00>
     0.5, <-2.00, 0,-1.00>
   }
 }


Here you can see that extremer values distort the shape also :

#declare S = function {
   spline {
    natural_spline
    -1.1, <-2.00, 0,-2.50>,
    -1.0, < 0.00, 0, 0.00>,
    -0.8, < 0.40, 0, 0.50>,
    -0.5, < 0.20, 0, 0.20>,
    -0.2, < 0.20, 0, 0.20>,
     0.3, < 0.80, 0, 0.40>,
     0.4, < 0.00, 0, 0.00>
     0.5, <-4.00, 0,-2.00>
   }
 }

To cut the shape at the apex you should also use
  #declare Umax =  0.4;
instead of
  #declare Umax =  1;

Hope this was helpful,
Thies


Post a reply to this message

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