|
|
Anders Haglund did some days ago something with a regular kochcurve in POV,
and as he said, he wanted to do it in 3d, but didn't know how ...
I got the idea, to apply the algorithm to a regular triangle, dividing it
into 6 triangles, greating one peak ...
it looked nice, so I did it with a tetraedron ...
the shape is no longer something lige a snowflake, but it converges against
the shape of a cube ...
it's a pity, that my simplest math left me, when I tried, to make the sides
of the trianles equal ...
Thats the reason(I think), why it looks like a distorted cube, and why it
doesn't loop correctly...
somewhere there must be some mistake...
Can anyone spot, where I got wrong ?
1)
the points of a regular tetraedron can have the following coordinates
#declare h=sqrt(3/4);
#declare p1=< 0,-1/3*h, 2/3>;
#declare p2=< 1/2,-1/3*h,-1/3>;
#declare p3=<-1/2,-1/3*h,-1/3>;
#declare p4=< 0, 2/3*h, 0>;
2)
to calculate the top of the new pyramid that I create on a triangle,
I use the following:
(I assume, if I'd use a "real" regular triangle, it could be simplified)
p1,p2,p3 are now the points of the triangle, to be subdivided...
p4 is the new point at the top of the pyramid..
#local a=vlength(p2-p1);
#local b=vlength(p3-p2);
#local c=vlength(p1-p3);
#local n=vnormalize(vcross(p2-p1,p3-p1))*sqrt(a^2-(sqrt(b^2-(c/2)^2)/3)^2);
#local p4=(p1+p2+p3)/3+n/3;
3)
if I rotate a regular tetraedron, resting on the floor, by
rotate <0,120*clock,360*clock>
Shouldn't it perfectly loop ?
Can anyone spot the mistakes I did ? ...
Any other comments ?
--
Jan Walzer <jan### [at] lzernet>
Post a reply to this message
Attachments:
Download 'koch3.avi.dat' (495 KB)
|
|