From 3252ec4404c384e620c8fbea7300a05e42edc11d Mon Sep 17 00:00:00 2001 From: Sonaion Date: Thu, 19 Dec 2019 17:39:10 +0100 Subject: [PATCH] Earfolding bug --- src/IntelliHelper/IntelliHelper.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/IntelliHelper/IntelliHelper.cpp b/src/IntelliHelper/IntelliHelper.cpp index 2979bc5..a7aaf9f 100644 --- a/src/IntelliHelper/IntelliHelper.cpp +++ b/src/IntelliHelper/IntelliHelper.cpp @@ -25,17 +25,18 @@ std::vector IntelliHelper::calculateTriangles(std::vector poly // gets the first element of vec for which element.isTip == true holds auto getTip= [](const std::vector& vec){ - for(auto element:vec){ - if(element.isTip){ - return element; + size_t min = 0; + for(size_t i=0; i0?(index-1):(length-1); + return (index-1)>=0?(index-1):(length-1); }; // get the vertex Index after index in relation to the container lenght @@ -45,7 +46,7 @@ std::vector IntelliHelper::calculateTriangles(std::vector poly // return if the vertex is a tip auto isTip = [](float angle){ - return angle<180.f; + return static_cast(angle)<(M_PI/2.); }; std::vector Vertices;