POV-Ray : Newsgroups : povray.binaries.images : KnotPlot and Splines (54 k) Server Time
19 Nov 2024 08:29:57 EST (-0500)
  KnotPlot and Splines (54 k) (Message 1 to 4 of 4)  
From: Dave Matthews
Subject: KnotPlot and Splines (54 k)
Date: 11 Mar 2005 17:29:20
Message: <42321bc0@news.povray.org>
KnotPlot (http://www.pims.math.ca/knotplot/) exports to POVRay in 
bicubic patches, but I'd never bothered to look at the actual code very 
closely.  It's surprisingly (well, I was surprised!) easy to extract the 
splines from the patches.  In this example, I set the number of patches 
around the "tube" to 3 (in the misc. panel of KnotPlot), so then if you 
strip off the first vector from each patch (which I did with a judicious 
use of "replace" in Microsoft Word, since I'm a total dunce at 
programming), you can make an array that has the 3 edge splines listed 
in order (0 .. Tot/3 - 1, Tot/3 .. 2*Tot/3 - 1, 2*Tot/3, Tot - 1, where 
Tot is the size of the array.)  I originally did this to check out Mike 
Williams' Rope macro, but I haven't gotten that far yet.  Anyway, if you 
use the 3 edge splines, you can make a center spline by averaging the 
edge ones.  Then, the sky's the limit.

Scene file available upon request.

Dave Matthews


Post a reply to this message


Attachments:
Download 'ka_nine_06.jpg' (54 KB)

Preview of image 'ka_nine_06.jpg'
ka_nine_06.jpg


 

From: Dre
Subject: Re: KnotPlot and Splines (54 k)
Date: 14 Mar 2005 17:16:02
Message: <42360d22$1@news.povray.org>
"Dave Matthews" <ns### [at] nospamedu> wrote in message
news:42321bc0@news.povray.org...
> KnotPlot (http://www.pims.math.ca/knotplot/) exports to POVRay in
> bicubic patches, but I'd never bothered to look at the actual code very
> closely.  It's surprisingly (well, I was surprised!) easy to extract the
> splines from the patches.  In this example, I set the number of patches
> around the "tube" to 3 (in the misc. panel of KnotPlot), so then if you
> strip off the first vector from each patch (which I did with a judicious
> use of "replace" in Microsoft Word, since I'm a total dunce at
> programming), you can make an array that has the 3 edge splines listed
> in order (0 .. Tot/3 - 1, Tot/3 .. 2*Tot/3 - 1, 2*Tot/3, Tot - 1, where
> Tot is the size of the array.)  I originally did this to check out Mike
> Williams' Rope macro, but I haven't gotten that far yet.  Anyway, if you
> use the 3 edge splines, you can make a center spline by averaging the
> edge ones.  Then, the sky's the limit.
>
> Scene file available upon request.
>
> Dave Matthews
>

Hi, I'd be very interested in seeing the code.  Please please please pretty
please :)

Cheers Dre


Post a reply to this message

From: Dave Matthews
Subject: Re: KnotPlot and Splines (54 k)
Date: 14 Mar 2005 18:32:14
Message: <42361efe$1@news.povray.org>
Dre wrote:

> 
> Hi, I'd be very interested in seeing the code.  Please please please pretty
> please :)
> 
> Cheers Dre
> 
> 

Done!  Thank you so much for asking!  It's embarrassing to go through 
the work of making up an .inc file and zipping stuff up to post in PBSF, 
and then have nobody ask ;-)

Dave Matthews


Post a reply to this message

From: Dre
Subject: Re: KnotPlot and Splines (54 k)
Date: 14 Mar 2005 20:01:29
Message: <423633e9@news.povray.org>
Dave Matthews" <ns### [at] nospamedu> wrote in message
news:42361efe$1@news.povray.org...
> Dre wrote:
>
> >
> > Hi, I'd be very interested in seeing the code.  Please please please
pretty
> > please :)
> >
> > Cheers Dre
> >
> >
>
> Done!  Thank you so much for asking!  It's embarrassing to go through
> the work of making up an .inc file and zipping stuff up to post in PBSF,
> and then have nobody ask ;-)
>
> Dave Matthews

Hehehe, no worries, as soon as I saw your second image (more complex 4 edge
spline) I new I had to take a peek at it all :)

Great stuff!

Cheers Dre


Post a reply to this message

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