POV-Ray : Newsgroups : povray.general : Problems with #while construct ... (maybe a Sphere_Sweep problem) Server Time
2 Aug 2024 06:14:16 EDT (-0400)
  Problems with #while construct ... (maybe a Sphere_Sweep problem) (Message 1 to 4 of 4)  
From: Neil Kolban
Subject: Problems with #while construct ... (maybe a Sphere_Sweep problem)
Date: 11 Dec 2004 20:41:19
Message: <41bba1bf$1@news.povray.org>
Folks,
I am a newbie and especially a newbie at the Scene Definition Language ...

I wanted to create a rotating spiral that was under variable control so I
coded:

#declare r=0.1;
#declare d=0.1;
#declare twists=2;
#declare index=0;
#declare num_spheres=3*twists;
sphere_sweep
{
   b_spline,
   num_spheres,
#while (index<num_spheres)
   <-1,-1,index*d>, r,
   <1,-1,index*d*2>, r,
   <1,1,index*d*3>, r,
#declare index=index+4;
#end

I have *NOT* debugged the algorithm yet.  That is not my challenge in this
posting.  What is my challenge is that I get a parse syntax error.  It seems
that the parser wants the "sphere_sweep" number of spheres to be a numeric.


I then ran the following test:

#declare index=0;
sphere_sweep
{
   b_spline,
   3,
#while (index<1)
   <0,0,0>, 1
   <1,1,1>, 1
   <2,2,2>, 1
#declare index=index+1;
#end
}

This ends with an error:
Parse Error: Attempt to malloc zero size block(... sphsweep.cpp line: 1659)

Yikes!!!

Is there a problem with Sphere Sweep and SDL?

Neil


Post a reply to this message

From: Slime
Subject: Re: Problems with #while construct ... (maybe a Sphere_Sweep problem)
Date: 11 Dec 2004 20:57:22
Message: <41bba582$1@news.povray.org>
>    b_spline,
>    3,

Certian spline types require a minimum number of control points. b_spline,
for instance, I believe requires at least 4. If you just want a spline that
goes smoothly through each point, I would recommend using a cubic_spline,
for which you need a single extra point at the beginning and end of the
list; these two points won't be shown on the spline but they affect the
behavior of the spline at the beginning and end.

POV-Ray could/should probably give a better error message than "attempt to
malloc zero size block" for this sort of thing.

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


Post a reply to this message

From: stm31415
Subject: Re: Problems with #while construct ... (maybe a Sphere_Sweep problem)
Date: 11 Dec 2004 21:00:00
Message: <web.41bba4cc1b3bdd2dacced0c50@news.povray.org>
Aren't there 4 points in a b_spline segment?

-S
5TF!


Post a reply to this message

From: Neil Kolban
Subject: Re: Problems with #while construct ... (maybe a Sphere_Sweep problem)
Date: 11 Dec 2004 22:04:17
Message: <41bbb531@news.povray.org>
Thanks guys, that was it.  My bad understanding/reading of the sphere_sweep.
All is now good.

Thank you my friends.

Neil

"Slime" <fak### [at] emailaddress> wrote in message
news:41bba582$1@news.povray.org...
> >    b_spline,
> >    3,
>
> Certian spline types require a minimum number of control points. b_spline,
> for instance, I believe requires at least 4. If you just want a spline
that
> goes smoothly through each point, I would recommend using a cubic_spline,
> for which you need a single extra point at the beginning and end of the
> list; these two points won't be shown on the spline but they affect the
> behavior of the spline at the beginning and end.
>
> POV-Ray could/should probably give a better error message than "attempt to
> malloc zero size block" for this sort of thing.
>
>  - Slime
>  [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

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