POV-Ray : Newsgroups : povray.binaries.images : Volume fraction of f_noise3d isosurface as function of threshold, noise generator : Re: Volume fraction of f_noise3d isosurface as function of threshold, noise= generato Server Time
14 Aug 2024 22:17:51 EDT (-0400)
  Re: Volume fraction of f_noise3d isosurface as function of threshold, noise= generato  
From: Greg M  Johnson
Date: 30 Aug 2002 17:36:00
Message: <3d6fe540$1@news.povray.org>
"Abe" <bul### [at] taconicnet> wrote in message
news:web.3d6fcf10c3cf9d4c6895cad0@news.povray.org...
>
> I'd like to know more about how you chose and collected your sample data.
>

The scene file uses standard "metallography"  theory and has a programmable
precision.  Those values were set to 0.5%.

#version 3.5;
#include "colors.inc"
#include "functions.inc"

#debug  "\n"

//-------------------------------------------
global_settings {
 assumed_gamma 1
 noise_generator 1



}

#declare CamLoc = < 0,16,0>;

camera {
 location CamLoc
 look_at < 0, 0, 0>
 angle 70
}

light_source {<50,335,0> color White}
light_source {<-50, 150,-75> color White*0.35}


#declare IsoFinish =
finish {
 ambient 0 diffuse 1
 specular 1 roughness 0.02
 brilliance 2
}

sphere{0,1 pigment{red 1}}


//fog {color rgb -.3*<1-0.129,1-0.373,1-0.518> distance 200}
//fog {color rgb <0.329,0.620,0.706> distance 800}

#declare seasc=.5;

#declare threshy=0;
#while(threshy<1.01)


#declare hills=
isosurface {
 function {f_noise3d (x/seasc, y/seasc, z/seasc)}
 threshold threshy
 max_gradient 15.0000
 contained_by{ box{<-1300,-0.060,-1300>,<1300,0.060,1300>}}
 //contained_by{ sphere{0,1600}}
        accuracy      0.1  //0.001 was default
 //open
 pigment{rgb <.6,.6,.2>}
        clipped_by { bounded_by }
}

#declare deviation=0.005;

#declare Oldvalue=2;
#declare Newvalue=4;
#declare powwer=0;

#declare tries=0;
#while(tries<100)

#declare nxmax= int(10*pow(1.3,powwer));
#declare nzmax= int(10*pow(1.3,powwer));

#declare Norm=<0,0,0>;
#declare counts=0;

#declare nx=0;
#while(nx<nxmax)

#declare nz=0;
#while(nz<nzmax)

#declare exxzee=<-10+20*nx/(nxmax-1),0,-10+20*nz/(nzmax-1)>;
#declare tracey=trace(hills,exxzee+10*y,-y,Norm);


#if (vlength(Norm)!=0)
        #declare  counts=counts+1;

#end


#declare Norm=<0,0,0>;

#declare nz=nz+1;
#end

#declare nx=nx+1;
#end


#declare areafraction=counts/nxmax/nzmax;



#declare varyance=abs(areafraction-Oldvalue)/(Oldvalue+0.0000001);
#if(varyance<deviation)
#declare tries=tries+200;
#end

#declare Oldvalue=areafraction;
#declare powwer=powwer+1;

#declare tries=tries+1;
#end


//#debug "Threshold "
#debug  str(threshy,4,3)
//#debug "    volume fraction "
#debug ","
#debug  str(areafraction,6,5)
#debug  "\n"

#declare threshy=threshy+0.05;
#end


object{hills}

// speedup steps :
//  place function inside function{}
//  smallmaxgradients <1

//open
//higher accuracy

//        clipped_by { bounded_by }  only works at end


Post a reply to this message

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