From: "Stefan Brüns" Subject: Re: [PATCH] d2d: Suppress last empty segment also for D2D1_FIGURE_END_OPEN Message-Id: <26473716.ikUS8UAcQo@bacchus> Date: Mon, 3 Jan 2022 15:09:32 +0100 In-Reply-To: References: <20211230221854.18968-1-stefan.bruens@rwth-aachen.de> On Montag, 3. Januar 2022 12:58:50 CET you wrote: > On Fri, 31 Dec 2021 at 08:23, Stefan Brüns 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 -- Stefan Brüns / Bergstraße 21 / 52062 Aachen phone: +49 241 53809034 mobile: +49 151 50412019 -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSwWRWIpJbl0W4DemNvf0o9jP6qUwUCYdMDnAAKCRBvf0o9jP6q UxPsAKCAFUFxuK00NTNsAfqS7E2fcFzDZACgo1jRyneehQ+TJt11Spel4UEBHLE= =EzMt -----END PGP SIGNATURE-----