# Removing superfluous vertices in a large mesh

I have a mesh for a procedurally generated maze, in which there are, due to overlapping walls, a large number of superfluous vertices along the walls and corners.

(Edit: Actually, the walls are all individual, slightly overlapping cuboids, so maybe I should try some boolean operation like union on them?)

(Edit2: See below for the .blend file)

Is there an easy way to remove all of these so that I am left only with the straight planes? I thought I could use something like limited dissolve or the Decimate modifier, but I can't get these options to work. (Not sure what I am doing wrong, but applying them either does nothing or causes the mesh to go out of shape).

Here is the .blend file: maze.blend

• There isn't an easy way to fix it after generation. This is much more easily done in the maze generation code. – JakeD Dec 5 '16 at 21:04
• @pycoder I am starting to think you are right. Do you have any information on how to do this? – mydoghasworms Dec 6 '16 at 6:07
• It will vary greatly depending on the code you have, but you should be looking into the bmesh module to build the geometry rather than duplicating a prebuilt object into different locations. If you don't want to bother with bmesh, try from_py_data() – JakeD Dec 6 '16 at 12:33
• @pycoder Well, I actually generated the data for the maze as a .obj file from Ruby using the data for a maze, then imported the .obj into Blender. So I have been trying to figure out how to 'walk' the maze to produce the walls without overlaps. Is there perhaps an algorithm to do this? – mydoghasworms Dec 6 '16 at 14:36
• There are a ton of ways to do this; I built an advanced maze generator for Blender a while back, but I can't share code because of licensing issues. It shouldn't be too difficult to figure out though...try "fixing" it by hand, and I think you'll get the point of what you should be trying to accomplish. – JakeD Dec 6 '16 at 15:10

I have tried to mimic your scene and this worked quite well for me... so maybe it is worth to try:

EDIT: It looks like this method works only for a simple model like in my example, if it is more complex scene, you need to divide it into smaller parts otherwise the Remesh modifier does not reconstruct the model properly.

1. Join all blocks into one mesh
2. Add Remesh modifier, untick Remove Disconnected Pieces and play with the Octree Depth to get the initial shapes
3. Add Decimate modifier - planar
4. Apply modifiers

Then just apply that last modifier (the gif was too big to upload so I had to cut it there).

The result should look like this:

• Thanks for the answer, but I didn't manage to come right following these steps. I have added the .blend file to my question. Would you care to have a look? – mydoghasworms Dec 6 '16 at 5:01
• Scratch that, I missed where you said to play with the Octree depth. I did get my shape back, but the first time it caused Blender to hang and I did not have Remove Disconnected Pieces unticked. Now it seems better, but it takes a long long time on my computer. – mydoghasworms Dec 6 '16 at 5:11
• So, after the remesh, I go from having 968 verts and 726 faces to having over 200,000 of each. I'm not sure this is going to help me. As @pycoder says, it may be better to try and calculate the faces and verts correctly during the generation. – mydoghasworms Dec 6 '16 at 5:25
• I can confirm that it is not working with your scene, it looks like it is too comples for the remesh modifier (you can split it into several parts of course but then it starts to be more manual work). Maybe you could try to use Solidify, check Only rim and decrease Thickness to get planes only, then remove doubles, Decimate Planar and Extrude faces back. But this won't give you the exact dimensions. But still I am sure someone finds the a solution :) – Jan Kadeřábek Dec 6 '16 at 10:13
• You would have much more success with this method if you disable "remove disconnected pieces" on the remesh modifier. Still it is probably too complicated for this maze. – JakeD Dec 6 '16 at 15:15

## 2.8x

• Join all objects (Ctrl+J), in edit mode (Tab) select all vertices except top rim and delete them (X)
• enable addon TinyCAD and with all vertices selected press (W) > Tiny CAD > XALL Intersect Selected Edges
• remove doubles by Merge by Distance (Alt+M), Delete (X) > Limited Disolve
• Fill (F), select and Delete (X) the biggest face
• add Solidify Modifier > Thickness 1.5