|
![](/i/fill.gif) |
"Kenneth" <kdw### [at] gmail com> wrote:
> The spline requirement for the sphere_sweep is indeed a tricky thing to come up
> with (re: my particular windshield outline.) What I imagine is that the spline
> might not end up exactly following the correct curve. But that's just
> theorizing; I should give it a chance, to see what happens.
You could always use a linear spline with lots of points, this would follow your
spline points exactly and can be made to look pretty smooth e.g.
union
{
sphere_sweep {
linear_spline // linear curve
//cubic_spline // alternative spline curves
//b_spline
#declare np=80;
#declare p=0;
#declare r=0;
np+1, // number of specified sphere positions
#while ( p < np+1 )
vrotate(<0,-10, 0>, <0, 0, r>), 1
#declare r=r+360/np;
#declare p=p+1;
#end
// tolerance 0.001 // optional
pigment { rgb <1, 0, 0> }
finish { specular 0.5 roughness 0.01 }
}
bounded_by { box { <-11, -11, -1> <11, 11, 1> } }
}
produces the torus shape below. I recommend adding a bounded_by as performance
is pretty poor otherwise and probably as part of the spline bounding issue it
seems that you have to put the sphere_sweep inside a union and bound the union
otherwise it makes no difference to performance.
Sean
Post a reply to this message
Attachments:
Download 'sphere_sweep.bmp.dat' (1407 KB)
|
![](/i/fill.gif) |