POV-Ray : Newsgroups : povray.general : Bug with #macro and splines Server Time
19 May 2024 19:09:13 EDT (-0400)
  Bug with #macro and splines (Message 1 to 4 of 4)  
From: Nicolas Alvarez
Subject: Bug with #macro and splines
Date: 9 Sep 2004 19:17:48
Message: <4140e49c@news.povray.org>
I'm having a problem with the following file. No light_sources needed --
it's a language problem.

#declare RandStream=seed(0);

#macro RandomSpline(Movements,RS)
 #local Points=array[Movements];
 #local I=0;
 #while (I<Movements)
  #local Points[I]=<rand(RS),rand(RS),rand(RS)>;
  #local I=I+1;
 #end

 #local I=0;
 #local MySpline=spline
 {
  cubic_spline
  -(2/Movements), Points[Movements-2],
  -(1/Movements), Points[Movements-1],
  #while (I<Movements)
   (I/(Movements+1)), Points[I],
   #local I=I+1;
  #end
  1, Points[0],
  1+(1/Movements), Points[1]
 }

 MySpline
#end

#declare MySpline=RandomSpline(5,RandStream);

#debug str(MySpline(0),0,5)

If I render it, I get the following message:

    The POV-Ray core rendering code threw an unhandled exception.

    The backend thread has been shut down and you will not be able to
perform any further renders.

    It is STRONGLY RECOMMENDED that you save your work and exit POV-Ray
now.

    (Note that if internal structures have been damaged POV-Ray may crash
immediately after you click OK).

If I click OK, that message closes and I can't save the file anymore.

I have:
Windows 98 SE
Pentium II 400MHz
128MB RAM
POV-Ray 3.6.1.icl8.win32

--
- Nicolas Alvarez
nicolas [dot] alvarez [at] gmail [dot] com


Post a reply to this message

From: Slime
Subject: Re: Bug with #macro and splines
Date: 9 Sep 2004 19:32:22
Message: <4140e806$1@news.povray.org>
> I'm having a problem with the following file. No light_sources needed --
> it's a language problem.


Sounds like a bug. As far as solutions go, try changing #local MySpline to
#declare MySpline, or try removing the "#local MySpline = " part entirely,
simply making the spline itself be the return value.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Bug with #macro and splines
Date: 9 Sep 2004 19:38:09
Message: <4140e961@news.povray.org>
That was a VERY fast answer!

I'll try your workarounds.

THX

--
- Nicolas Alvarez
nicolas [dot] alvarez [at] gmail [dot] com




news:4140e806$1@news.povray.org...
> > I'm having a problem with the following file. No light_sources
needed --
> > it's a language problem.
>
>
> Sounds like a bug. As far as solutions go, try changing #local MySpline
to
> #declare MySpline, or try removing the "#local MySpline = " part
entirely,
> simply making the spline itself be the return value.
>
>  - Slime
>  [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Bug with #macro and splines
Date: 9 Sep 2004 21:00:49
Message: <4140fcc1$1@news.povray.org>
Thanks.

It worked removing the "#local MySpline = " part.

Try to guess what was the macro for :)

--
- Nicolas Alvarez
nicolas [dot] alvarez [at] gmail [dot] com



news:4140e806$1@news.povray.org...
> > I'm having a problem with the following file. No light_sources
needed --
> > it's a language problem.
>
>
> Sounds like a bug. As far as solutions go, try changing #local MySpline
to
> #declare MySpline, or try removing the "#local MySpline = " part
entirely,
> simply making the spline itself be the return value.
>
>  - Slime
>  [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

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