POV-Ray : Newsgroups : povray.advanced-users : Infinite Cube : Re: Infinite Cube Server Time
30 Jul 2024 14:22:42 EDT (-0400)
  Re: Infinite Cube  
From: Zan Trajkov
Date: 20 Apr 1999 03:15:41
Message: <371C1C48.9BEB375C@sicom-ol.de>
Here is a solution in Pseudo-Code:

declare Corner1 = <1,1,1>     // left - up- coord.
declare Corner2 = <-1,-1,-1>  // right - down - coord.
declare recursion_depth = 10;


macro infinity (NewCorner1, NewCorner2 ,depth)
{

  if depth > 0 then
  {
    infinity(U1,V1, depth-1)   // Subcube 1
    .
    .
    .
    .
    .
    infinity(U8,V8, depth-1)   // Subcube 8
  }
  else
  {
     box{}       // Here create Box/Cube with NewCorner1, NewCorner2......

  }
}   // End Macro


infinity(Corner1,Corner2,recursion_depth); // first use of Macro.....


Description:

First declare the corner of your  'infinity' Cube.
With this coord. you start the macro.

If you divide every side of your cube in 2 Parts, then you will get 8
Subcubes ( 2*2*2).
If divide in 3 Parts, then 27 subcubes (3*3*3)....

In the macro, you call for each subcube the macro again.
For every call, you compute the new coords (Ux,Vx) for every subcube.
And one parameter is the new depth ( 0 <= depth <= recursion_depth )

This will go on from recursion_depth downto 0 and when depth = 0 then
crate Box with
the Parameter NewCorner1, NewCorner2.

ATT.: Be careful --> (every cube divide into 8 subcubes....) &&
recursion_depth = 2 --> 64 cubes

''                                         recursion_depth = 3 --> 8 * 64
= 512 cubes

I hope, this explain the idea enough.
I think, this should work.....
Sorry for my bad English....

v
Zan


Lewis schrieb:

> 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...


Post a reply to this message

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