POV-Ray : Newsgroups : povray.text.scene-files : 3d Snowflake curve.. Server Time
29 Jul 2024 00:23:21 EDT (-0400)
  3d Snowflake curve.. (Message 1 to 2 of 2)  
From: Alex Vandiver
Subject: 3d Snowflake curve..
Date: 2 May 1999 22:25:38
Message: <372CFB02.1031E814@tiac.net>
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

From: Spider
Subject: Re: 3d Snowflake curve..
Date: 2 May 1999 22:33:37
Message: <372CFBA9.9CBF5FAA@bahnhof.se>
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

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