This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > September 2004 > Utilities to convert ASCII text coordinates to indexfacset?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Utilities to convert ASCII text coordinates to indexfacset?
Canopus

2004-08-30, 7:17 pm

I have a set of x,y,z coordinates that form a mesh. Is there a
freeware or shareware utility that will translate them into an
indexedfaceset? I have looked at WhiteDune, Wings3d and
ArtofIllusion, all of which support creating a default square and/or
triangle mesh, but none of which will allow the importing of a user
defined set of coordinates. Where should I be looked. Thanks -
Canopus
Joerg Scheurich aka MUFTI

2004-08-30, 11:16 pm

> I have a set of x,y,z coordinates that form a mesh.

Not really. If you have a set of x,y,z coordinates, it form a PointSet.
To form a mesh you need the information too, which points are connected
with each other to form the faces.

> Is there a
> freeware or shareware utility that will translate them into an
> indexedfaceset?


If you would tell the algorithm, how to connect the points to faces (polygons
e.g. triangels or rectangles) we can try to write a simple script for this...

so long
MUFTI
--
Eine Unter-Speisekarte wird erscheinen, in der Sie waehlen koennen,
entweder zu spielen, oder das Video zu schlingen.
(aus einem Software-Handbuch, Stichworte: menu und loop)
Canopus

2004-09-01, 11:17 pm

Joerg Scheurich aka MUFTI <rusmufti@helpdesk.rus.uni-stuttgart.de> wrote in message news:<ch0584$rnv$3@infosun2.rus.uni-stuttgart.de>...
> If you would tell the algorithm, how to connect the points to faces (polygons
> e.g. triangels or rectangles) we can try to write a simple script for this...


Mufti -

I am continuing my search for some freeware-shareware low cost
software that would convert cloud points defining simple surfaces into
VRML IndexFaceSets or Wavefront obj files.

I was unable to locate any algorithms on the web, except for the
following high-mathematical skill level materials regarding "Delaunay
triangulation" from the FAQ for the comp.graphics.algorithms usenet
group, reproduced below. See in particular:

http://www.cse.ohio-state.edu/~tamaldey/cocone.html

which contains a link to request C++ code developed to convert medical
MRI images into 3d indexed face sets.

I am thinking about an easy but inefficient psuedo-code algorithm to
construct a surface from cloud points for simple convex and concave
surfaces where the data is stratified into parallel z-plane strips at
uniform intervals. Each x and each y coordinate is unique and the
limits are 250 input points. This would not work where the shape
defined by the cloud points is complex, that is the surface folds over
onto itself in z space, such that there are more than one z-point for
each x,y coordinate.

I'll get back to you when I written something up. Basically,

1) start with a default, predefined 500 x 500 triangular mesh or
square mesh vertix matrix (an array of coordinate indices 0 to 24999
with the faces sets predefined) - essentially a flat 2D square or
triangular mesh whose sides have a length of 1x1 units.

2) Read and sort the x,y,z cloud point data by ascending x and
ascending y.

3) Sort x,y,z by ascending x,y. Assign a topological index to each
point relative to the minimum y, median x point. An example - the
third point to the right of minimum y, median x is the second point
above the minimum x, median y point.

4) Topologically, map the x,y,z points into the default vertex space,
using the topological index points, starting with the minimum y,
median x point. Pick a starting point near the middle of the vertix
matrix so when mapped, the x,y,z will not exceed the bounds of the
topological matrix.

5) Pair off unused faces from the default vertex space. Any point is
that not mapped from the x,y,z input points, can be dropped, along
with any associated faces.
a) An even or odd number of points can always be made into
trangular mesh.
b) An even number of points can always be made into square mesh.
c) An odd number of points can be made into square mesh plus one
triangle.

6) Renumber the vertices (the coordinate indices) and their
corresponding face sets - 0 to N_(x,y,z)

7) Write the face sets index and x,y,z coordinates to VRML format.

8) Write the face sets index and x,y,z coordinates to OBJ format.

Hope this makes sense and will work. This is tough area and is
probably beyond my scripting and math abilities.

- Kurt

=================================================
http://www.faqs.org/faqs/graphics/algorithms-faq/

--------------------------------------------
Subject 5.23: How can a 3D surface be reconstructed from a collection
of points?

This is a difficult problem. There are two main variants:
(1) when the points are organized into parallel slices through
the object; (2) when the points are unorganized.

For (1), see this survey:
D. Meyers, S. Skinner, K. Sloan. "Surfaces from Contours"
ACM Trans. Graph. 11(3) Jul 1992, 228--258.
http://www.acm.org/pubs/citations/j...-3/p228-meyers/
Code (NUAGES) is available at
http://www-sop.inria.fr/prisme/logiciel/nuages.html.en
ftp://ftp-sop.inria.fr/prisme/NUAGE...AGES_SRC.tar.gz

For (2), see this paper:
H. Hoppe, T. DeRose, T. Duchamp, J. McDonald, W. Stuetzle
"Surface reconstruction from unorganized points"
Proc. SIGGRAPH '92, 71--78.
and P. Kumar's collection of links at
http://members.tripod.com/~GeomWiz/www.sites.html
New code, Cocone, written with CGAL, based on recent work by
N. Amenta, S. Choi, T. K. Dey and N. Leekha:
http://www.cis.ohio-state.edu/~tamaldey/cocone.html

--------------------------------------------
md

2004-09-04, 4:19 am

> I am thinking about an easy but inefficient psuedo-code algorithm to
> construct a surface from cloud points for simple convex and concave
> surfaces where the data is stratified into parallel z-plane strips at
> uniform intervals. Each x and each y coordinate is unique and the
> limits are 250 input points. This would not work where the shape
> defined by the cloud points is complex, that is the surface folds over
> onto itself in z space, such that there are more than one z-point for
> each x,y coordinate.


hi,
if you want to get a convex object out of your set of points,
you can use a very simple algorithm O(n^4):
assume you have n points, then it should go like this:

for i=1 to n
for j=1 to n
for k=1 to n
take triangle i-j-k
for t=1 to n
check on which side of triangle ijk is point t
if all points t are on the same side then add triangle ijk to output



that's it. i think it should work.
bye
mdk
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews