POV-Ray : Newsgroups : povray.unofficial.patches : Q: Splines in SuperPatch Server Time
2 Sep 2024 20:20:17 EDT (-0400)
  Q: Splines in SuperPatch (Message 1 to 3 of 3)  
From: ingo
Subject: Q: Splines in SuperPatch
Date: 12 May 1999 07:53:18
Message: <37395d9e.0@news.povray.org>
Some questions on the splines in the SuperPatch. I'm trying to create random
splines, that fit in the box{<-1,0,-0.5>,<1,7,0.5>}. These splines, wil later be
used to translate seperate objects within a stack.

The method (scene below) in use seems to work, but there is one problem:
abs(POS(I/Steps).x)>1 works fine, but abs(POS(I/Steps).z)>1 gives the error:
"Bad operands for period operator". What does it mean? How to get around this?

The floats, in front of the points of the spline, are not absolut clear to me.
What is their influence? I normaly keep them evenly spread along the spline. (Is
there more documentation and what is the original location of this part of the
patch? PatchStation seems to be out of running lately)

Generating random splines and then validating wether they fit in the box works,
but is there another way? I mean is it possible to generate the controllpoints
in sutch a way, that the resulting spline is always valid? I imagine something
like a pyramid or coneshape area, generate the controllpoint within that area
and the spline is valid.

ingo

--
Met dank aan de muze met het glazen oog.

#version 3.1;
global_settings {assumed_gamma 1.0}
light_source {
  <500, 500,-500>
  rgb 1}
camera {
  location  < 0.0, 3.5,-8.0>
  look_at   < 0.0, 3.5, 0.0>}
background{rgb 1}
plane {-z,0
  texture { pigment {
  checker colour rgbf 1 colour rgbf 0.5}}}

#macro Rmm(Min,Max,Stream)
   Max+((Min-Max)*rand(Stream))
#end // macro

#declare Sd= seed(7);

#declare C=0;
#while (C= 0)
   #declare C=1;
   #declare POS= spline{
      cubic_spline
      -1, <Rmm(-10, 10, Sd), Rmm(-20, 0, Sd), Rmm(-10, 10, Sd)>
       0, <Rmm(-0.5, 0.5, Sd), 0, Rmm(-0.25, 0.25, Sd)>
       1, <Rmm(-0.5, 0.5, Sd), 7, Rmm(-0.25, 0.25, Sd)>
       2, <Rmm(-10, 10, Sd), Rmm(7, 27, Sd), Rmm(-10, 10, Sd)>
   }
   #local I=0;
   #local Steps=25;
   #while (I<Steps+1)
      #if(abs(POS(I/Steps).x)>1 | abs(POS(I/Steps).z)>0.5)
         #local I=26;
         #declare C=0;
      #end // if
      #local I=I+1;
   #end // while
#end // while

#declare I=0;
#declare Steps=100;
#while (I<Steps+1)
   sphere {POS(I/Steps),0.1 pigment {rgb <1,0,0>}}
   #declare I=I+1;
#end // while


Post a reply to this message

From: Ron Parker
Subject: Re: Q: Splines in SuperPatch
Date: 12 May 1999 10:33:14
Message: <3739831a.0@news.povray.org>
On Wed, 12 May 1999 12:53:28 +0200, ingo wrote:
>The method (scene below) in use seems to work, but there is one problem:
>abs(POS(I/Steps).x)>1 works fine, but abs(POS(I/Steps).z)>1 gives the error:
>"Bad operands for period operator". What does it mean? How to get around this?

This might be a bug.  I'll have to check it at home where the superpatch source
code is and see what's going on. In the meantime, it might work if you do 
#declare foo=POS(I/Steps) and then use abs(foo.z).

>The floats, in front of the points of the spline, are not absolut clear to me.
>What is their influence? I normaly keep them evenly spread along the spline. (Is
>there more documentation and what is the original location of this part of the
>patch? PatchStation seems to be out of running lately)

http://pandora.inf.uni-jena.de/pframe.phtml/e/noo/povsp/povsp.inc is Wolfgang
Ortmann's page for the spline patch.  It includes the same documentation that
has been included with the superpatch (though I rewrote it slightly) and there
is a small tutorial as well.  The code, however, is for POV version 3.01.


Post a reply to this message

From: ingo
Subject: Re: Q: Splines in SuperPatch
Date: 12 May 1999 15:02:39
Message: <3739c23f.0@news.povray.org>
>This might be a bug.  I'll have to check it at home where the superpatch source
>code is and see what's going on. In the meantime, it might work if you do
>#declare foo=POS(I/Steps) and then use abs(foo.z).


After adding the <0,0,0> vector this works fine.

>http://pandora.inf.uni-jena.de/pframe.phtml/e/noo/povsp/povsp.inc is Wolfgang
>Ortmann's page for the spline patch.  It includes the same documentation that
>has been included with the superpatch (though I rewrote it slightly) and there
>is a small tutorial as well.  The code, however, is for POV version 3.01.

Going to have a look now,

Thanks Ron,

ingo

--
Met dank aan de muze met het glazen oog.


Post a reply to this message

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