POV-Ray : Newsgroups : povray.advanced-users : Infinite Cube Server Time
30 Jul 2024 16:21:06 EDT (-0400)
  Infinite Cube (Message 1 to 4 of 4)  
From: Lewis
Subject: Infinite Cube
Date: 19 Apr 1999 09:55:13
Message: <371B2833.76B4B224@netvision.net.il>
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

From: Steve
Subject: Re: Infinite Cube
Date: 19 Apr 1999 19:13:57
Message: <371BAB70.57262135@puzzlecraft.com>
while ( int i = r; i > 0; i - 1 ) is a counting loop that will count from
"r" backwards by 1 each loop. The value stored in r is preserved so it
can be reused. The loop ends when i = 0. If r doesn't need to be saved,
declare it inside the loop and r will be destructed when the loop is
exited.

You could store the coordinate in another variable and then factor it by
i inside the while loop.

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


Post a reply to this message

From: Zan Trajkov
Subject: Re: Infinite Cube
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

From: Peter Popov
Subject: Re: Infinite Cube
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.