Dylancyclone / VMF2OBJ

Convert source-engine VMF files into OBJ files with materials (including brushes, displacements, entities, and models)
MIT License
113 stars 6 forks source link

Collapse *almost* duplicate vertices #3

Closed Dylancyclone closed 2 years ago

Dylancyclone commented 4 years ago

Similar to #1 and #2, but with a margin of error. The program already merges vertices if they are exact duplicates of each other, but for more complicated geometry there could be rounding errors that make the vertices technically slightly different, but effectively the same. It would be a good optimization and improvement if the extra vertices were merged together. The struggle with this is making sure any faces that use the collapsed vertex texture are redirected to the one that was kept.

TheBlizWiz commented 4 years ago

It might be useful to do a Merge by Distance operation and then set the tolerance to as large as it would need to be to merge all of the almost exact vertexes. You'd have to be careful that a prop isn't going to merge with a brush face, though.