POV-Ray : Newsgroups : povray.binaries.animations : Kochcurve3D(?) Server Time
2 Nov 2024 13:20:53 EDT (-0400)
  Kochcurve3D(?) (Message 1 to 8 of 8)  
From: Jan Walzer
Subject: Kochcurve3D(?)
Date: 2 Dec 2001 10:15:23
Message: <3c0a458b@news.povray.org>
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)

From: Jan Walzer
Subject: Re: Kochcurve3D(?)
Date: 2 Dec 2001 10:40:50
Message: <3c0a4b82$1@news.povray.org>
> into 6 triangles, greating one peak ...

YHYHBRTL if you type G instead of C ....


Post a reply to this message

From: Reusser
Subject: Re: Kochcurve3D(?)
Date: 2 Dec 2001 11:09:31
Message: <021220011005457300%reu1000@chorus.net>
In article <3c0a4b82$1@news.povray.org>, Jan Walzer <jan### [at] lzernet>
wrote:


> YHYHBRTL if you type G instead of C ....
   ^

Or if you type an H instead of a K.

 - Rico


Post a reply to this message

From: Jan Walzer
Subject: Re: Kochcurve3D(?)
Date: 2 Dec 2001 13:59:57
Message: <3c0a7a2d@news.povray.org>
but ... but... ehhmm ... but ... they look soooo similar ....


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


Post a reply to this message

From: JRG
Subject: Re: Kochcurve3D(?)
Date: 2 Dec 2001 17:01:59
Message: <3c0aa4d7$1@news.povray.org>
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>;

p1, p2 and p3 are not the vertixes of an equilateral triangle. They are the
vertixes of an isosceles triangle with base = 1 and height =1.

--
Jonathan.


Post a reply to this message

From: Tom Bates
Subject: Re: Kochcurve3D(?)
Date: 2 Dec 2001 17:38:08
Message: <3c0aad50@news.povray.org>
Jan Walzer wrote:
> 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>;

Your geometry is close, but not quite.  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>;

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

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

>
> Can anyone spot the mistakes I did ? ...
>
> Any other comments ?
>
>
> --
> Jan Walzer <jan### [at] lzernet>
>
>

Tom Bates.


Post a reply to this message

From: Jan Walzer
Subject: Re: Kochcurve3D(?)
Date: 3 Dec 2001 00:55:59
Message: <3c0b13ef@news.povray.org>
"JRG" <jrg### [at] hotmailcom> schrieb im Newsbeitrag
news:3c0aa4d7$1@news.povray.org...
> 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>;
>
> p1, p2 and p3 are not the vertixes of an equilateral triangle. They are the
> vertixes of an isosceles triangle with base = 1 and height =1.


damn ... you hit me ... Thanx ...
I'll post again later...


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


Post a reply to this message

From: Jan Walzer
Subject: Re: Kochcurve3D(?)
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.