POV-Ray : Newsgroups : povray.general : Sweep Mesh Macro request : Re: Sweep Mesh Macro request Server Time
1 Aug 2024 00:19:23 EDT (-0400)
  Re: Sweep Mesh Macro request  
From: Mike Williams
Date: 11 Jun 2006 23:42:30
Message: <KZWx5MApIOjEFwSC@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>"gregjohn" <pte### [at] yahoocom> wrote:
>> I would like a macro which is like Mike Williams' sweep spline, only with
>> this added feature....
>
>
>Mike, in all honesty, I cannot find the version of your macro with the
>spline as waist, instead of waist as spline.
>
>In other words, all the ones I've been using over the years apparently have:
>
>     #local W = vlength(Waist(su).x);
>
>which AFAICS is merely a call of the x coordinate to get a radius-->
>circular section.

The "Waist" spline controls how the size of the cross section varies
along the track. The shape of the cross section is defined by the
"Shape" spline. 

After calculating
     #local P = Track(su);
     #local W = vlength(Waist(su).x);

A pair of vectors perpendicular to the track are multiplied by W

     #local DRX = W*vnormalize(vcross(DR,DRY));
     #local DRY = W*vnormalize(vcross(DRX,DR));

Then the cross sectional shape is applied to those vectors

     P + (Shape(sv).x)*DRX + (Shape(sv).y)*DRY;

Observe that "su" is the distance along the track, and "sv" is the
distance round the cross section.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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