POV-Ray : Newsgroups : povray.newusers : Mapping Splines in 2d before rendering them with a lathe or SOR : Re: Mapping Splines in 2d before rendering them with a lathe or SOR Server Time
30 Jul 2024 12:30:18 EDT (-0400)
  Re: Mapping Splines in 2d before rendering them with a lathe or SOR  
From: Mike Williams
Date: 30 Apr 2004 02:32:12
Message: <D4xMACAq$ekAFwYe@econym.demon.co.uk>
Wasn't it Mattkg0 who wrote:
>Hi Guys,
>
>I?m currently working my way through the POV Ray beginner?s tutorial and I
>am now playing around with splines, lathes and the Surface Of Revolution
>object. On the page that covers the SOR object (3.4.2) the tutorial
>mentions a program that can model the lines of the SOR given the points
>that make it up. Such a program would indeed be useful but I?m not having
>much luck tracking one down, I?ve had a look around the links section but
>I?m not even sure of what type of program I should be looking for.
>
>Does anyone have any suggestions of a Windows program that can model in 2d
>the surface you will get for a liner, quadratic, cubic and Bezier spline as
>well as the Surface Of Revolution object?
>
>Any suggestions would be much appreciated.

I tend to visualise my splines in POV, which has the advantage of also working
well with 3D splines.

#declare I=0;
#while (I<1)
  sphere {MySpline(I),0.1 pigment {rgb <1,1,0>}}
  #declare I=I+0.005;
#end



One awkward thing is that the syntax for the spline info in a lathe is
different from the syntax of a real spline, so you have to have two copies.
You might think that you could just declare the spline and then do something
like this to copy the info into the lathe, and so only have one copy of the
information, but this doesn't work for the control points at the ends.

#declare N=5;   
lathe {
  cubic_spline
  N
  #declare I=0;
  #while (I<=1)
    , MySpline(I)
    #declare I=I+1/(N-1);
  #end
  pigment {rgb x}
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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