POV-Ray : Newsgroups : povray.general : spheres & cylinders = bsplines? Server Time
31 Oct 2024 08:17:09 EDT (-0400)
  spheres & cylinders = bsplines? (Message 1 to 9 of 9)  
From: Mike Weber
Subject: spheres & cylinders = bsplines?
Date: 22 Apr 2000 11:38:38
Message: <3901c77e@news.povray.org>
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.

Mike
--
mwe### [at] sciticom
www.geocities.com/mikepweber
Don't forget about Santee Schools Family Email Newsletter Sign Up
http://www.santee.k12.ca.us/family/emails.html


Post a reply to this message

From: Warp
Subject: Re: spheres & cylinders = bsplines?
Date: 22 Apr 2000 16:15:20
Message: <39020858@news.povray.org>
Mike Weber <mwe### [at] sciticom> wrote:
: I tried it this way and it seems the radius of the sphere was slightly too
: big.

  Be sure that your primitives are not scaled too small. There might be
accuracy problems with extremely small values.
  It might also be just an optical illusion...

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Margus Ramst
Subject: Re: spheres & cylinders = bsplines?
Date: 22 Apr 2000 16:21:32
Message: <3901FC0C.33DC51D8@peak.edu.ee>
Mike Weber wrote:
> 
> Someone once posted here that you could make a bspline tube using spheres &
> cylinders.
> 

I don't think so. You could only do a linear spline in this way, but not a
bspline. A bspline could be approximated with sections of torii, but it's a lot
of work. I suggest you use the sphere_sweep object included in Megapov, IIRC it
has a bspline type.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Mike Weber
Subject: Re: spheres & cylinders = bsplines?
Date: 22 Apr 2000 16:39:50
Message: <39020e16@news.povray.org>
I didn't know there was difference between a bspline and a spline.  I'm
developing this for my dll plug-in for moray - so using Megapov isn't an
option.


Margus Ramst <mar### [at] peakeduee> wrote in message
news:3901FC0C.33DC51D8@peak.edu.ee...
> Mike Weber wrote:
> >
> > Someone once posted here that you could make a bspline tube using
spheres &
> > cylinders.
> >
>
> I don't think so. You could only do a linear spline in this way, but not a
> bspline. A bspline could be approximated with sections of torii, but it's
a lot
> of work. I suggest you use the sphere_sweep object included in Megapov,
IIRC it
> has a bspline type.
>
> --
> Margus Ramst
>
> Personal e-mail: mar### [at] peakeduee
> TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Warp
Subject: Re: spheres & cylinders = bsplines?
Date: 22 Apr 2000 16:56:40
Message: <39021208@news.povray.org>
Margus Ramst <mar### [at] peakeduee> wrote:
: I don't think so. You could only do a linear spline in this way, but not a
: bspline.

  But if the segments are short enough, it's a good approximation.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Margus Ramst
Subject: Re: spheres & cylinders = bsplines?
Date: 22 Apr 2000 18:34:52
Message: <39021B4D.9FE17A20@peak.edu.ee>
Warp wrote:
> 
>   But if the segments are short enough, it's a good approximation.
> 

They would have to be very short indeed for a good approximation, especially if
the spline is significantly convoluted.

-- 
Margus Ramst

Personal e-mail: mar### [at] peakeduee
TAG (Team Assistance Group) e-mail: mar### [at] tagpovrayorg


Post a reply to this message

From: Ron Parker
Subject: Re: spheres & cylinders = bsplines?
Date: 23 Apr 2000 01:43:28
Message: <slrn8g53vf.438.ron.parker@linux.parkerr.fwi.com>
On Sat, 22 Apr 2000 22:22:52 +0300, Margus Ramst wrote:
>Mike Weber wrote:
>> 
>> Someone once posted here that you could make a bspline tube using spheres &
>> cylinders.
>
>I don't think so. You could only do a linear spline in this way, but not a
>bspline. A bspline could be approximated with sections of torii, but it's a lot
>of work. 

Fortunately, it's work nobody has to do.  See my webpage at the URL
below.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
These are my opinions.  I do NOT speak for the POV-Team.


Post a reply to this message

From: Chris Colefax
Subject: Re: spheres & cylinders = bsplines?
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

From: Warp
Subject: Re: spheres & cylinders = bsplines?
Date: 24 Apr 2000 05:45:08
Message: <390417a4@news.povray.org>
When using cylinders+spheres to simulate a curve, a shading artifact can
(usually) be clearly seen.
  This is caused because altough the surface is smooth (it hasn't
sharp edges), the change of the curvature of the surface isn't. The
curvature changes abruptly: First it's straight, then it's spherical
and the again straight. This causes those shading artifacts seen in
the image (ie. the shading starts to change too abruptly).


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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