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