fix poly clip and fix poly_remove_duplicate

This commit is contained in:
2018-11-29 23:13:04 +01:00
parent f64f157e82
commit d0919862da
5 changed files with 14 additions and 40 deletions

View File

@@ -34,7 +34,8 @@ std::vector<T> poly_remove_duplicate(const std::vector<T>& v, const float toller
std::vector<T> ret;
for (size_t i = 0; i < v.size(); i++)
{
if (glm::distance2(v[i], v[(i + 1) % v.size()]) > tollerance)
//if (glm::distance2(v[i], v[(i + 1) % v.size()]) > tollerance)
if (v[i] != v[(i + 1) % v.size()])
ret.push_back(v[i]);
}
return ret;