POV-Ray : Newsgroups : povray.general : spheres & cylinders = bsplines? : Re: spheres & cylinders = bsplines? Server Time
9 Aug 2024 23:27:42 EDT (-0400)
  Re: spheres & cylinders = bsplines?  
From: Chris Colefax
Date: 23 Apr 2000 23:25:12
Message: <3903be98@news.povray.org>
Mike Weber <mwe### [at] sciticom> wrote:
> Someone once posted here that you could make a bspline tube using spheres
&
> cylinders.
>
> Is this how it should be done:
>
> cylinder {vectorA, vectorB, radius} sphere {vectorB, radius}
> cylinder {vectorB, vectorC, radius} sphere {vectorC, radius}
> cylinder {vectorC, vectorD, radius} sphere {vectorD, radius}
>
> where the radius is constant throughout, and the sphere sits at each
'joint'
> ?
>
> I tried it this way and it seems the radius of the sphere was slightly too
> big.

This method should work quite well in standard POV-Ray, provided you use
enough segments to mask the straightness of the cylinders at the desired
rendering resolution.  If your spheres seem to be larger than the cylinders,
perhaps you're experiencing precision errors (depending on the radius you
are using)?

Other approximations you can use include cones and spheres (for a pipe with
a varying radius), torii segments as mentioned, or blobs.  My own Spline
Macro File offers all these options, but works with interpolating, rather
than approximating, splines.  The second page of the tutorial/download site
(http://www.geocities.com/ccolefax/spline) shows renderings of the various
options.


Post a reply to this message

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