POV-Ray : Newsgroups : povray.beta-test : crash during function creation in loop Server Time
30 Jul 2024 08:27:54 EDT (-0400)
  crash during function creation in loop (Message 1 to 5 of 5)  
From:
Subject: crash during function creation in loop
Date: 3 Jan 2002 06:38:07
Message: <q6g83u4egq3ts0m8ip5nkn5lf0ljkacu8g@4ax.com>
POV 3.5 b 9 on PII 233 128 MB with NT 4 Sp 6

I tried automatic creation of long function in loop but POV crashed. Works fine
for N=1 but crash for N>1 (doasn't matter if there is "&" or "|"). Here is code
for this problem:

#version 3.5;

#include "functions.inc"

#local Max=3;

camera{
  orthographic
  location -2*Max*z
  direction z
  up 1.5*Max*y
  right 1.5*Max*x*image_width/image_height
}

light_source{ (y/2-x-z)*300 color rgb 1 }

union{
  isosurface{
    function{
      #local S=seed(0);
      #local N=2;
      #local C=0;
      #while (C<N)
        #local X=rand(S);
        #local Y=rand(S);
        #local Z=rand(S);
        #local R=rand(S)/5;
        #local G=function{f_sphere(x-X,y-Y,z-Z,R)};
        G(x,y,z)
        #local C=C+1;
        #if(C<N)
          &
        #end
      #end
    }
    contained_by{box{-Max,Max}}
    pigment{color rgb 1}
  }
}

Any confirmation ?

ABX


Post a reply to this message

From:
Subject: Re: crash during function creation in loop
Date: 3 Jan 2002 06:41:30
Message: <cng83u07rcud4hrvk20kbadsqe094l12qv@4ax.com>

wrote:

> POV 3.5 b 9 on PII 233 128 MB with NT 4 Sp 6
>
> I tried automatic creation of long function in loop but POV crashed. Works fine
> for N=1 but crash for N>1 (doasn't matter if there is "&" or "|"). Here is code
> for this problem:

I forgot to mention crash appear when Render Window is created so I suppose
Parsing finished succesful.

Any confirmation ?

ABX
--
#declare _=function(a,b,x){((a^2)+(b^2))^.5-x}#default {pigment{color rgb 1}}
union{plane{y,-3}plane{-x,-3}finish{reflection 1 ambient 0}}isosurface{ //ABX
function{_(x-2,y,1)&_((x+y)*.7,z,.1)&_((x+y+2)*.7,z,.1)&_(x/2+y*.8+1.5,z,.1)}
contained_by{box{<0,-3,-.1>,<3,0,.1>}}translate z*15finish{ambient 1}}//POV35


Post a reply to this message

From: Simon Adameit
Subject: Re: crash during function creation in loop
Date: 3 Jan 2002 06:54:34
Message: <3c34467a$1@news.povray.org>
> I forgot to mention crash appear when Render Window is created so I
suppose
> Parsing finished succesful.
>
> Any confirmation ?
>
For me it crashes when it reaches the last line.

433 Celeron 64 MB Win 98 SE

--
#local T=text{ttf"timrom.ttf""Simon Adameit".01,0}#local Y=1;#while(Y>-1)
#local X=0;#while(X<7)#local O=trace(T<X,Y><X,Y>+z);cylinder{<X-3,Y,5>*.01
<X-3,Y,5>*.01+5e-3,5e-5pigment{rgb 25*O}}#debug chr(83-(O.x=0)*51)#local
X=X+.05;#end#debug"\n"#local Y=Y-.05;#end


Post a reply to this message

From:
Subject: Re: crash during function creation in loop
Date: 3 Jan 2002 09:13:40
Message: <4dp83ucg4vs4cakq15e9gb5gnaf4lh0rht@4ax.com>

wrote:

I played little more with this bug and found possible explanation. The problem
is probably here:

>        #local G=function{f_sphere(x-X,y-Y,z-Z,R)};
>        G(x,y,z)

I redefined function during parsing of outer function.
I found it becouse my workaround works fine (when function is not overwriten)

  function{
    #local S=seed(0);
    #local N=3;
    #local A=array[N];
    #local C=0;
    #while (C<N)
      #local X=rand(S);
      #local Y=rand(S);
      #local Z=rand(S);
      #local R=.1+rand(S)/5;
      #local A[C]=function{f_sphere(x-X,y-Y,z-Z,R)};
      #if(C>0)
        & A[C](x,y,z)
      #else
        A[C](x,y,z)
      #end
      #local C=C+1;
    #end
  }

ABX


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: crash during function creation in loop
Date: 3 Jan 2002 10:49:39
Message: <3c347d93$1@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

>         #local G=function{f_sphere(x-X,y-Y,z-Z,R)};
>         G(x,y,z)

This is not legal, you may not redeclare a function.  The parser should
catch this (see my reply in other thread, it is the same problem) but it
does not always manage to.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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