|
|
POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB
My following script causes crash at moment of writing script into file (I know
it becouse empty file appear on drive). Any confirmation ?
#include "functions.inc"
#include "math.inc"
#macro Function_To_DF3(Func,FileName,BMin,BMax,Res)
// corrections of parameters
#local BMin=BMin+x*0;
#local BMax=BMax+x*0;
#local Res=Res+x*0;
#local Res=<max(1,int(Res.x)),max(1,int(Res.y)),max(1,int(Res.z))>;
// help variables
#local Min=<min(BMin.x,BMax.x),min(BMin.y,BMax.y),min(BMin.z,BMax.z)>;
#local Max=<max(BMin.x,BMax.x),max(BMin.y,BMax.y),max(BMin.z,BMax.z)>;
#local Size=Max-Min;
#local Step=Size/(Res-1);
// temporary function for faster calculations
#local Mx=Min.x;
#local My=Min.y;
#local Mz=Min.z;
#local Sx=Step.x;
#local Sy=Step.y;
#local Sz=Step.z;
#local f=function{clip(int(255.999*Func(Mx+x*Sx,My+y*Sy,Mz+z*Sz)),0,255)}
// string creation
#local S=""; // to do : header creation
#local X=0;
#while (X<Res.x)
#local Y=0;
#while (Y<Res.y)
#local Z=0;
#while (Z<Res.z)
#local S=concat(S,chr(f(X,Y,Z)));
#local Z=Z+1;
#end
#local Y=Y+1;
#end
#local X=X+1;
#end
// file creation
#fopen DF3 FileName write
#write(DF3,S)
#fclose DF3
#end
Function_To_DF3(function{pattern{agate}},"temp.df3",-1,1,<10,11,12>)
ABX
Post a reply to this message
|
|
|
|
"W?odzimierz ABX Skiba" <abx### [at] babilonorg> wrote in message
news:06fp7ucrh0144h951dfoleg82i6nmp7f57@4ax.com...
> POV 3.5 b 11 icl on WinNT Sp 6 PII 233 with 128 MB
>
> My following script causes crash at moment of writing script into file (I
know
> it becouse empty file appear on drive). Any confirmation ?
Confirm (POV 3.5 b 11 PIII-1000 512 Mb Win2000 )
I've found it crashing when strlen(S) is>1042
#write(DF3,substr(S,1,1042)) // works fine;
////// but (strange) this sequence:
#declare S=concat(substr(S,1,1042)," ");
#write(DF3,substr(S,1,1042)) //crashes
Atb,
Gleb
Post a reply to this message
|
|
|
|
Skiba <abx### [at] babilonorg> wrote:
> #local S=concat(S,chr(f(X,Y,Z)));
The string you produce is too long and causes a buffer overflow. While it
will work in the next beta, it will only work at a significant performance
penalty (by internally writing long strings character by character).
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
|
|