Fix for arrange crash when geometry has zero length segments

fixes #5749
This commit is contained in:
tamasmeszaros 2021-01-12 17:01:14 +01:00
parent 1e69e6def1
commit 64ec319017

View File

@ -220,7 +220,9 @@ inline NfpResult<RawShape> nfpConvexOnly(const RawShape& sh,
auto next = std::next(first); auto next = std::next(first);
while(next != sl::cend(sh)) { while(next != sl::cend(sh)) {
if (pl::magnsq(*next - *first) > 0)
edgelist.emplace_back(*(first), *(next)); edgelist.emplace_back(*(first), *(next));
++first; ++next; ++first; ++next;
} }
} }
@ -230,7 +232,9 @@ inline NfpResult<RawShape> nfpConvexOnly(const RawShape& sh,
auto next = std::next(first); auto next = std::next(first);
while(next != sl::cend(other)) { while(next != sl::cend(other)) {
if (pl::magnsq(*next - *first) > 0)
edgelist.emplace_back(*(next), *(first)); edgelist.emplace_back(*(next), *(first));
++first; ++next; ++first; ++next;
} }
} }