mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
Fixed bug / changed pi
like the pi could get removed if mucke wants to
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user