POV-Ray : Newsgroups : povray.advanced-users : Optimized curves : Re: Optimized curves Server Time
30 Jul 2024 06:18:38 EDT (-0400)
  Re: Optimized curves  
From: Chris Colefax
Date: 23 Dec 1999 11:58:22
Message: <386254ae@news.povray.org>
Rune <run### [at] inamecom> wrote:
> I'm trying to figure out a way to optimize curves.
> A curve of spheres positioned by a spline formula will be more bended some
> places than others and the distance between the spheres won't be the same.
>
> I need the spheres to be positioned so that there's a specified distance
> between them and so that the bending is also evenly distributed.
>
> See the small image in povray.binaries.images for a example of what I
mean.
>
> I tried to start out with a spline and then add forces to the spheres from
> there but I couldn't figure out the core formulas needed.
>
> Any idea how I should make the forces?
> Or maybe there's an other way than using forces?

As Peter mentioned I have been working on a spline macro that allows you to
space objects evenly along the curve length, and I actually posted an
example of such in binaries.animations some months ago.  The macros work by
sampling the spline's distance along its length and then reverse
interpolating to get the desired point(s).

The macros use cubic spline functions and one of the features I've included
is an optional tension value you can specify to adjust the
tightness/looseness of the curve.  However, the nature of the cubic function
does not allow you to produce anything like the second example you've
posted.

It might be possible to create more circular curves like you've shown by
changing the blending functions of your splines (so you're not using cubic
functions).  I believe NURBS allow the creation of circular arcs, and I did
actually fiddle around with some POV macros for creating NURBS curves (*not*
surfaces!), although they struck me as being quite complicated to design and
code.

Otherwise if it's circular arcs you want then something similar to Ron
Parker's TorSpline.inc should do the trick - but you can only specify one
tangent at the beginning of the curve.  I have a macro for this as well
(somewhere...), letting you link objects around the arcs specified by a list
of points.


Post a reply to this message

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