Fix cg::edges

This commit is contained in:
Nikita Lisitsa 2022-01-07 23:48:43 +03:00
parent 29e62192ce
commit 385efe5ff9

View file

@ -86,10 +86,13 @@ namespace psemek::cg
using index_type = std::remove_cvref_t<decltype((*std::begin(fs))[0])>;
using std::begin;
using std::end;
std::vector<geom::segment<index_type>> result;
for (auto const & f : fs)
{
for (auto it = std::begin(f), jt = std::prev(std::end(f)); ++it, ++jt; it != std::end(f))
for (auto it = begin(f), jt = std::prev(end(f)); it != end(f); jt = it++)
{
geom::segment<index_type> s{*jt, *it};
if (s[0] > s[1]) std::swap(s[0], s[1]);