PDA

View Full Version : converting ASCCII text file in 3D, how ?



lasco
12-22-2003, 05:42 AM
Hi people,

I've got a text file (ASCCII) of xyz coordinates of
points of an existing terrain for a landscape modelisation with LW.

Big trouble is how can I convert this file in 3D ?
I know that Autocad can do this but haven't it and will not
since anyway it does not run on my OS (Mac OS X).

Any solution, any Lscript possible for this ?

PS : here what the file looks like when I open
it with Text edit

1 306914.26 253852.66 7.58

2 307290.26 253928.42 8.88

3 308325.50 253807.86 7.12

4 307848.86 253375.31 7.89

5 308138.60 253474.01 7.74

6 308336.03 253595.82 7.69

7 308328.08 253683.48 7.78

8 308307.54 253572.05 7.54

9 308282.86 253588.98 7.33

10 308014.23 253478.88 12.44

11 307726.65 253555.34 8.48

…and there are around 35 thousands points like this,
any script possible ?
thanx by advance

meshmaster
12-22-2003, 07:24 AM
It looks like you may be able to convert it in to a vrml indexfaceset by hand coding pretty easily... buy you need to know vrml first... http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=vrml+learn gives you a google search for it... it's sort of like an advanced form of html that works with 3d... and you can manually edit it just like html. It was originally meant as a 3d on the web format, but has since then became sort of a least common denominator 3d format that can be moved around between different programs....

meshmaster
12-22-2003, 07:26 AM
http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=indexfaceset+vrml

http://www.comp.leeds.ac.uk/stu/VRMLtutorial/

If you are in layout and do Export scene as vrml97, it'll get you a wrl file... open that in a text editor and play around with it, reopenning it in lightwave... after you fiddle around with it some, you should be able to figure out the format pretty easily, and then should be able to figure out how to manually edit the file that you have in to a vrml .wrl - it'll take some tinkering, but not too much if you already have a list of points....

lasco
12-22-2003, 07:49 AM
yep,
I also thought about some VRML solution but
have to say I never tried much to play with this format.

thanx for the links I'm going to see if there's a way I can
edit some VRML model like you say, in "html like"…

nixx
12-22-2003, 01:58 PM
hi lasco,

it shouldn't be too hard to make an importer in Lscript for you, but you 'd only end up with a point cloud, no polygons to connect them (it would take a lot more work to get that). But maybe then you might be able to use the free "points2polys" utility (http://www.paraform.com/ppdl/index.html) to "skin" that point cloud. Check it out and let me know if I can help.

nick

lasco
12-22-2003, 02:13 PM
Hi Nick,
thanx for your reply.

I know I will get only points and not polys but it's not really a trouble as
I anyway prefer to built the mesh myself and know that for this I will maybe
not use more than 10% of the points of this file because there are in this "space" (a very large urban scene) hundreds of points absolutely unusefull.
I've already modeled a part of the scene actually and just would like to check
some coordinates, see if everything is correct etc. but looking for a script that would automatically convert this into polys is already much more than what I'm looking for. Such meshes really need to be made handly anyway…
I know quite well the shape of this "cloud" you're talking about so
I know I will be able to see quickly what is or is not important in the model.
Well if you don't mind I enclose here the file (a .doc .zipped…),
openable with MS Word or Notepad…
If you can do anything with it it's perfect but don't waste any time if you meet
any trouble (I'm actually aware of something about the spaces between characters that could not be regular enough and could then cause issues in
the understanding of a script…)

Definitely I must admit such a script could help me in the future as I know I
should meet such files again…

nixx
12-22-2003, 03:29 PM
Hi again lasco,

Try this and let me know how it goes :

http://users.otenet.gr/~nixx/pointcloud.zip

it handles ascii files of the same kind and structure as the one you gave me for reference.

I hope it helps, let me know !

nick

lasco
12-23-2003, 01:11 AM
Hi nixx,
thanx for your help… I've just a little issue : the script does'tn run.
the command Construct > additional > Lscript does'nt work
and the command Construct > additional > Lscript/RT sends me
a message saying a newer version of Lscript is needed
(I work with LW 7.5 because 7.5b and c causes issues on my OS)

nixx
12-23-2003, 01:53 AM
D'oh ! You should have told me you were using 7.5a ! Hold on, I 'll have it ready for you and re-post it here.

nick

nixx
12-23-2003, 02:38 AM
There, this should work now. Sorry about that :)

http://users.otenet.gr/~nixx/pointcloud75.zip

nick

lasco
12-23-2003, 03:02 AM
damn' you're a king man that's incredible :)

now I can tell you the truth : this morning the guy
who had send me the asccii file eventually send me a DXF
file with the points. But as I knew I will meet the same issue
in other future projects I still was interested by your script…

This also shows that the result is fantastic, thanx !

(the only strange thing is that Y values are negative : - 8 meter instead of +8,
-10 instead of + 10 etc. however this is maybe due to the source text file
and anyway I just mirrored the point cloud to get everything correct).

thousands thanx and congrats for this nick

;)

nixx
12-23-2003, 03:43 AM
Originally posted by lasco
damn' you're a king man that's incredible :)

now I can tell you the truth : this morning the guy
who had send me the asccii file eventually send me a DXF
file with the points. But as I knew I will meet the same issue
in other future projects I still was interested by your script…
Haha ! You could have told me anyway, I would still do it for you man :)


This also shows that the result is fantastic, thanx !

(the only strange thing is that Y values are negative : - 8 meter instead of +8,
-10 instead of + 10 etc. however this is maybe due to the source text file
and anyway I just mirrored the point cloud to get everything correct).

thousands thanx and congrats for this nick

;)

I 'm glad I could help. Let me know if you need anything else, i.e. if you need some other functionality from the script, etc. Sorry about the version mixup, too.

nick

lasco
12-23-2003, 05:02 AM
Let me know if you need anything else, i.e. if you need some other functionality from the script, etc.


For the moment it's perfect,
though I guess the issue I could have in the future would
probably depend on the formating of the source texte file.
Here you did the script for a .txt while I had a .doc, it worked anyway
but I know there are often troubles with encrypting of characters
in ASCCII datas, especially when crossing platforms (Windows / DOS on one hand,
Mac / UNIX on the other). Or another issue maybe could come from
the way the text is exactly setted (if for example the ID of points was not 1, 2, 3… but A, B, C or whatever else…). Well I'm not sure of that but guess
it's most of time the kind of stupid troubles we take hours to solve…

PS : Man you should put your script on Flay.com,
it would be very usefull for every people working in urban/landscape
domain as nowadays (in France at least) such database are most of time
the only thing you get when you start modeling a terrain.

nixx
12-23-2003, 05:11 AM
Originally posted by lasco
For the moment it's perfect,
though I guess the issue I could have in the future would
probably depend on the formating of the source texte file.
Here you did the script for a .txt while I had a .doc, it worked anyway
but I know there are often troubles with encrypting of characters
in ASCCII datas, especially when crossing platforms (Windows / DOS on one hand,
Mac / UNIX on the other). Or another issue maybe could come from
the way the text is exactly setted (if for example the ID of points was not 1, 2, 3… but A, B, C or whatever else…). Well I'm not sure of that but guess
it's most of time the kind of stupid troubles we take hours to solve…
Different IDs of points would make no difference, the script ignores the first entry and only uses the X,Y,Z data for each one.
However, if you ever come across different formatting, etc. just let me know and I 'll modify it to suit that. Or, if you already know the different types of ascii files you 're likely to come across, give me some samples now (even fake ones, as long as the formatting is correct) and I 'll modify it to handle those as well.


PS : Man you should put your script on Flay.com,
it would be very usefull for every people working in urban/landscape
domain as nowadays (in France at least) such database are most of time
the only thing you get when you start modeling a terrain.
Ah, I don't know about Flay, its functionality is too basic (the script's, not Flay's, hehe)... Maybe if it evolves into something more complete... :) However, please feel free to share it with anyone who might find it useful, even as it is now.

nick

lasco
12-23-2003, 05:24 AM
Different IDs of points would make no difference, the script ignores the first entry and only uses the X,Y,Z data for each one.
well that's good news (just I will have to care if one day someone give not
XYZ but YXZ for instance, I think it's something that happens sometimes…



However, if you ever come across different formatting, etc. just let me know and I 'll modify it to suit that. Or, if you already know the different types of ascii files you 're likely to come across, give me some samples now
Impossible to know now.
You see these tools are quite new for cities administrations here,
they sometimes just give you plans and don't even know they also have such
files so depending on their tools, their knowledge etc. I can't know now
what kind of files I'll get in the future… mostly similar to this one I hope.



Ah, I don't know about Flay, its functionality is too basic (the script's, not Flay's, hehe)...

basic ? the boxe tool of the Modeler is basic too…
the main is not basic or not basic I guess but that it works
(while several scripts on Flay does not), and don't forget that
even if it's very simple for you many LW users (like me) did not even opened
once the script compiler and will never do…