.asc file topography

hello, i’ve got a asc file, for topography, how can i use it, it’s look like:

an idea

i’ve got the dxf too… level curves, but it’s really hard to script something for elevation…

This is an ESRI ASCII GRID file:


Here ya go…

ASCIIGridImporter.py (10.2 KB)

Tuto-Ascii_FR.pdf (782.8 KB)
Tuto-Ascii_EN.pdf (788.3 KB)


how has done it?

incredible!!! how can we do without you and the rhino community!!!

thank you so much!

This is just something I developed over a long time at the EPFL, we imported a lot of ASCII Grid files to create topographical models.

1 Like

Befor you sent me your script i was trying a script, but i didn’t find and now it doesn’t want to quit my brain…
i have level curves, and i said:

  1. I take the bigger(Z+0),
  2. I test all the other curve, if each points of this polycurve is in the bigger and no in the other this curve is the next level, i put it in a list Z+10.
    once it’s done, i make same thing with all Curve of Z+10…
    How do you script the second point?
    i search all the day but i didn’t find!

Umm, not quite understanding here - are you trying to classify your topo curves by their Z-level value?
(i.e. have a nested list of all curves by each level?)

One list for each level
Maybe I forgot to say one thing… all curves are on cplane…

Yes, that is a problem… If you are thinking about trying to use containment to determine levels from bottom to top, forget it - it doesn’t work. It would only be possible if the terrain is completely regular and doesn’t have any “islands”.

Topo curves must be considered as completely ambiguous if you don’t have some sort of height information per curve. So you will end up more or less manually putting them into 3D in most cases anyway. (if someone has found an automatic way, let me know!) I do some semi-automation using a vertical nudge or the scripted equivalent, but it still requires selecting the curves on each level.

Below is a file I used as a demo for my students. There are at least 4 different terrain models you can build with the same set of 2D topo curves.

AmbiguousTerrain.3dm (6.1 MB)

Once the curves are in 3D, then you actually have some real data.

Ok it’s right!!!
thank you!

but for know, is it possible to script this kind of loop?

i take the bigger,
i tast all the other curve: if is in this bigger but no in other, so i name it 1
next, i take the first of named 1, and same thing… etc etc etc…

Sure. The tool you need is called PlanarClosedCurveContainment.


The interesting part about this exercise is to imagine that you have a lot of curves. Because if on every loop you test all of the curves against each other, the number of tests goes up exponentially with the number of curves you have. So, it you want to be efficient, you need to invent a logic to remove the curves that have been determined to match whatever you are testing for from your list, so that as you continue to test, the list gets smaller and smaller to the end.

Ok thank you!!
maybe i’ll find the soution!


excuse me, but is it possible to make a loop on this script,to open a lot of file…
i received 139 files of 1000 rows by 1000 columns to open in one file.
do you think it’s possible?

It’s ok!! i found the code…

That’s going to be one big file - 139 million points…

yes but in fact i need maybe only 6 panels, but i don’t know how it is sorted, so i have to open all and choice what i need,
i think my work station is ok for it!