POV-Ray : Newsgroups : povray.binaries.animations : Kochcurve3D(?) : Re: Kochcurve3D(?) Server Time
2 Nov 2024 15:23:56 EDT (-0400)
  Re: Kochcurve3D(?)  
From: Jan Walzer
Date: 3 Dec 2001 00:59:37
Message: <3c0b14c9$1@news.povray.org>
"Tom Bates" <tho### [at] shawca> wrote:
> Jan Walzer wrote:
> > 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>;
>
> Your geometry is close, but not quite.
I believe not close enough ;) ....

> Try this:
> #declare h1 = sqrt(1/2);
> #declare h2 = sqrt(3/4);
> #declare p1=<   0,-1/3*h1, 2/3*h2>;
> #declare p2=< 1/2,-1/3*h1,-1/3*h2>;
> #declare p3=<-1/2,-1/3*h1,-1/3*h2>;
> #declare p4=<   0, 2/3*h1,   0>;

In fact ... You're right ...


> or, even simpler (although in a different orientation):
>
> #declare p1=< 1, 1, 1>;
> #declare p2=< 1,-1,-1>;
> #declare p3=<-1, 1,-1>;
> #declare p4=<-1,-1, 1>;

I think in THIS orientation, it can't be looped any longer with rotate y*120
..

> >
> > 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;
>
> Assuming that, now, you have a truly regular tetrahedron, then a=b=c.
> But, in case we're off a bit, we could average them.
> so,
> #local a=vlength(p2-p1);
> #local b=vlength(p3-p2);
> #local c=vlength(p1-p3);
> #local h=(a+b+c)/3 * sqrt(1/2);
>
> #local n=vnormalize(vcross(p2-p1,p3-p1));
>
> #local p4=(p1+p2+p3)/3 + n*h;
>
> >
> > 3)
> > if I rotate a regular tetraedron, resting on the floor, by
> >
> > rotate <0,120*clock,360*clock>
> >
> > Shouldn't it perfectly loop ?
>
> It should.  Try it again with the new geometry.

OK ... than this is a fault of the geometry ...


Thanx .. I'll try again later ... (have to leave now)

--
Jan Walzer <jan### [at] lzernet>


Post a reply to this message

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