POV-Ray : Newsgroups : povray.general : Object Pattern ISOSurface : Re: Object Pattern ISOSurface Server Time
1 Aug 2024 00:16:29 EDT (-0400)
  Re: Object Pattern ISOSurface  
From: Chris B
Date: 15 Jun 2006 06:10:17
Message: <44913209@news.povray.org>
"POVMAN" <s### [at] acom> wrote in message news:44912e74$1@news.povray.org...
>I havn't tried ...
>
> You can create object pattern media using pigment_map and you can evaluate 
> a pigment in a function, can you use object pattern to create an 
> isosurface?
>
> -- 
> #####-----#####-----#####
> POV Tips and Hints at ...
> http://povman.blogspot.com/
>

Yes,
Gets very slow though.

I was playing around with it a couple of weeks back to try and see if I 
could emulate the sort of caverns that were scanned and animated on the 
animation news group.
I merged four tubes to get some tunnels, then added a bit of turbulence to 
give a rough surface. Lowering the max_gradient setting improves render 
times and results in more holes (similar to the laser scanned animation).

Here's what I came up with:


camera {location <-0.75, 1.7,-2> look_at <0,1.7,0>}
light_source { <-0.2, 1.7, -6 > color 0.4}
light_source { <-0.2, 1.7, -2 > color 0.4}
light_source { <-0.2, 1.7,  2 > color 0.4}
light_source { < 0.2, 1.2,  6 > color 0.4}
light_source { <-0.2, 1.7,  10> color 0.4}
light_source { <-0.2, 1.7,  14> color 0.4}

#declare Simple = 0;

#declare MyTube = intersection {
  box {<-1,0,-100.1>,<1,2.5,100.1>}
  cylinder {<0,1,-100>,<0,1,100>,1.29}
}

#declare MyObject = merge {
  object {MyTube}
  object {MyTube rotate y*90 translate 0.001*y}
  object {MyTube rotate <5,20,0> translate 0.002*y translate 3*z}
  object {MyTube rotate z*10 rotate y*90 translate 0.003*y translate 6*z}
}


#if (Simple) object {MyObject pigment {color rgb <1,1,0>}}
#else
  // Use object as a pigment and define this as a function
  #declare MyFunction = function {
    pigment {
      object {
         MyObject
         color rgb <1,1,1>
         color rgb <0,0,0>
      }
      turbulence 0.1
    }
  }

  // Use Function in Isosurface
  isosurface {
    function { MyFunction (x, y, z).red -0.5}
    contained_by { box { -200, 200} }  // container shape
  //  accuracy 0.001           // accuracy of calculation [0.001]
    max_gradient 2000          // maximum gradient the function can have 
[1.1]
    pigment {color rgb <1,1,1>}
    scale 5
  }
#end

Regards,
Chris B.


Post a reply to this message

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