intrr wrote:No, you just have to read what I write
I have added "Auto-Merge" because I wanted to spare the step of "Remove Doubles" after scaling something down to 0 in one axis for merging vertices there. Got the point now?

Well if you scale down to 0 on one axis, its not as simple as merging vertices.. You could have overlapping polygons which would call for a check for intersection and retesselation of the object.. Take a icosphere (probably a poor example, maybe an asymmetric Monkey Head), scale it down to zero on some axis, I'm assuming there will be some overlapping polygons. Now what if some vertices directly overlap, wouldn't you have to take the union of the overlapping polygons and retesselate them so that
they don't occupy the same space (producing an ambiguous sort in the Z buffer comparison of the meshes, which looks like splittering wood in
a 16 bit Z buffer).
Another example, take two squares, take one and twist it around (so the left and right edges of the square make an X).. If you flatten the twisted against the regular square (assuming the vertices overlap), and merge their vertices, you will have four vertices, but 6 edges.. Another example, is just take two squares and flattening them, then merging the vertices, producing 4 edges, 4 vertices and two quads, or one?
You will have to detect holes in the mesh to determine how to retesselate the mesh when merging vertices.. Or you will have overlapping polygons, which is not beautiful in a rendering system that uses Z buffers.
Some functions that need to be implemented are where two polygons are
detected to be overlapping, where their edges intersect each other,
vertices must be define, so that the surfaces can be reduced from two
to one.. I guess you could reuse the boolean operation code for
finding the union of two overlapping quads, or this would need to be
in the boolean operation code (take a square, duplicate it, move it constrained to an axis within the same plane so both squares overlap and take the same space, take a union of the two squares, this should produce 3 rectangles.. if this doesn't work extrude the squares into cubes,
and try it again with the boolean union operation).
I'm saying, its possible that the boolean code for doing intersections, subtractions and unions can be reused here to handle the mesh intersection, and then merge the vertices (possibly already handled
by the boolean operation)..