POV-Ray : Newsgroups : povray.binaries.images : Crummy isosurface evaluation. : Crummy isosurface evaluation. Server Time
15 May 2024 06:03:30 EDT (-0400)
  Crummy isosurface evaluation.  
From: Bald Eagle
Date: 17 Feb 2020 19:45:00
Message: <web.5e4b337cdcc91474eec112d0@news.povray.org>
So, I've been trying half a dozen ways to make a shape, and I managed to work
out the equations to do it with an isosurface.
(because OMG are parametrics SLOOOOOOW)


Only the frequency of the sine wave for the serrated, lemon-juicer top doesn't
look right, and it's hard to really see what's going wrong with all of the
unexpected noise.

#declare ISphereR = 24;
#declare I_Phi = function {tan(z/x)}
#declare F_Sphere = function {pow(x,2)+pow(y,2)+pow(z,2) - pow(ISphereR,2)}

// a sine wave 80% of full size, with 3 peaks
#declare F_Wave = function {ISphereR*0.8 * sin(3*I_Phi(x, y, z))}
// only generate a spherical isosurface for the parts where the height
//  is less than the sine wave function
#declare I = function {select(F_Wave(x,y,z)-y, 0, 0, 1)}

//----------------For debugging---------------------------
//#declare S_Wave = function {I(x,y,z)*F_Sphere(x,y,z)}
//--------------------------------------------------------
#declare S_Wave = function {select(y, F_Sphere (x, y, z),
I(x,y,z)*F_Sphere(x,y,z))}


 #declare Gradient = 5500;
 #declare Min_factor= 0.7;
 #declare I_Surface = isosurface {
   //function {Pattern(x, y, z).red - 0.5}
   function {S_Wave (x, y, z)}
   open
   threshold 0
   max_gradient 5500
   //evaluate Gradient*Min_factor,  sqrt(Gradient/(Gradient*Min_factor)),  min
(0.7, 1.0)
   accuracy     0.1
   contained_by {box {<-1, -1, -1>*ISphereR*1.1, <1, 1, 1>*ISphereR*1.1}}
    }


Post a reply to this message


Attachments:
Download 'isosurface.png' (88 KB)

Preview of image 'isosurface.png'
isosurface.png


 

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