diff --git a/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp b/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp index 29a1ccd04..6b3ff60c1 100644 --- a/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp +++ b/src/libnest2d/include/libnest2d/geometry_traits_nfp.hpp @@ -220,7 +220,9 @@ inline NfpResult 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; } } @@ -230,7 +232,9 @@ inline NfpResult 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; } }