POV-Ray : Newsgroups : povray.general : Sphere/polyherdon question Server Time
2 Nov 2024 09:20:41 EDT (-0400)
  Sphere/polyherdon question (Message 1 to 10 of 21)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Ilia Guzei
Subject: Sphere/polyherdon question
Date: 1 May 2004 18:06:33
Message: <40941f69@news.povray.org>
I need to approximate a sphere with 60,000 points.  How can I generate such
a polyhedron with equivalent points on the sphere?  Perhaps a C algorithm is
posted some place on this web site but I can't find it.

Thanks,
Ilia


Post a reply to this message

From: Chris Johnson
Subject: Re: Sphere/polyherdon question
Date: 1 May 2004 23:01:36
Message: <40946490$1@news.povray.org>
If you can cope with a number close to 60000, start with an octahedron (or
possibly an icosahedron), then subdivide each triangle into four (by drawing
a new triangle with its vertices the midpoints of the edges of the original
triangle), then rescale the position of these midpoints onto the sphere
surface. This subdivision is then repeated.

If you need exactly 60,000 points, there are ways that I can see of doing
it, but they're not very nice.

-Chris


Post a reply to this message

From: Paul Bourke
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 00:24:12
Message: <pdb_NOSPAM-ABFA9D.14241102052004@news.povray.org>
> I need to approximate a sphere with 60,000 points.  How can I generate such
> a polyhedron with equivalent points on the sphere?  Perhaps a C algorithm is
> posted some place on this web site but I can't find it.

if you can live with other numbers around 60,000 (whos going to count
them anyway?!) then see this
   http://astronomy.swin.edu.au/~pbourke/modelling/sphere/

-- 
Paul Bourke
pdb_NOSPAMswin.edu.au


Post a reply to this message

From: Ilia Guzei
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 02:31:24
Message: <409495bc@news.povray.org>
I have done that, but the distribution is not even as the four triangles
resulting from division of each original one are not equilateral.  The final
distribution is somewhat skewed with higher "point density" about the
original vertices.

Mersenne twister can probably produce a random enough (as in "uniform")
distribution but I'd rather do it exactly if possible.  I need to do it once
to generate an input table for an application, so time and algorithm
efficiency is irrelevant.

The exact number of points does not matter as long as it is large enough.


Best regards,
Ilia

"Chris Johnson" <chris(at)chris-j(dot)co(dot)uk> wrote in message
news:40946490$1@news.povray.org...
> If you can cope with a number close to 60000, start with an octahedron (or
> possibly an icosahedron), then subdivide each triangle into four (by
drawing
> a new triangle with its vertices the midpoints of the edges of the
original
> triangle), then rescale the position of these midpoints onto the sphere
> surface. This subdivision is then repeated.
>
> If you need exactly 60,000 points, there are ways that I can see of doing
> it, but they're not very nice.
>
> -Chris
>
>


Post a reply to this message

From: Shay
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 03:59:01
Message: <4094aa45@news.povray.org>
Ilia Guzei wrote:

> I have done that, but the distribution is not even as
> the four triangles resulting from division of each
> original one are not equilateral.  The final distrib-
> ution is somewhat skewed with higher "point density"
> about the original vertices.

This will not be the case if you start with an icosahedron

> The exact number of points does not matter as long as
> it is large enough. 

60k is simple to generate exactly. I don't have the vocabulary to explain
how, but I can generate this array in a few minutes and email it to you if
you would like.

Let me know.

 -Shay


Post a reply to this message

From: Sebastian H 
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 04:48:22
Message: <4094b5d6@news.povray.org>
Paul Bourke wrote:
>>I need to approximate a sphere with 60,000 points.  How can I generate such
>>a polyhedron with equivalent points on the sphere?  Perhaps a C algorithm is
>>posted some place on this web site but I can't find it.
> 
> 
> if you can live with other numbers around 60,000 (whos going to count
> them anyway?!) then see this
>    http://astronomy.swin.edu.au/~pbourke/modelling/sphere/
> 

Very interesting, thank you for the link.

Sebastian H.


Post a reply to this message

From: Sebastian H 
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 05:01:11
Message: <4094b8d7@news.povray.org>
Sebastian H. wrote:
> Paul Bourke wrote:
> 
>>> I need to approximate a sphere with 60,000 points.  How can I 
>>> generate such
>>> a polyhedron with equivalent points on the sphere?  Perhaps a C 
>>> algorithm is
>>> posted some place on this web site but I can't find it.
>>
>>
>>
>> if you can live with other numbers around 60,000 (whos going to count
>> them anyway?!) then see this
>>    http://astronomy.swin.edu.au/~pbourke/modelling/sphere/
>>
> 
> Very interesting, thank you for the link.
> 

http://astronomy.swin.edu.au/~pbourke
Wow I think I'll spend some time on your site!

Regards,
Sebastian H.


Post a reply to this message

From: Chris Johnson
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 07:30:42
Message: <4094dbe2$1@news.povray.org>
The polar method isn't going to help here in its current form if the
subdivision method generates a distribution that is too uneven: as you say,
the polar method generates very small triangles at the poles. It could
perhaps be modified to generate fewer triangles at each "line of latitude"
closer to the poles, but this might be tricky.

-Chris


Post a reply to this message

From: Chris Johnson
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 07:38:34
Message: <4094ddba$1@news.povray.org>
-[The final distribution is somewhat skewed with higher "point density"
about the original vertices]-
Once you have a mesh of the points, if you model electrostatic repulsion
between the points, while keeping them bounded on the sphere, after a few
iterations of the repulsion algorithm, the will have rearranged themselves
into an even distribution. Alternatively, it might be a good idea to model
the edges as springs pulling the modal together - this might avoid the
potential problem of the points reshuffling so much that they form very
non-iscosceles triangles. If you start with an icosahedron, I think this
method might work.

One could start with 60000 random points on a sphere and apply the
electrostatic repulsion method to get a near-even distribution, but the
difficulty then is finding the best way to form the edges. This problem of
finding the "best" edges given a set of points is quite hard I think.

-Chris


Post a reply to this message

From: Ilia Guzei
Subject: Re: Sphere/polyherdon question
Date: 2 May 2004 09:22:10
Message: <4094f602@news.povray.org>
>
> > I have done that, but the distribution is not even as
> > the four triangles resulting from division of each
> > original one are not equilateral.  The final distrib-
> > ution is somewhat skewed with higher "point density"
> > about the original vertices.
>
> This will not be the case if you start with an icosahedron
>

Unfortunately, it is the case.  Just to prove it, take a look at a triangle
with the following apical positions A=1 0 0 , B=0 1 0, C=0 0 1.
Let's divide sides AB and AC in half and normalize the resulting points.
AB/2 = D = {cos(45), cos(45), 0}  and  AC/2 = E = {cos(45), 0, cos(45)}.
The resulting triangle  ADC  is not equiltateral :
AD = AE = sqrt (pow(1-cos(45),2)+pow(cos(45),2)) = 0.76
DE = sqrt(0+ 1/2 + 1/2) = 1.

It's the same story with icosahedron.



> > The exact number of points does not matter as long as
> > it is large enough.
>
> 60k is simple to generate exactly. I don't have the vocabulary to explain
> how, but I can generate this array in a few minutes and email it to you if
> you would like.

If you could send me your algorithm I would most certainly appreciate it.  I
want to be able to generate any number of points to model the sphere, I am
not sure what number will satisfy my task but the more the better.

Ilia


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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