On Montag, 3. Januar 2022 12:58:50 CET you wrote:
On Fri, 31 Dec 2021 at 08:23, Stefan Brüns stefan.bruens@rwth-aachen.de
wrote:
When the last vertex is coincident with the first vertex, the last segment should be suppressed for both END_OPEN and END_CLOSED.
When the last, zero length segment is not omitted d2d_geometry_intersect_self will add invalid segments.
Unfortunately, I don't think that's correct. For an END_OPEN figure, the first and last vertex coinciding doesn't imply that the last segment is a zero-length segment.
Please supply an example where coinciding does not mean zero length.
Last vertex refers to the second vertex of the last segment, not its start vertex.
Note that if the issue is with some part of d2d_geometry_intersect_self() not handling coinciding vertices well, that issue should be fixed there. Begin and end vertices coinciding isn't the only way that situation can occur; consider for example a trifolium curve (or rose curves more generally) with a shared vertex at the centre.
Coinciding vertices in general are not a problem, only when the start and end vertex of a single line/curve segment are identical (and for any curve, also all control points are coincident).
AddVertex even checks for this and suppresses the vertex (though, only for lines).
Anyway, just suppressing the vertex causes some issues elsewhere, thus I have been reworking the patch.
Regards,
Stefan