Triangulation operator<< prints the infinite vertex
(from https://sympa.inria.fr/sympa/arc/cgal-discuss/2024-03/msg00000.html)
When printing a triangulation with operator<<, the dD class has a surprising behavior: it prints the infinite vertex. In practice, this can give
8
3 -1 2 -3
3 1 -2 -3
3 -1 -2 -3
3 1 2 3
3 -1 2 -3
3 1 -2 3
3 -1 -2 3
3 -1 2 3
3 1 2 -3
i.e. it announces 8 points then prints 9, where the first one randomly happens to match one of the other points.
See https://github.com/CGAL/cgal/blob/8c65aff6c1ca06d7c81d6a9e32a7656f849730d2/Triangulation/include/CGAL/Triangulation.h#L1413-L1418 which explicitly prints the infinite vertex and compare with the code in Triangulation_3 https://github.com/CGAL/cgal/blob/8c65aff6c1ca06d7c81d6a9e32a7656f849730d2/Triangulation_3/include/CGAL/Triangulation_3.h#L2507-L2510 which skips it and starts with the first finite vertex.
Note that while printing the point of the infinite vertex is a bad idea, printing its data/info looks like it could be useful.
Unlike Triangulation, Triangulation_3 does not print the info field of Triangulation_vertex_base_with_info_3 though.
@mglisse do you agree that as a first step we just do not write the infinite vertex?
@mglisse do you agree that as a first step we just do not write the infinite vertex?
Ok. It will be a small regression in that the info of the infinite vertex will be lost, but hopefully that causes less trouble than the extra vertex? I don't know if there are tests already that check that << and >> do something consistent. An alternative would be to print a recognizable placeholder in place of the coordinates of the infinite vertex (so the line is still there in the output, with the data of the infinite vertex). I never use those functions myself...