If you're colliding against tiled squares, why not just skip the marching squares+separating axis, and use the tile map directly as your collision data structure?
The character is a line. I have to do polygon collision.
Lines can do tilemap collision. You just 'raster' the line onto the tilemap, using an algorithm that touches all the tiles the line touches.
The issue here is toe-stubbing. If there's breaks in a surface then that may lead to the line getting buried between two polygons as separating axis tries to shove it to the nearest edge.
Which was why I went down this road, because that's what was happening.
Hmm, another solution is to do something smarter when finding the 'nearest edge'? It sounds like you're saying you have two adjacent rectangles, and you find as your nearest edge the shared edge between the two? Some extra special-case code should be able to pretty easily recognize when this is happening, and use a different nearby edge in this case ....
So it's actually a specialised form of packing really - What I actually need are unbroken surfaces.
What do you mean exactly by 'unbroken' surfaces? Unless I'm misunderstanding the term, wouldn't this requirement make convex decomposition impossible?