An Arch Fractal


Lisp function to make an Arch Fractal (given an arch element).


    (defop   arch-fractalizer
     
    (param:   arch-element top-color bot-color levels
      fractal-ratio height width leg-width)
     
    (local:  
    (total-levels levels)
    (offset-dist (half   (dif   width leg-width)))
    (sub-tower-offset-1   (vector   offset-dist 0 0))
    (sub-tower-offset-2   (mirror   x-axis sub-tower-offset-1)))
      (arch-tower   levels))

    (defop   arch-tower
      (param:   levels)
     
    (if   (zerop   levels)
      (then   nothing)
      (else   (add-arch-level   (arch-tower   (dif   levels 1))))))

    (defop   add-arch-level
      (param:   sub-tower)
     
    (grasp   sub-tower
      (scale   fractal-ratio)
      (move   (vector   0 height 0))
      (rotate   0.25 y-axis))
     
    (grasp   arch-element
     
    (recolor   (interp   (quo   levels total-levels)
      bot-color
      top-color)))
     
    (subworld   (group   arch-element
      (move   subtower-offset-1 sub-tower)
      (move   subtower-offset-2 sub-tower))))