# How can I remove doubles without creating intersections?

I've got a mesh of a terrain. I'd like to create a simpler version that follows roughly the same shape. I've been using Remove Doubles to do this (which gives me a better result than the Decimate modifier), but have noticed that it can create intersections in the mesh, which causes me problems later on, particularly when using the Boolean modifier.

Original mesh:

When removing doubles (red areas are intersecting faces):

What's the best way to remove these intersections after removing the doubles (or preventing them from happening)? I'm scripting this process, so would love to hear of any solution that doesn't involve manually selecting visible/invisible faces. Thanks!

Edit: Here's the Blend file in case anyone is interested.

• I don't think Remove Doubles is good option for simplifying a mesh (though it can sort of do that but you can't control the simplification); generally in order to do what you describe in first 2 sentences you'd use Shrinkwrap modifier to create a second, roughly the same but simpler mesh. Though I can't say that's a scriptable solution. – Mr Zak Mar 29 '16 at 15:56
• Did you try selecting similar > face angles? – Georges Mar 29 '16 at 17:20
• @Mr Zak – thanks. I'd be happy to try an alternative method to Remove Doubles. I'll look into the Shrinkwrap (which I think should be scriptable, via bpy.ops), but haven't had much success with it so far. – user2950747 Mar 29 '16 at 17:32

The mesh cleanup tools can help with this, especially limited dissolve.

Select all mesh elements in edit mode, then go to the Mesh --> Cleanup --> Limited Dissolve tool. Then triangulate all faces with CtrlT.

The larger the angle, the stronger the effect.

One of the methods I use to simplify the mesh is Selecting Similar:

1. Go to Edit Mode.
2. Choose to work with edges (CtrlTab).
3. Select an edge.
4. Go to Select menu in 3D View > Select Similar > Face Angles.
5. Click X > Dissolve Edges.
6. Repeat this process with Edges with different angles until you get the result you want.

The success of this method depends on the nature of the mesh and the edge you select, Blender will select the edges that have similar angles in between the two neighboring faces, dissolving the Edges will remove the Edges non destructively, so it will not create holes.

Hope this works for you.

• Thanks for this approach. However I don't think this is scriptable, given the need to select the right edge... – user2950747 Mar 29 '16 at 17:34
• You are right it's not, I don't code, so I can't tell you how to right the script, only if you can set a range of angles "by coding" to select the edges, then selecting similar face angles, but I'm just conceptualizing here. – Georges Mar 29 '16 at 17:41