POV-Ray : Newsgroups : povray.advanced-users : Infinite Cube : Re: Infinite Cube Server Time
2 Nov 2024 17:17:50 EDT (-0400)
  Re: Infinite Cube  
From: Peter Popov
Date: 21 Apr 1999 04:29:59
Message: <371d7d10.4988423@news.povray.org>
On Mon, 19 Apr 1999 15:57:23 +0300, Lewis <ble### [at] netvisionnetil>
wrote:

>I'm trying to make a macro that outputs an infinite surface area cube.
>This cube is really your usual cube, with so many pieces cut out of it
>so that it is almost infinite in surface area, but has the same volume
>as the original.
>
>The idea is to create a basic box, and then difference out, say, 3
>quarters of it, but not really three quarters, because each quarter is
>scaled down to leave a bit of the original box as a frame. Then the
>macro passes itself the coordinates of the last quarter, and thus runs
>recursively. The result should be very complex and defined by a number
>given to the macro when it is first called. Each time the macro
>recurses, it decreases this number and calls itself again, until this
>number reaches zero.
>
>Any ideas how to do this? I tried, but couldn't figure out a way to
>define the coordinates of the three quarters so that I can difference
>them out and to pass the last quarter.
>
>I guess nobody will understand any of this but hey, I gotta try...

This cutie is called "Fractal Cheese". If this is what you need,
enjoy.

Macro is below, scene and picture will be posted soon in
p.b.scene-files and p.b.i respectively (waiting for render to
finish...)

#macro Cheese (vec0, vec3, iter)
  #if (iter)
    #local vec1 = vec0*2/3 + vec3/3;
    #local vec2 = vec0/3 + vec3*2/3;
    
    box { <vec1.x,vec1.y,vec0.z-0.0001>, <vec2.x,vec2.y,vec3.z+0.0001>
}
    box { <vec1.x,vec0.y-0.0001,vec1.z>, <vec2.x,vec3.y+0.0001,vec2.z>
}
    box { <vec0.x-0.0001,vec1.y,vec1.z>, <vec3.x+0.0001,vec2.y,vec2.z>
}
    
    Cheese ( vec0,vec1,iter-1)
    Cheese ( <vec2.x,vec0.y,vec0.z>, <vec3.x,vec1.y,vec1.z> , iter-1)
    Cheese ( <vec2.x,vec0.y,vec2.z>, <vec3.x,vec1.y,vec3.z> , iter-1)
    Cheese ( <vec0.x, vec0.y, vec2.z>, <vec1.x, vec1.y, vec3.z> ,
iter-1)
    
    Cheese ( <vec0.x,vec2.y,vec0.z>, <vec1.x,vec3.y,vec1.z> , iter-1)
    Cheese ( <vec2.x,vec2.y,vec0.z>, <vec3.x,vec3.y,vec1.z> , iter-1)
    Cheese ( vec2,vec3,iter-1)
    Cheese ( <vec0.x, vec2.y, vec2.z>, <vec1.x, vec3.y, vec3.z> ,
iter-1)
  #end
#end

invoke like this:

difference
{
  box { <0,0,0>, <1,1,1> } // or whatever
  Cheese { <0,0,0>, <1,1,1> } // same as above
}


---------
Peter Popov
ICQ: 15002700


Post a reply to this message

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