POV-Ray : Newsgroups : povray.beta-test : Filling in T values in splines : Re: Filling in T values in splines - update Server Time
30 Jul 2024 06:19:04 EDT (-0400)
  Re: Filling in T values in splines - update  
From: Rune
Date: 24 Feb 2002 19:38:09
Message: <3c798771@news.povray.org>
"Christopher James Huff" wrote:
> I've never liked the "multiply size by N" method...
> I've always increased arrays by a fixed amount,
> say 16 or 32 elements.

Sorry, but that sounds very stupid to me.

If you have a spline with 3000 control point and you expand the array by 32
per expansion, then you'll have the array copied almost 100 times with an
average of about 1500 elements copied each time, which is in total about
150000 elements copied. If however you expand by 10 each time instead,
you'll have 4 expasions at most, with no more than 1111 elements copied in
total. That should parse more than 100 times faster. The memory you save
with your method really isn't worth that.

> As long as the increment is big enough, you won't have
> much of a slowdown

Statistically, the most likely value of "big enough" will increase as the
number of elements increase. Thus you multiply with a value every time
rather than adding a fixed amount.

> but won't waste as much memory either.

Depends on how much you increase it with per time.

> Also, I don't think this is a very time-critical area...

I think it is. You can easily imagine scenes with hundreds of different
splines.

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Feb 16)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

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