Commit a9f10730 authored by Philip Trettner's avatar Philip Trettner
Browse files

fix for fix

parent b7ee88d6
......@@ -17,9 +17,6 @@ void polymesh::triangulate_naive(polymesh::Mesh& m)
if (vs.size() <= 3)
continue;
// remove
m.faces().remove(f);
// find non-valence 2
auto si = 0;
for (auto i = 0u; i < vs.size(); ++i)
......@@ -35,6 +32,10 @@ void polymesh::triangulate_naive(polymesh::Mesh& m)
if (si < 0)
si += int(vs.size());
// remove
// NOTE: AFTER finding start idx
m.faces().remove(f);
// triangulate
for (auto i = 2u; i < vs.size(); ++i)
m.faces().add(vs[si], vs[(si + i - 1) % vs.size()], vs[(si + i) % vs.size()]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment