I've spent awhile using the extrude tool to construct a mesh, but once problem I've noticed is that if I'm creating a shape with some kind of concavity and two parts of the mesh come back together, then there are two faces pointing into each other and each one has its own set of vertices. I've been consistently entering numbers when extruding so I know that the vertices are in exactly the same position, aside from a possible small amount of floating-point error.
I found this question about merging vertices to create a pyramid, but the answers on it are only applicable to creating pyramids and similar shapes, since they are about manually selecting one of the cube faces to collapse. My mesh likely has hundreds of these duplicated vertices and manually checking the entire mesh is not an option, so I either need to use a tool or get a Python script to automate the process. However, the Alt+M functionality in that question looks useful, since it seems to be able to merge arbitrary vertices.
How do I merge my vertices together? Is there some kind of Python script I can use? Is there a way I can iterate through all of the vertices, check if any two are equal in position, select them, perform the Alt+M functionality from Python, and repeat for all vertices? Since merging vertices would change the amount of vertices, the entire script would basically need run itself many times to merge all of the coinciding vertices, or somehow loop until it finds no coinciding vertices.
bpy.ops.mesh.remove_doubles()(which is the same operator that is called by the menu entry) or the equivalent of for bmeshbmesh.ops.remove_doubles(). – Robert Gützkow Sep 13 '19 at 22:28