POV-Ray : Newsgroups : povray.general : mesh for icosahedron Server Time
8 Aug 2024 14:23:48 EDT (-0400)
  mesh for icosahedron (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Greg M  Johnson
Subject: mesh for icosahedron
Date: 30 Dec 2000 13:32:08
Message: <3a4e2a28@news.povray.org>
1) Does anyone have code for making a mesh which is an icosahedron?

2) Does anyone have code for making a N-triangle approximation of a
sphere (please don't code this just for me--does it already exist)?

3) Say I'm going to put a few thousand spheres in a union, but then want
to replace the spheres with meshes for memory's sake.  How many
triangles (I assume it's several thousand) does it take to cause the
same memory usage/parse time  as one sphere?


Post a reply to this message

From: Warp
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 13:59:38
Message: <3a4e309a@news.povray.org>
Greg M. Johnson <"gregj;-)56590\""@aol.c;-)om> wrote:
: How many
: triangles (I assume it's several thousand) does it take to cause the
: same memory usage/parse time  as one sphere?

  I think that 1 triangle would be a good guess.

  1 triangle is 1 object, exactly like a sphere, so it will take approximately
the same amount of memory. It will take also approximately the same amount
of parse time.

  If you make a spherical surface composed of thousands of triangles, it will
take a lot more memory and will be a lot slower to parse than a single
sphere.
  However, the advantage of the triangle mesh comes when you start copying
it. If you want to create 1000 spherical surfaces, the meshes will probably
take less memory (if you make one mesh representing one sphere and then
copy it 1000 times).
  Although in the case of spheres I don't know if there's such a big advantage
in using meshes. Spheres are pretty fast to render and don't take too much
memory.
  The best advantage could be achieved if you first make a union of, say,
some hundreds of spheres and then start copying this union many times. If
the union of spheres is a triangle mesh, then you'll start getting a lot
of memory and rendering time saving.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 16:07:37
Message: <chrishuff-EC044D.16090030122000@news.povray.org>
In article <3a4e2a28@news.povray.org>, "Greg M. Johnson" 
<"gregj;-)56590\""@aol.c;-)om> wrote:

> 1) Does anyone have code for making a mesh which is an icosahedron?

You might find something here:
http://www.swin.edu.au/astronomy/pbourke/


> 2) Does anyone have code for making a N-triangle approximation of a
> sphere (please don't code this just for me--does it already exist)?

Maybe you can find something useful in one of the discussions about 
"evenly spaced points on a sphere" on these groups...


> 3) Say I'm going to put a few thousand spheres in a union, but then want
> to replace the spheres with meshes for memory's sake.  How many
> triangles (I assume it's several thousand) does it take to cause the
> same memory usage/parse time  as one sphere?

A single-triangle mesh will probably use more memory than a single 
sphere, assuming texturing is the same. A copy of a mesh (of any size) 
will probably use slightly less memory than a sphere, again with all 
else equal.
For parse time, you will have to test it...but it would most likely be 
less for a copy of a mesh than a sphere.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Greg M  Johnson
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 17:38:14
Message: <3a4e63d6@news.povray.org>
Chris Huff wrote:

> > 2) Does anyone have code for making a N-triangle approximation of a
> > sphere (please don't code this just for me--does it already exist)?
>
> Maybe you can find something useful in one of the discussions about
> "evenly spaced points on a sphere" on these groups...

I've actually coded the scenario you described fairly successfully.  The
problem comes in trying to figure out which of the points should be the
vertices of the triangles.


Post a reply to this message

From: Jan Walzer
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 18:23:22
Message: <3a4e6e6a$1@news.povray.org>
I did one some weeks ago (of course in POV) ...
(just a try for myself) ...

I'll post it in p.b.s-f (If I find it again ...)

--
Jan Walzer


Post a reply to this message

From: Jan Walzer
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 18:23:24
Message: <3a4e6e6c$1@news.povray.org>
> > > 2) Does anyone have code for making a N-triangle approximation of a
> > > sphere (please don't code this just for me--does it already exist)?
> >
> > Maybe you can find something useful in one of the discussions about
> > "evenly spaced points on a sphere" on these groups...
>
> I've actually coded the scenario you described fairly successfully.  The
> problem comes in trying to figure out which of the points should be the
> vertices of the triangles.

I made some thoughts about this myself ...

It should be go with a recursive algorithm .... (sounds like StarTrek,
heheeee ...)

Imagine a regular tetraedron (ABCD),
with it's center (M),
having |A-M|=|B-M|=|C-M|=|D-M|=r


1) do for every triangle (ABC,ACD,ABD,BCD):
2)  divide it into 4 regular triangles
3)  normalize the distance of the 3 new points and the center (M) to r
4) go back to 1 until the sphere is fine enough ...

all clear ???

--
Jan Walzer
(currently no Signature)


Post a reply to this message

From: Chris Huff
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 18:39:13
Message: <chrishuff-91119A.18403730122000@news.povray.org>
In article <3a4e6e6c$1@news.povray.org>, "Jan Walzer" <jan### [at] lzernet> 
wrote:

> It should be go with a recursive algorithm .... (sounds like StarTrek,
> heheeee ...)

...snip...

That won't let you specify a specific number of triangles to use, only a 
recursion level. The number of triangles increases rather rapidly with 
recursion level.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: David Fontaine
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 23:31:13
Message: <3A4EB4AA.E0F9E334@faricy.net>
"Greg M. Johnson" wrote:

> 1) Does anyone have code for making a mesh which is an icosahedron?

That reminds me, I was gonna unzip most of the source at my website...
 http://davidf.faricy.net/source/meshpoly.inc


> 2) Does anyone have code for making a N-triangle approximation of a
> sphere (please don't code this just for me--does it already exist)?

I did this once, start with a regular polyhedron (tetra, octa or icosa will
work), subdivide each face into four triangles and normalize the vertices.
Recursive macro of course.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: David Fontaine
Subject: Re: mesh for icosahedron
Date: 30 Dec 2000 23:32:51
Message: <3A4EB50D.EE393FD4@faricy.net>
David Fontaine wrote:

> > 2) Does anyone have code for making a N-triangle approximation of a
> > sphere (please don't code this just for me--does it already exist)?
>
> I did this once, start with a regular polyhedron (tetra, octa or icosa will
> work), subdivide each face into four triangles and normalize the vertices.
> Recursive macro of course.

BTW I just thought of something, to use fewer triangles you could make the last
iteration subdivide into 2 or 3 instead.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Pete
Subject: Re: mesh for icosahedron
Date: 1 Jan 2001 13:32:21
Message: <394.401T1635T6914868PeterC@nym.alias.net>
Greg M. Johnson wrote:

> 2) Does anyone have code for making a N-triangle approximation of a
> sphere (please don't code this just for me--does it already exist)?

        Uwe Zimmermann wrote a utility called "geodesic.inc" which
does this.  I forget the URL but I know there is a pointer to it
from somewhere on the main povray site (the macros & include files
section).  It's rather handy.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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