I thought about a "merge segments" function, but I realize it would lead to a chain reaction of sorts - if you fuse two cubes, you'd also need to fuse all cubes adjacent to them, because otherwise they couldn't be connected. Would it be exceedingly difficult to implement a function that checks the entire mine and automatically minimizes the cube count utilized in such a manner that the geometry is completely preserved? In practice it could sometimes of course involve a complete rebuilding of certain areas with more cube-efficient structures, but the restriction that no geometry of the level can be altered in the slightest could prevent it from messing up someone's work.
If that's too difficult to implement (which I would imagine it is), even a simple "merge segments" function would help a ton too, to allow for a simpler method of manual cube count optimization. Of course it would only be applicable if the merged segments had a total of eight points and 12 vertices, for obvious reasons.
Cube optimization requires an algorithm I don't currently have, except for trivial cases which occur rarely outside of bad levels. It might be possible but I'm not sure it's not NP-hard, and need to do research so it's not a near-term goal.
I can implement a manual "merge the selected and other cube into one" function though. It would only work if they were currently joined, and would have to detach the cubes from surrounding other cubes to avoid corrupting their geometry, but would at least let you do this manually. It would also have other applications such as reducing the number of cubes in a tunnel, though you'd have to realign the textures afterwards in that case.
Completed the manual version of this function for next version. In a separate conversation Xfing confirmed that was an acceptable solution.