Create a grid mesh from text file
Hi,
In France IGN give for free some .asc files.
https://geoservices.ign.fr/documentation/diffusion/telechargement-donnee...
This is simple .asc files like :
ncols 3
nrows 5
xllcorner 849997.500000000000
yllcorner 6360002.500000000000
cellsize 5.000000000000
NODATA_value -99999.00
133.00 134.00 135.00
133.00 134.00 135.00
133.00 134.00 135.00
133.00 134.00 135.00
133.00 134.00 135.00
Values are separated by spaces.
In reality, ncols =1000 and nrows=1000
(xcorner, ycorner) is the position of the first point (origine).
So I would like to create a mesh grid :
read first line, first value, create a vertex ( or place first vertex of the grid ) at origine with z=first value
read first line, second value, create a vertex ( or place second vertex of the grid ) at origine + cell size with z=second value
(...)
Same for each line.
As there is a lot of data, I would like to be able to skip some values : ncol divided by a value. Same for nrows.
As 3dsmax don't like very big model, I would like to be able to "move" origine value.
I made an ugly UI to give an idea.
Thanks. I think it could help a few people.
Next step is a batch importer, as there can be a lot of files... ;-)
Attachment | Size |
---|---|
request1.jpg | 91.31 KB |
Comments
.
Thanks again ! Just to say,
Thanks again ! Just to say, mesh was inverted in y axis, I corrected it !
.
You made it. Congratulations! ;)
WAW !!! Thank you soooo much
WAW !!! Thank you soooo much Jahman !
Works at lightspeed, and yours is working ( mine was repeatiting same row of values )
I can open all files now, and now I'm going to try ( ah ah ) to make the script more usable for my work.