Terrain Conformer

12 votes
Version: 
1.1
Date Updated: 
12/04/2012

This script conforms a terrain surface to a road in just a few click. It's very easy to use.

Additional Info: 

1- Create a road and a terrain as an editable_poly.
The objects must not have any thikness. (Very important!)
To conform smoothly, the terrain must have enough subdivision.
Also, you will get a better result if you build the road near the terrain
otherwise it can produce some distortion on the topology.

2- Launch the script, pick the road, pick the terrain,
choose the distance of the blending (smoothness of the slope),
click the button "Conform terrain" and wait a few seconds...

3- If you don't the result, click "undo conform",
then move, rotate or scale what you want and click again "Conform terrain"...

---------------------------------------------------------------------------------

The road does not change at all.
Only the terrain is conformed right under the road
but, outside the road, it keeps the original relief.

The terrain is conformed to the road only on the Z-axis,
it's not doing anything along the other axis X or Y.

A important thing :
The original objects are not deleted, just hidden.

Version 1.1:
Correction of an offset that appeared in certain cases.
The script works now in world coordinate system and respects
the initial position of the objects.
The spinner indicates the actual system units.

---------------------------------------------------------------------------------
---------------------------------------------------------------------------------

If you have any suggestions, feel free to post comments !

Look at the video demo on youtube ! (there is no sound)

Version Requirement: 
2010, 2011, 2012, 2013
Video URL: 
AttachmentSize
terrain_conformer.mse3.75 KB
terrain_conformer1.1.mse4.59 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
souzagiovanne's picture

Thank you so much!

I can not imagine any more without this script! My workflow has improved considerably. I use it in many ways, almost all the time. I import the contours of AutoCAD, I use the plugin Populate Terrain to create the terrain. After that, I import the poly lines in .dwg, from the streets, sidewalks, blocks ... and I transform into faces, subdivide the mesh with Populate, and then conform all those elements in the terrain using that script. It gets accurate, and very quick to be done. For example, I can model a whole residential condominium in a matter of minutes. Thank you so much!

LittleLordPotala's picture

Thank you trixian,

As I said previously, I've decided to not expose the pivot option because it's now became completely unnecessary. I'm also happy that it works fine for you.

trixian's picture

Hmm. Looking closer there are

Hmm. Looking closer there are a few issues where the script is "deforming" the road in strange ways, like sudden peaks sticking up, and smaller patches where the terrain is "warped" and not conforming to the road. The latter could be because of the topology of the mesh maybe. (I selected all faces under and adjacent to the road and meshsmoothed them, and relaxed them before running the script). Still better than nothing :)

Edit: Never mind the comment about the road. That was my fault. Still its ignoring and warping the terrain in small patches at random places.

trixian's picture

Fantastic

Works great so far. I can't see any new options as far as pivots go, but it is now conforming correctly, not moving the road and generally making me happy :)
Great Job

LittleLordPotala's picture

@trixian

I've published the new version and I've tested it on 2012 and 2013 version.
The problem with offset seems to be resolved on all my tests. But notice that I didn't make one thousand tests, I'm not 100% sure that it will work for everyone. So let me know if everything works for you. Thanks.

LittleLordPotala's picture

In fact, I'm currently trying

In fact, I'm currently trying to remove the offset for all the situations in a way that you will not have to care about the pivot point position but only the initial positions in the worldspace coordinates. So, the objects have to keep the exact same place as initialy. I think this way is more reliable than a pseudo-parameter for the pivot point...
Considering that you often have to deal with triangulated meshes, I totaly agree with you and encourages you to find a better and faster solution with some plug-ins for 3dsmax or sculpting softwares like ZBrush.

trixian's picture

The terrain is generated from

The terrain is generated from map data by our GIS guys. Triangulated meshes like this are a pain, but letting them generate a quad grid based mesh makes for an enormous waste of polys while still not capturing the "detail" of the topography. Sadly these Delauney triangulated meshes are the best we can get for this type of work, and the budget. The file you got is the main area, but when I was trying to conform, I had split off the east part from the west part and added some subdivisions to the areas under the road. That file got messy as I was getting progressively frustrated so I figured you'd be better off with the clean file.
What I sometimes fantasize about is bringing these terrains into Zbrush and using the new Qremesher topo-tools to get an adequate loop flow, then re-projecting the details onto it. The trick would be making this a very fast and painless procedure.

Anyway, looking forwards to try out the new version once its ready.
Will it still also offset the road object like now, or can you make it only offset the conformed terrain?

LittleLordPotala's picture

Explanation :

This strange offset happens because the script centers the pivot point before the calculation and that is not a good thing in all the cases. Your sample file demonstrates it.
Consequently, I have put the pivot to the minimum Z-axis and disabled the CenterPivot command in the script and it has resolved the problem.
The initial pivot position modifies the final result but with the actual version of the script, you cannot change that. So I will soon publish a new version where the CenterPivot will be optional.
After that, you will have to adjust correctly yourself the pivot point depending on your terrain and what you expect as result.
I don't know if you work on the terrain that you have sent, but (at least) I would recommend you do add more subdivision under the road if you expect a better result...
I would also say that this terrain has not a very good topology for 3dsmax and editable_poly. If you want to modify the geometry, it will be way better with quads than tris. The easiest way to do it, is by conforming a plane primitive on your terrain with the "conform modifier", the "conform space warp" or the one in the "free form tools".

trixian's picture

Strange offset problem

None of the objects have thickness no. I'll just zip the model into my DropBox public folder and link it here ok? Don't worry, its a clean file :)

https://dl.dropbox.com/u/11737977/Terrain-Conform-Issue.7z

LittleLordPotala's picture

Yes,

You could send one or two screenshots to show exactly this problem.
Just in case : does one of your objects have a thickness ? (because this is not supported by the script...)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.