Building an accurate terrain - mesh

Hi everyone,

I’m trying to figure out how to build the most accurate terrainmesh in rhino, in order to make a mesh where I can get “correct” (precise) spot-coordinates as well as fall lines on a mesh.

In my test I’m starting out with a survey with meassured curves and the points from the real world. The survey meassured curves along the boundary of the area or a building that cannot be moved, as well as specific points. and from there we define the new important fall lines using points and curves.

In the test I’ve been using these plugins: Lands, bison and Land-kit, as well as pufferfish. (just for the script to work for everyone) as well as the default delaunay in GH.

Modelling terrains in rhino can be a bit tricky balancing between “exact” and “something that looks right”
This is also an open discussing on how precise you guys build your terrain in order for it to work with for example flow lines of the rain water?

As input i’m using the 3D curves and the 3D points from the survey.

In bison I tried to use the “standard” procedure, without dividing the curves into points pr xx meter. Only letting Bison use the 3D curves and the 3D points.

billede

And as a second procedure, i’m dividing the curves into points pr xx meter, and I use the controlpoints (kinks) of the curves + the 3D points. This one is used for all of the four methods: LAnd_kit, Delaunay, Lands and Bison.

billede

It looks like Land_kit, Delaunay and Bison are using a similiar method to build the mesh, but Lands is making the terrain become less precise by using “quad-triangles” (don’t know the exact word) instead of triangles,

Lands - “Quad-triangles”
billede

Delaunay, Land_Kit and Bison:

I can see why its smart to create a quad-triangled terrain, to the make the mesh easier to split as well as creating a more natural landscape, but it would be nice if the terrain follows the survey more directly, especially in projects where there’s a building inside the project area.

In Lands there’s a restriction of 0.5m for the gridsize of the “quads”, but is it possible to make this more strict? Or somehow make some curves more important than others?

billede

I think this is what Land_kit is trying to do by letting the user add different objects such as breaklines into the “mesh-builder”:

billede

billede

Another more general question is how much I need to divide the curves in order to get a precise terrainmesh that I can trust? Any good experiences to share? I normaly use 0.5m, but this gives a quite “complex” mesh to work with. In the GH I tested with 2m.

Especially if I want to divide the terrainmesh into roads, path etc. This gets tricky with a mesh, when its too that precise. I guess rhino is having a hard time splitting the mesh.
But this is where the Lands terrain is doing really good. It’s easy to divide, but the Lands mesh is not strict enough to follow the survey points and curves. The transformation from triangles to “quad-triangles” makes it not as precise.

I hope some of you wants to discuss this in an open discussion :slight_smile:
There’s probably a lot of things that I miss on the way, in order to understand the “mesh-building” possiblities and limits.

I’ve attached my testmodel both Rhino and GH. I hope it’s easy to understand what’s happening inside GH. In the Gh I use contours, a projected point and a fall line in order to check the meshes.

test-survey_m.3dm (1.2 MB)
MESH-testing-landscape.gh (152.8 KB)

Cheers,
Thomas

About what you call “Lands quad-triangles”, Lands call it gridded surface, and it is optional.

The Lands terrain is generated by performing a Delaunay triangulation. You can take it as is, or let Lands create a gridded surface shaped to the triangulation. This way you’ll have a DEM-like terrain, where all points have predictable X-Y coordinates, so that the relevant are the Z values.

Once you have the gridded surface you can control the cell size and the smooth factor. Playing with these values you can control how accurate the gridded surface is to the source data, accepting that it is never 100% accurate because of its nature (points in a grid).

You can also simplify it, so that neighboring cells that are all in a planar area can be merged into “supercells”, recursively. This allows you to have less vertices but almost the same shape. Less vertices means less RAM/disk consumption, faster elevation to terrain, etc. The simplify tolerance is the maximum separation (expressed as a % of the cell size) tolered between a point and the common plane to merge it.

Finally you can use the gridded surface to model the cut&fills and paths, instead of apply boolean operations (that tend to fail too often). It is a bit like modeling with voxels.

Hope this helps.

Hi Albert

Thank you so much for your reply,

Ahh ! That’s a better name :slight_smile:

I understand why the gridded surface is smart in many ways, but I also see a challenge according to a precise documentation. My hope / goal is to do as much of the model in 3D, and from there extract the needed documentation.

I now tried to set the tolerance and the Smotheness to 0.01.

But the result of the mesh is still not precise enough to be used for documentation. On most of our projects, we work with quite small falls on the roads as well as path for the traverse-fall. eg. In Denmark 25‰ as a traverse fall is the maximum allowed for disabled people walking on a path going up to a building. Yeah…Denmark is a flat country :smiley: (and of course this is not always possible) But this is why the precision is important, and why I’m trying to find the best way to work with the mesh.

I did a section with the delaunay (red) and the Lands-gridded surface (green) (with the above numbers) and it would be super nice if I could “restrict” the lands-gridded surface to follow the specific survey curves and points. I know this is never gonna reflect the natural world, but at least the mesh is constrained to the drawing elements (incl. the survey)

But do you think the gridded surface can do this, or is the delaunay a better option?

The Land4 plugin in Archicad is working with a similar solution and it looks like some kind of delaunay. They manage to work with both points and curves as restrictions for the mesh. It would be super cool if we can get this into rhino and lands.

Working with points:

Working with curves:
https://www.support.land4cad.com/knowledge-base-land4-for-archicad/create-ridge-lines/¨

But the Land_kit - Topo_kit guys are also doing a similar thing and it looks like they managed to work with divisions of the mesh as well, what I think is the “area”-feature. I haven’t tried the “Area” feature as I don’t have the PRO version.

https://www.landkit.design/topo-kit

But using their free version gives this:


billede

But in GH I cannot find the delaunay-option from the lands component? I can only find it in Rhino.
billede

I mainly work with the terrain in GH as its super nice to work with it “live”, but it would be nice to have the ability to choose delaunay in GH.

And also when I use the Landsterrain (delaunay) in rhino, the mesh is getting too simple and is not following the survey (the curves, green and purple)

It would be super nice if the lands terrain component gives the ability to work with the delaunay settings as well. The division of curves pr x meter, the kinks of the curves, breaklines e.g.

I know this is a quite precise modelling method, but I hope it all make sense,
I more than happy to contribute to whatever is needed.

1 Like

Hi Thomas,
Many thanks for all detailed explanation. We are working on implementing a “Constrained Delaunay Triangulation algorithm”. That would solve the precision issues you mentioned here. Will inform you when we release a new version with improvements in this field.
Please keep contacting us for further issues you find out.

1 Like

Hi Elham

Thank you too! This sounds super nice. Looking forward to test it out :slight_smile:

And yeah for sure, I’ll keep you updated on further issues that I might run into. :wink:

1 Like

Hi @elham

Any news on this topic? :slight_smile:
I know its a bit old, but I’ll give it a go here again, as my comment follows the same topic.

In the meantime I’ve been looking a bit more into it, and with a simple terrain task, civil3D is doing a super good job, drawing triangles between the curves / control points.

Whereas delaunay are drawing triangles between the closest points.

Red lines are contours:
Blue: a line to show where the triangle should be :slight_smile:
Green the delauney triangles

Here are some results:

GH+lands design:

Landkit:

Delayney: (same result as landkit)

Civil3D:

But I have no idea how Civil3D is calculating this. Somehow the contours are more strict to follow

But do you think there a way to do this in rhino+gh?

Dividing the curves per 0.5m gives a better result in GH (using landkit or delauney), but then its way to complicated I would say:

Cheers,

No news about this yet.

The standard Delaunay triangulation algorithm has just single points as input data. It knows nothing about how these points were originally connected, and it just tries to triangulate them minimizing the resulting edges length. This is why closer points are most likely being connected, and this is why dividing the curves gave you a better result in GH.

I guess Civil 3D uses some variant of the triangulation algorithm that forces it to connect vertices that were originally connected. We plan to implement our own “constrained Delaunay triangulation algorithm” some day. We also plan to add options to control how continuous input curves are sampled prior to triangulate the samples (by number of samples, by distance, by deviation, etc.). In the meanwhile you can apply your knowledge on how the triangulation works to fine tune the input data, for example by adding new elevation points or dividing lines into smaller segments (as a temporary workaround, of course).

1 Like

HI Albert

Thank you for your fast reply,
This sounds super interesting. looking forward to that “one day” :slight_smile:

I’ll try to figure out how civil3D is doing it, in order to create an accurate terrain in rhino.
I’ll report back if I get some good results.

Keep in touch,
Thomas

Hi Albert

I asked ChatGPT about this :slight_smile:
But I might not be asking the right questions…Because I can’t figure out what is the difference between the two.

"In Civil 3D, when creating a surface from contour lines, the software typically still uses Delaunay triangulation to generate the TIN (Triangulated Irregular Network) surface. However, the process involves some additional steps to handle the contour lines effectively:

### Steps to Create a TIN Surface from Contours in Civil 3D

1. Import Contour Data

    • Import your contour data into Civil 3D. This can be in the form of polylines representing contour lines, often from DWG, DXF, or other compatible formats.*

2. Create a Surface

    • In the Prospector tab, right-click on Surfaces and select Create Surface.*
    • Choose TIN Surface as the surface type, and provide a name for the surface.*

3. Add Contours to the Surface

    • Expand the new surface in the Prospector tab.*
    • Right-click Definition and select Contours, then Add.*
    • Select the contour polylines you imported.*

### Handling Contour Data

When Civil 3D uses contour lines to create a TIN surface, it follows these steps:

1. Contour Interpolation: Civil 3D interprets the elevation data from the contour lines. Each contour line represents a specific elevation level.

2. Generate Intermediate Points: Civil 3D generates points along the contour lines and can also interpolate points between contours if necessary to create a more accurate surface. The density of these points can be controlled to some extent by the settings during surface creation.

3. Breaklines Creation: Contour lines are treated as breaklines. Breaklines force the TIN to honor the contour lines strictly, ensuring that no triangles cross the contour lines, thus preserving the integrity of the elevation data.

4. Delaunay Triangulation: After generating points from the contour lines and breaklines, Civil 3D applies the Delaunay triangulation algorithm to create the TIN surface. The Delaunay method ensures that the triangles formed are as equiangular as possible, avoiding long, thin triangles which can lead to inaccuracies.

### Contour-Based Surface Creation Process in Detail

1. Data Import:

    • Use Insert > Import to bring in your contour line data.*

2. Surface Creation:

    • Open the Prospector tab in the Toolspace.*
    • Right-click on Surfaces and select Create Surface.*
    • Choose TIN Surface, name the surface, and set the necessary parameters.*

3. Add Contour Data:

    • Right-click on Contours under the surface definition and select Add.*
    • Select the contour polylines from your drawing.*

4. Surface Definition and Editing:

    • Civil 3D will create points along the contour lines and treat these lines as breaklines.*
    • The software then uses these points and breaklines to perform Delaunay triangulation, creating a TIN that respects the contour lines.*

5. Refinement and Analysis:

    • After creating the surface, you can refine it by adding more data points or additional breaklines if needed.*
    • Use Civil 3D’s analysis tools to generate contours, perform slope analysis, and conduct volume calculations.*

### Considerations

- Contour Spacing: Ensure that contour lines are appropriately spaced for the level of detail required. Closer contours provide more detailed surface but require more processing power.
- Breakline Management: Properly manage breaklines to avoid surface anomalies. Ensure that contour lines are accurately represented and do not intersect improperly.

### Conclusion

Even when using contour lines to build a surface in Civil 3D, the underlying triangulation method remains Delaunay triangulation. This method is robust and ensures that the resulting TIN surface accurately represents the terrain by honoring the contour lines and generating a network of triangles that appropriately model the surface. By following these steps, you can create accurate and reliable terrain models from contour data in Civil 3D."

I tried this dividing method now:

simple-accurate-mesh-delaunay.gh (8.3 KB)

Will get back on more complex terrains as this one is very simple :slight_smile:
But this one does the same as civil3d, using the kink-points

I think its still good using Landkits workflow template:
simple-accurate-mesh-delaunay-morecomplex.gh (10.5 KB)

You can also try the TerrainMesh plugin that I made, you can find it on packagemanager.
It makes a terrain from input curves and points, no matter how messy they are. Good for simple stuff and quickly finding bad overlaps.

It runs as a command, I have a gh version of it too, but it hasn’t been released yet.
If you find the tool useful then please shout out and I’ll try to push out the gh version as soon as possible if that would be better for your use.

2 Likes

Hi Holo,

Thank you so much for your script. This is interesting too.
I’ll have a look at it and get back to you.
I do like that ability to use GH to work dynamically with the design :slight_smile:

I love this tool and use it all the time for making both large and small terrains! A grasshopper version would be excellent and really useful.

2 Likes