POV-Ray : Newsgroups : povray.general : how do I make a closed spline? : Re: how do I make a closed spline? Server Time
19 Nov 2024 15:19:07 EST (-0500)
  Re: how do I make a closed spline?  
From: ingo
Date: 17 Feb 2002 06:14:14
Message: <Xns91B87CC96B4AEseed7@povray.org>
in news:3c6f7050$1@news.povray.org Rune wrote:

> Using the cubic spline in the spline{} feature in POV-Ray 3.5, which
> rules should I follow in order to get a smoothly closed spline?

By adding one extra point at the end of the spline.
Adding an extra point in front results in an error, somewhat unexpected 
to me.

---%<------%<---
#version 3.5;
global_settings {assumed_gamma 1.0}
camera {
  location  <0.5, 0.5,-2.0>
  look_at   <0.5, 0.5, 0.0>
}
light_source {<0, 0, -500> rgb 1}
#declare SPL=spline{
  cubic_spline
  //-2/4,<1,1,0>
  -1/4,<0,1,0>
   0/4,<0,0,0>
   1/4,<1,0,0>
   2/4,<1,1,0>
   3/4,<0,1,0>
   4/4,<0,0,0>
   5/4,<1,0,0>
   6/4,<1,1,0>
}
#declare N=500;
#declare I=0;
#while(I<N)
  sphere{SPL(I/N),0.05 pigment{rgb 1}}
  #declare I=I+1;
#end
---%<------%<---


Post a reply to this message

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