POV-Ray : Newsgroups : povray.general : Generating a mesh from points...? Server Time
5 Aug 2024 18:24:55 EDT (-0400)
  Generating a mesh from points...? (Message 3 to 12 of 12)  
<<< Previous 2 Messages Goto Initial 10 Messages
From: Florian Pesth
Subject: Re: Generating a mesh from points...?
Date: 31 Aug 2002 12:07:17
Message: <3D70EA38.8050206@compuserve.de>
> Any links?

http://news.povray.org/povray.newusers/22081/

Be aware of some problems... it is not so easy as it seems, and I have 
not succeeded in the given time. Maybe I will try later again, but at 
the moment I have absolutely no time :-(. I'm looking forward for your 
results ;-).

Florian Pesth


Post a reply to this message

From: John VanSickle
Subject: Re: Generating a mesh from points...?
Date: 1 Sep 2002 15:36:03
Message: <3D726BFD.9C126391@hotmail.com>
Tim Nikias wrote:
> 
> I've implemented an electrostatic repulsion algorithm
> in order to distribute points on a sphere.
> Now I'd like to know how can easily convert the
> points into a mesh which has only triangles on the
> outside surface.
> I'd like it to work by selecting three closest points, make
> triangle, and then move on, creating triangles as need,
> until the entire area is covered.
> I could go about and simply connect all combinations of
> three points, but this is insane for point-amounts well
> above 200 (at the moment 500).

Brute force is an O(n^3) problem, so I can see how you'd want to
avoid that...

You could build three sets of indices, each of which sorts the points
according to the x, y, and z coordinates; then match only those that are
within a certain range along all three indices.

Regards,
John


Post a reply to this message

From: Shay
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 01:50:17
Message: <3d72fc19$1@news.povray.org>
"Tim Nikias" <tim### [at] gmxde> wrote in message
news:3d70e2d7$1@news.povray.org...
>
> Any links?
>

No links, but I can see a fairly straightforward way to accomplish this.
Three closest points *will not* work. No amount of time will ever make it
work, so patience isn't even an issue. Point B may be the closest point to
Point A, but Point A is not *necessarily* the closest point to PointB. Here
is an example:
A=========B==C

This is how I would accomplish what you are trying to. I don't know any
math, so I hope that I can communicate what I mean with words. Make a circle
around each point which is a little larger than half the maximum distance
around the closest points and make a polygons out of the circle
intersections. Then, make a polygon around any vertex for which the circle
method did not work out of all surrounding intersections or vertices.
Triangulate the polygons, and then you will be done, but with extra
triangles.

I had a better idea while I was typing the first. Just add planes making
sure all vertices are on one side of the plane until all vertices are
included and then  figure out the  plane intersections.

I haven't tested this, but it seems to make sense as I type.

 -Shay


Post a reply to this message

From: Warp
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 07:23:43
Message: <3d734a3f@news.povray.org>
Shay <shi### [at] houstonrrcom> wrote:
> Triangulate the polygons

  By the way, that's far from trivial.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Luc Henninot
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 10:11:22
Message: <3d73718a$1@news.povray.org>
Hmmm, forces ?
That makes me thinking about blobs...

Maybe a way to solve your problem ?

Regards
 L.H.


3d70e2d7$1@news.povray.org...
> I've implemented an electrostatic repulsion algorithm
> in order to distribute points on a sphere.
> Now I'd like to know how can easily convert the
> points into a mesh which has only triangles on the
> outside surface.
> I'd like it to work by selecting three closest points, make
> triangle, and then move on, creating triangles as need,
> until the entire area is covered.
> I could go about and simply connect all combinations of
> three points, but this is insane for point-amounts well
> above 200 (at the moment 500).
>
> Any links?
>
> --
> Tim Nikias
> Homepage: http://www.digitaltwilight.de/no_lights/index.html
> Email: Tim### [at] gmxde
>
>


Post a reply to this message

From: Shay
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 13:35:08
Message: <3d73a14c$1@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3d734a3f@news.povray.org...
> Shay <shi### [at] houstonrrcom> wrote:
> > Triangulate the polygons
>
>   By the way, that's far from trivial.
>

I never said trivial. <g> Since all of the points lie on a sphere, however,
triangulating them would be pretty straightforward.

 -Shay


Post a reply to this message

From: Micha Riser
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 15:31:31
Message: <3d73bc91@news.povray.org>
From what I understand your problem the "convex hull" of the points is what 
you are looking for. The convex hull is the smallest surface of set of 
triangles that contains all of the points in its interior (probably a bad 
description). This is the set of triangles that you are looking for. It can 
be created in O(n log n) (where n is the number of points). I cannot give 
you a detailed algortihm for that right now as I only know it for 2D. But 
searching for "convex hull 3d" in google gives plenty of results.

- Micha

-- 
http://objects.povworld.org - the POV-Ray Objects Collection


Post a reply to this message

From: Warp
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 16:50:18
Message: <3d73cf0a$1@news.povray.org>
Shay <shi### [at] houstonrrcom> wrote:
> Since all of the points lie on a sphere, however,
> triangulating them would be pretty straightforward.

  You'll have to explain that in more detail before I believe it. :)

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Shay
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 19:04:13
Message: <3d73ee6d@news.povray.org>
"Warp" <war### [at] tagpovrayorg> wrote in message
news:3d73cf0a$1@news.povray.org...
>
>   You'll have to explain that in more detail before I believe it. :)
>

The plane method would be easiest. Just start with the two points with the
lowest x value and make one edge out of them. Then find what point will make
a plane with the edge so that all of the points in the set are on one side
of the plane or resting exactly on it. This will give you two new edges from
which to work. etc. etc. etc. Now will you believe it?

 -Shay


Post a reply to this message

From: Warp
Subject: Re: Generating a mesh from points...?
Date: 2 Sep 2002 19:30:40
Message: <3d73f4a0@news.povray.org>
Shay <shi### [at] houstonrrcom> wrote:
> The plane method would be easiest. Just start with the two points with the
> lowest x value and make one edge out of them. Then find what point will make
> a plane with the edge so that all of the points in the set are on one side
> of the plane or resting exactly on it. This will give you two new edges from
> which to work. etc. etc. etc. Now will you believe it?

  Yes, I see how this always creates convex polygons even when there are
more than three points in the same plane.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

<<< Previous 2 Messages Goto Initial 10 Messages

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