POV-Ray : Newsgroups : povray.beta-test : Isosurface: max_gradient warning? : Re: Isosurface: max_gradient warning? Server Time
27 Apr 2024 21:03:58 EDT (-0400)
  Re: Isosurface: max_gradient warning?  
From: Thomas de Groot
Date: 22 Jun 2013 07:05:57
Message: <51c58515$1@news.povray.org>
On 22-6-2013 10:38, Le_Forgeron wrote:
> 1. Have you an actual isosurface to provide us some basic testing ?
> 2. computation of max_gradient in isosurface is not thread-safe, have
> you tested (the slow) -WT1 option (limiting to one thread, it's slow,
> but then safe)
>
> (point 2 is already reported as #296 in bugs.povray.org)
>

point 1:
//start code
#declare P1gain = 0.1;	
#declare P1turb = <0.1, 0.5, 0.3>;			
#declare P1scale = <0.1, 0.1, 0.5>;	
#declare P1rotate = <0, 0, 0>;			
#declare P1angle = 45;

#declare P2gain = 0.5;
#declare P2turb = <0.5, 0.9, 0.9>;		
#declare P2scale = <0.1, 2.5, 0.1>; // increasing y reduces breaking-up 
of P2 (?)
#declare P2rotate = <0, 90, 0>;				
#declare P2angle = -10;	// rotates from vertical (0) to horizontal (90); 
note: dents and wrinkles rotate in opposite ways!

#declare Xscale = 1000;	// increase size of landscape (not scale!) for X
#declare Zscale = 1000;	// increase size of landscape (not scale!) for Z
// ----------------------------------------

// an eroded landscape:
#declare P1a=function {pattern {wrinkles scale P1scale rotate P1rotate }}
#declare P1b=function {pattern {wrinkles warp {turbulence P1turb octaves 
3 omega 0.5 lambda 1} scale P1scale rotate P1rotate}}
#declare P1c=function {pattern {ripples frequency 0.1 warp {turbulence 
<0.5,0.3,0.5> octaves 3 omega 0.5 lambda 1} scale <0.1, 0.1, 0.1> }}

#declare P2a=function {pattern {dents scale P2scale rotate P2rotate}}
#declare P2b=function {pattern {dents warp {turbulence P2turb octaves 5 
omega 0.5 lambda 2} scale P2scale rotate P2rotate}}

#declare P3=function {f_noise3d(x,y,z)*1}
#declare P4=function {f_hetero_mf(x,y,z, 0.8, 2, 1, 0, 0.9, 2)*1 } // 
H,lacunarity,octaves,offset,gain,ng
#declare P5=function {f_hetero_mf(x,y,z, 0.1, 2, 1, 0, 0.1, 2)*1 } // 
H,lacunarity,octaves,offset,gain,ng

// rotate y:
#declare P1ca=function {P1c(x*cos(radians(P1angle)) - 
z*sin(radians(P1angle)), y, x*sin(radians(P1angle)) + 
z*cos(radians(P1angle)) )}
// rotate z:
#declare P1aa=function {P1a(x*cos(radians(P1angle)) + 
y*sin(radians(P1angle)), (-x*sin(radians(P1angle)) + 
y*cos(radians(P1angle)))*2, z)*1}
// rotate z:
#declare P2aa=function {P2a(x*cos(radians(P2angle)) + 
y*sin(radians(P2angle)), (-x*sin(radians(P2angle)) + 
y*cos(radians(P2angle)))*2, z)*1}

#declare P=function {  P4(x, y, z)
                      + P2aa(x, y, z)*P2gain
                      - P1aa(x, y, z)*P1gain
                     }

isosurface {
   function {y - P(x, y, z)}
   threshold 0.1
   max_gradient 5 //10
   accuracy 0.001
   contained_by {box {<0.5-Xscale*0.5, -1, 0.5-Zscale*0.5>, 
<0.5+Xscale*0.5, 2, 0.5+Zscale*0.5>}}
   translate <-0.5, 0, -0.5>
   scale <1, 2, 1>
   //texture {Landtex}
}

//end code

point 2:
Have not done so, but shall test that.

Thanks!

Thomas


Post a reply to this message

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