Fixed bug / changed pi

like the pi could get removed if mucke wants to
This commit is contained in:
Jan Schuffenhauer
2019-12-20 08:21:23 +01:00
parent 6ff32a141a
commit 0045375f6c
2 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,8 @@
#include <queue>
#include <cmath>
#define pi 3.14159265359
std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> polyPoints){
// helper for managing the triangle vertices and their state
@@ -46,7 +48,7 @@ std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> poly
// return if the vertex is a tip
auto isTip = [](float angle){
return static_cast<double>(angle)<(M_PI/2.);
return static_cast<double>(angle)<(pi/2.);
};
std::vector<TriangleHelper> Vertices;
@@ -88,7 +90,7 @@ std::vector<Triangle> IntelliHelper::calculateTriangles(std::vector<QPoint> poly
}
// update post und prev index
post = post-1;
post = getPrev(post, Vertices.size());
prev = prev<smallest.index ? prev : (prev-1);
// calcultae neighboors of prev and post to calculate new interior angles

View File

@@ -2,7 +2,7 @@ QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
CONFIG += c++17
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings