POV-Ray : Newsgroups : povray.beta-test : Spline inconsistencies Server Time
30 Jul 2024 04:20:02 EDT (-0400)
  Spline inconsistencies (Message 21 to 30 of 54)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 03:31:59
Message: <3c7601ff@news.povray.org>
By the way, any chance of making the time values optional?
  Forced time values are a real bother, and they usually cause more trouble
than they are worth.

  The idea would be that you don't either give any time values, or you give
time values for at least two points (giving one is not legal).
  If no time values are given, then the time values are internally generated
by interpolating (eg. between 0 and 1).
  If at least two time values are given, the time values for the other
points are calculated by interpolating and extrapolating.

  Of course a change in syntax would be needed but that should not be a
problem since we don't have to worry about backwards compatibility right now
(in fact, the syntax should be thought now that we still have the chance to
set it to whatever we want).
  It could, for example, be so that if a point is enclosed with { and }, then
it has a time value, else it hasn't. For example:

spline
{ whatever_spline
  { 0, <1,2,3> }
  <4,5,6>
  <7,8,9>
  { 1, <10,11,12> }
  <13,14,15>
  { 2, <16,17,18> }
  <19,20,21>
}

  Of course the most common usage of splines (I'm sure) would be with no
time values (usually evenly-distributed time values are enough):

spline
{ whatever_spline
  <1,2,3>
  <4,5,6>
  <7,8,9>
  <10,11,12>
}

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From:
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 03:41:19
Message: <qp0c7u4vm7qp164cffqr9n96knr3d5ulo7@4ax.com>
On 22 Feb 2002 03:31:59 -0500, Warp <war### [at] tagpovrayorg> wrote:
>  By the way, any chance of making the time values optional?

AFAIK with current syntax you can put points in any order and/or you can
assign spline with selective point replacement. Your ideas could be simple
realized via macros.

ABX


Post a reply to this message

From: Rune
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 04:26:13
Message: <3c760eb5@news.povray.org>
"Warp" wrote:
>   I personally don't like the current spline syntax at all.
> Forced time values are a bother and make writing splines a
> lot more tedious.

Just make a macro that automatically assigns time values. This means that
the user has the choice of using time values or not. That's not the case
with Chris Colefax's include file.

>   But the several spline include files out there (eg. the
> Colefax's one) already do this, and they support a lot more
> features than pov3.5's splines do (eg. approximating evenly
> spaced points in the spline).

But for basic spline usage, the syntax and use is much easier with the
spline{} feature. And the more advanced things can be done with a
combination of the spline{} feature and macros. And did I forget to say that
the internal splines are much faster than splines generated by include
files?

I'm glad we have the spline{} feature.

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

From:
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 04:33:46
Message: <fo3c7uk6rd723gm8nc12bobiov20ktboml@4ax.com>
On Fri, 22 Feb 2002 10:25:49 +0100, "Rune" <run### [at] mobilixnetdk>
wrote:
> And did I forget to say that
> the internal splines are much faster than splines generated by include
> files?

And we shouldn't forget they can be used in functions/isosurfaces.

I think : 'experimental feature' is good stage. At this time opinions (like
Rune's problem) can be gathered and during 4.0 rewriting all splines in POV
can be joined as one internal engine with different interfaces and aplications
(post proces/spline/lathe/animation tools).

ABX


Post a reply to this message

From: Warp
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 05:20:44
Message: <3c761b7b@news.povray.org>
Rune <run### [at] mobilixnetdk> wrote:
> But for basic spline usage, the syntax and use is much easier with the
> spline{} feature.

  I strongly disagree.
  Suppose that you are making a spline with evenly-distributed time values:

spline
{ cubic_spline
  0, <1,1,1>
  .25, <2,2,2>
  .5, <3,3,3>
  .75, <4,4,4>
  1, <5,5,5>
}

  You test this and you decide that you want one point more between <3,3,3>
and <4,4,4>.
  Oops! Now you have to modify *all* the time values to get them again
evenly-distributed. You end up doing something like this:

spline
{ cubic_spline
  0/5, <1,1,1>
  1/5, <2,2,2>
  2/5, <3,3,3>
  3/5, <3.5,3.5,3.5>
  4/5, <4,4,4>
  5/5, <5,5,5>
}

  Every time you add or remove a point, you have to modify *all* the time
values to get the desired result.
  If you do this long enough, you'll get tired and automatize a bit:

#declare Points = array[6]
{ <1,1,1>, <2,2,2>, <3,3,3>, <3.5,3.5,3.5>, <4,4,4>, <5,5,5> }

spline
{ cubic_spline
  #declare Ind = 0;
  #declare EndInd = dimension_size(Points, 1)-1;
  #while(Ind <= EndInd)
    Ind/EndInd, Point[Ind]
    #declare Ind = Ind+1;
  #end
}

  But with an existing macro you can achieve the same thing with a lot less
work. For example:

#declare Points = array[6]
{ <1,1,1>, <2,2,2>, <3,3,3>, <3.5,3.5,3.5>, <4,4,4>, <5,5,5> }

CreateSpline(Points)

  Using the current spline syntax is certainly not "much easier". In fact,
it's a lot more tedious and difficult.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Warp
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 05:21:21
Message: <3c761ba0@news.povray.org>

> Your ideas could be simple realized via macros.

  How?

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From:
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 05:39:28
Message: <9v6c7uca2nlhh53kjqq66a993scqra9pj1@4ax.com>
On 22 Feb 2002 05:21:21 -0500, Warp <war### [at] tagpovrayorg> wrote:
>W?odzimierz ABX Skiba <abx### [at] babilonorg> wrote:
> > Your ideas could be simple realized via macros.
>
>  How?

#version 3.5;
#include "strings.inc"

#macro Make_List()
  #local N=dimension_size(Array,1);
  #local C=N;
  #while(C)
    #local C=C-1;
    From+C*(To-From)/(N-1) Array[C]
  #end
#end

#macro Distribution(From,To,Array)
  spline{Make_List()}
#end

#macro Add_Distribution(Spline,From,To,Array)
  #declare Spline=spline{Spline Make_List()}
#end

// create spline with first distribution
#local Spline=Distribution(0,1,array[3]{<0,0,0><1,0,0><2,1,0>})
// add distribution to spline
// note you can mix ranges, overwrite and mix
Add_Distribution(Spline,1,2,array[3]{<2,1,0><3,2,1><2,2,2>})

// testing

#debug VStr((Spline(0)))
#debug "\n"
#debug VStr((Spline(.5)))
#debug "\n"
#debug VStr((Spline(1)))
#debug "\n"
#debug VStr((Spline(1.5)))
#debug "\n"
#debug VStr((Spline(2)))
#debug "\n"

// ABX


Post a reply to this message

From:
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 06:03:48
Message: <pn8c7uktkb6mkbi0ibcr732ndapmv4j59b@4ax.com>

wrote:
>// note you can mix ranges, overwrite and mix

// mix, overwrite and overlap

Note also I didn't write spline type in any place becouse it can be forced at
calculation stage.

The only thing I wonder about splines - why they are designed with { when they
are just vector functions.

And one feature request (it best fits in this thread): result is a vector -
why not allow to influence dimension of this result with dimension if input ?
I mean why not allow 2D or 5D vectors in input list ? First entry in spline
could describe dimension of result just like for arrays. This could extend
spline for use with rgbtf values and many other applications.

ABX


Post a reply to this message

From: Christoph Hormann
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 06:06:53
Message: <3C76264B.ABF23562@gmx.de>
Warp wrote:
> 
> [...]
> 
>   I personally find the spline include files so much more useful than I'll
> probably never be using the internal ones.
>   It won't be a step back for me.

And what about spline functions?

Not being able to use splines in isosurface functions would be really bad
IMO.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 21 Feb. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Spline inconsistencies
Date: 22 Feb 2002 06:16:10
Message: <3c76287a@news.povray.org>

> #local Spline=Distribution(0,1,array[3]{<0,0,0><1,0,0><2,1,0>})
> Add_Distribution(Spline,1,2,array[3]{<2,1,0><3,2,1><2,2,2>})

  That's quite longer. And it needs you to repeat points (<2,1,0> above).
  Compare to the equivalent in my proposal:

#local Spline=spline{ {0,<0,0,0>} <1,0,0> {1,<2,1,0>} <3,2,1> {2,<2,2,2>} }

(And that {1,<2,1,0>} could just be <2,1,0>, but I wanted it to be completely
equivalent to your example.)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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