|
|
Here's one way to make a 3d Koch snowflake fractal. Unfortunatly, the
prisms arn't terribly accurate, but t'works..
-Alex
---- Code follows ----
#declare rt = sqrt(3)/6;
#declare scal = 0.5;
#macro koch(depth)
prism {
conic_sweep
linear_spline
0,
1,
4,
<-0.5,-rt>,<0,rt*2>,<0.5,-rt>,<-0.5,-rt>
rotate x*180
translate y
scale <1,rt*3,1>
scale 0.5
}
#if (depth > 0)
#local rot = 0;
#while (rot < 3)
#if (depth = 1)
object {
#else
union {
#end
koch(depth-1)
scale scal
rotate y*60
translate rt*z/2
rotate x*-70
translate -rt*z/2
rotate y*(rot*120-60)
}
#declare rot = (rot+1);
#end
#end
#end
Post a reply to this message
|
|
|
|
Alex Vandiver wrote:
>
> Here's one way to make a 3d Koch snowflake fractal. Unfortunatly, the
> prisms arn't terribly accurate, but t'works..
> -Alex
whee... this was far simpler than my version... *smiles*
I tried to store all points in the curve(a _lot_) and intersect theese with
cylinders ... I'll keep looking at it... although the parse may take some...
time.. :-)
--
//Spider -- [ spi### [at] bahnhofse ]-[ http://www.bahnhof.se/~spider/ ]
And the meek'll inherit what they damn well please
Get ahead, go figure, go ahead and pull the trigger
Everything under the gun
--"Sisters Of Mercy" -- "Under The Gun"
Post a reply to this message
|
|