POV-Ray : Newsgroups : povray.pov4.discussion.general : Playing with suggested v4.0 f_boxb and three cos function. : Playing with suggested v4.0 f_boxb and three cos function. Server Time
25 Apr 2024 18:31:35 EDT (-0400)
  Playing with suggested v4.0 f_boxb and three cos function.  
From: William F Pokorny
Date: 18 Feb 2023 23:38:13
Message: <63f1a7b5$1@news.povray.org>
In newusers there was recently a post about creating an isosurface with 
the function "cos(x) + cos(y) + cos(z)". I decided to grab that function 
and play with the new to povr fork's f_boxb(). A function intended for 
use in specifically with isosurfaces.

f_boxb() is a function which takes another function as an input and 
encloses it in a box which in part or in total is expected to be smaller 
than the isosurface contained_by shape.

The contained_by shape can itself be used to clip away sides of the now 
boxed original function to expose an inner structure. I did this on the 
top and front in the attached image.

Bill P.

Aside: The gradient of "cos(x) + cos(y) + cos(z)" is relatively high as 
isosurface functions go.

// Code ONLY works with the povr fork
...
#include "functions.inc"
// Function f_boxb defined in functions.inc
#declare Fn03 = function (x,y,z) { (cos(x) + cos(y) + cos(z))*-1 }
#declare Fn04 = function (x,y,z) {
     f_boxb(x,y,z,0.6,0.667,1,-0.02,0,0,Fn03(x*20,y*20,z*20),0.010)
}
#declare Iso99 = isosurface {
     function { Fn04(x,y,z) }
     contained_by { box { <-1,-1,-0.95>,<1,1/3,1> } }
     threshold 0
     accuracy 0.00017
     max_gradient 33.3
}
#declare SorrellBrown = srgb <0.80784,0.72549,0.56078>;
#declare Pigment02 = pigment { color SorrellBrown }
#declare Normal02 = normal { granite  0.31 scale 0.177 }
#declare Finish02 = finish { phong 0.33 }
#declare Texture02 = texture {
     pigment { Pigment02 }
     finish { Finish02 }
     normal { Normal02 }
}
#declare Obj02 = object { Iso99 texture { Texture02 } }
...


Post a reply to this message


Attachments:
Download 'threecosiso.jpg' (108 KB)

Preview of image 'threecosiso.jpg'
threecosiso.jpg


 

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