| 
  | 
Wasn't it Randall Sawyer who wrote:
>Spherical Sweep Along a Parametric Curve
Have you considered using a sphere_sweep?
#declare A=2;
#declare B=1.5;
#declare R=0.2;
#declare fx = function(x) { A*sin(x)}
#declare fy = function(y) {0}
#declare fz = function(z) { B*cos(z)}
#declare Steps = 20;
sphere_sweep {
  b_spline
  Steps+3,
  #local i=0;
  #while (i<Steps+3)
    #local a = 2*pi*i/Steps;
    <fx(a), fy(a), fz(a)>, R
    #local i=i+1;
  #end
  //tolerance 1.0e-4
  pigment {rgb <1,1,0>}
}
If you use a high value for Steps then you may need to use a tollerance
setting to avoid ugly artefacts.
The "Steps+3" bit allows for the additional control points required for
b_spline or cubic_spline so that you get a closed loop. If using
linear_spline then you only need Steps+1, but you also need a very high
value of Steps to make it look smooth, and then you get awful artefacts
that can't be got rid of by setting tolerance.
-- 
Mike Williams
Gentleman of Leisure
 Post a reply to this message 
 | 
  |