POV-Ray : Newsgroups : povray.general : fractal pattern help Server Time
26 Nov 2024 13:48:16 EST (-0500)
  fractal pattern help (Message 1 to 3 of 3)  
From: Anthony D  Baye
Subject: fractal pattern help
Date: 3 Aug 2010 15:30:01
Message: <web.4c586d22bb57c5a99e1c416d0@news.povray.org>
I'm looking for a fractal pattern to simulate the veins in a leaf, a function
would do nicely, but I need something that can be rotated around a point.

Something like this:

http://www.easywildflowers.com/quality/ner.lu2.jpg

Any suggestions or ideas would be appreciated.

thanks in advance.

A.D.B.


Post a reply to this message

From: waggy
Subject: Re: fractal pattern help
Date: 4 Aug 2010 01:15:09
Message: <web.4c58f6412a7c91b6f99d05c80@news.povray.org>
"Anthony D. Baye" wrote:
> I'm looking for a fractal pattern to simulate the veins in a leaf, a function
> would do nicely, but I need something that can be rotated around a point.
>
I posted a way to use the logistic map as a pattern last year.  Applying a few
warps like the ones below might get you started.

// ----------------------------------------
// Persistence of Vision Ray Tracer Scene Description File

// File: lm_pattern.pov

// Vers: 3.6, 3.7

// Desc: Logistic Map Pattern Example

// Date: 20010-08-03

// Auth: David Wagner

// Cite: http://en.wikipedia.org/wiki/Logistic_map

//

#include "colors.inc"
// ----------------------------------------
// Returns the distance to the nearest logistic value after lm_imin iterations.
#declare lm_i_distance_min = function( lm_r, lm_pop, lm_val, lm_nearestpop,
lm_i, lm_istart, lm_iend ) {

   select(lm_i > lm_iend, 0,

     lm_i_distance_min(

       lm_r,

       lm_r*lm_pop*(1-lm_pop),

       lm_val,

       select(lm_i > lm_istart & ( (abs(lm_pop-lm_val) <
abs(lm_nearestpop-lm_val)) ),0,

         lm_nearestpop,

         lm_pop),

       lm_i+1, lm_istart, lm_iend ),
     //abs(lm_val-lm_nearestpop) // Includes a straight line along the edge.

     select(lm_nearestpop<(1-0.5/lm_iend),0,1,abs(lm_val-lm_nearestpop) )

     )//end recursion select

   };



// Calls the recursive iterating function.

#declare lm_fn_distance_min = function( lm_r, lm_val, lm_istart, lm_iend ) {

  lm_i_distance_min(lm_r,0.5, lm_val, 1, 1, lm_istart, lm_iend)
  };
// ----------------------------------------

#local lm_istart= 20  ;//Minimum iterations.

#local lm_iend  =100  ;//Maximum iterations.
#local n_circum = 25  ;//Number of repeats around the circle.
#local r_offset=   0.0;//Can make a rosette in the center.  Try 0.01 or larger.

cylinder{<0,0,0>,y*0.1, r_offset+4

  texture{

    pigment {
      function { lm_fn_distance_min(z,x, lm_istart, lm_iend) }
      poly_wave 0.25

      color_map{[0 0.25*Green][1 LimeGreen]}
      warp{ repeat x flip x} //circumferential
      warp{ repeat z*4 }     //radial

      warp{turbulence 0.1*(x+y)}
      translate z*r_offset
      scale 0.5/ n_circum *(x) +y+z
      warp{ cylindrical orientation z dist_exp 0 }
      warp{ black_hole <0,0,0>, 4 inverse falloff 0.5}

      warp{turbulence 0.1*(x+y)}

      }//end pigment

  }//end texture

}
// ----------------------------------------

camera {

  location  <0,6,-9>

  direction 1.5*z

  right     x*image_width/image_height

  look_at   <0.0, 0.0,  0.0>

}

sky_sphere {

  pigment {

    gradient y

    color_map {

      [0.0 rgb <0.6,0.7,1.0>]

      [0.7 rgb <0.0,0.1,0.8>]

    }

  }

}

light_source {<0, 0, 0>

  color rgb <1, 1, 1>

  translate <-30, 30, -30>

}
// ----------------------------------------


Post a reply to this message

From: waggy
Subject: Re: fractal pattern help
Date: 4 Aug 2010 10:20:00
Message: <web.4c5976c82a7c91b6f99d05c80@news.povray.org>
I forgot to include the following warnings.  Please put this near the top of the
code posted.


// WARNING: Declare this function first in a scene.

// WARNING: This recursive function is invalid SDL and can crash POV-Ray.

It would be a good idea to move the #include "colors.inc" line to after the
function declarations, as well.


Post a reply to this message

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