POV-Ray : Newsgroups : povray.general : Spherical Sweep Along a Parametric Curve : Spherical Sweep Along a Parametric Curve Server Time
31 Jul 2024 16:31:36 EDT (-0400)
  Spherical Sweep Along a Parametric Curve  
From: Randall Sawyer
Date: 25 Nov 2006 02:25:00
Message: <web.4567ebe377f8a7548c37caaf0@news.povray.org>
Spherical Sweep Along a Parametric Curve

Specific:
I recently needed to create an elliptical cylinder with a rounded (circular)
edge.  To do this, I wrote the following macro for generating a parametric
surface which I call a "torlipse" (from "torus" and "ellipse").  The
torlipse is a spherical sweep of radius 'r' along the parameterized ellipse
e(u) = < a * cos(u), 0, b * sin(u) >.

//  Last updated: 2006.11.24
//  Description: Macro which generates a spherical sweep of
//  radius 'r' along an ellipse in the x-z plane with
//  semi-radii of 'a' and 'b'. The parameters 'th0' and
//  'th1' allow the possibility of a sweep along an elliptical
//  arc.  Use th0 = 0 and th1 = 2*pi for a complete sweep.

#macro torlipse( a, b, r, th0, th1 )
    parametric {
        function { cos(u) * ( a + cos(v)*r*b / sqrt( pow(b*cos(u), 2) +
pow(a*sin(u), 2) ) ) },
        function { -r*sin(v) },
        function { sin(u) * ( b + cos(v)*r*a / sqrt( pow(b*cos(u), 2) +
pow(a*sin(u), 2) ) ) }
        <th0, 0>, <th1, 2*pi>

        contained_by { box { 1.1 * <-a-r, -r, -b-r>, 1.1 * <a+r, r, b+r> } }
        precompute 10 x,y,z
        accuracy 0.000001*r
   }
#end

To no avail, as of yet, I continue to determine the possibility of
expressing this surface as an isosurface.

General:
I see the potential need to render a spherical sweep along any
parameterizable curve in 3-space.  I cannot imagine that I am the first to
address this need.

So, my questions to the POVRay community are

    1)  Has someone already established a good generalized method for
rendering spherical sweeps along parameterizable curves?

    2)  Is it possible to express a spherical sweep along any
parameterizable curve into an isosurface expression? (Obviously, it is
possible for special cases: e.g. line segment -> cylinder and circle ->
torus.)

    3)  Would it be beneficial to include a built-in function for creating
spherical sweeps along parametric curves in future releases of POV
Raytracer?

If someone else has already done the work, then I would like to save myself
the time and effort.  On the other hand, if it turns out that this is a new
or pending 'todo', then I wish to contribute my efforts to the POVRay
community.

I will appreciate any response.

Yours,
Randall Sawyer


Post a reply to this message

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