Skip to content

Commit

Permalink
Fix for arrange crash when geometry has zero length segments
Browse files Browse the repository at this point in the history
fixes #5749
  • Loading branch information
tamasmeszaros committed Apr 15, 2021
1 parent 1e69e6d commit 64ec319
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp
Expand Up @@ -220,7 +220,9 @@ inline NfpResult<RawShape> nfpConvexOnly(const RawShape& sh,
auto next = std::next(first);

while(next != sl::cend(sh)) {
edgelist.emplace_back(*(first), *(next));
if (pl::magnsq(*next - *first) > 0)
edgelist.emplace_back(*(first), *(next));

++first; ++next;
}
}
Expand All @@ -230,7 +232,9 @@ inline NfpResult<RawShape> nfpConvexOnly(const RawShape& sh,
auto next = std::next(first);

while(next != sl::cend(other)) {
edgelist.emplace_back(*(next), *(first));
if (pl::magnsq(*next - *first) > 0)
edgelist.emplace_back(*(next), *(first));

++first; ++next;
}
}
Expand Down

0 comments on commit 64ec319

Please sign in to comment.