POV-Ray : Newsgroups : povray.newusers : CSG shape with many 'holes' takes *forever* to render! : Re: CSG shape with many 'holes' takes *forever* to render! Server Time
31 Jul 2024 04:19:58 EDT (-0400)
  Re: CSG shape with many 'holes' takes *forever* to render!  
From: Mike Williams
Date: 2 Aug 2003 03:14:39
Message: <uQnHqDAKS2K$EwxA@econym.demon.co.uk>
Just for fun, here's a completely different approach to a cylinder with
holes in it. It only works if you can find a good mathematical
description for the pattern for the holes. It runs surprisingly quickly,
and the speed stays pretty much the same however many holes there are.

With these settings, a 640*480 render (without AA) takes under a minute
on my old 850MHz machine, and generates something like 5000 holes.


#declare D=60;    // controls the density of the holes 
                  // larger value gives more holes
#declare S = 0.1; // Controls the size of the holes
                  // relative to the spacing between them
                  // larger value gives smaller holes

#declare R1=0.9;  // Radius of outer cylinder
#declare R2=0.7;  // Radius of inner cylinder
#declare H=4;     // Height of the cylinder

#include "functions.inc"

light_source {<100,200,-100> colour rgb 1}
light_source {<-100,-200,-100> colour rgb 0.5}

isosurface {
   function {
     max (                              // intersection
       (-x*x - z*z + R2*R2),            // of inverted inner cylinder
       max (                                   // with intersection
         (f_leopard(D*f_th(x,y,z),0,D*y) -S),     // of inverted holes
         (x*x + z*z - R1*R1)                      // with outer cylinder
       )
     )
   }
   max_gradient 10
   contained_by{box {-<R1,0,R1>,<R1,H,R1>}}
   pigment {rgb 1}
}
      
camera { location  <0, 7, -9> look_at <0, H/2, 0> angle 30}


Post a reply to this message

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