From 21fd758c48625b0d855f44b1c93aadf001e7eae3 Mon Sep 17 00:00:00 2001 From: Jeremy Hu Date: Fri, 17 Jan 2020 22:14:55 +0930 Subject: [PATCH] Fix faces to nodes projector --- src/projectfacestonodes.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/projectfacestonodes.cpp b/src/projectfacestonodes.cpp index 15b1c725..83e488cf 100644 --- a/src/projectfacestonodes.cpp +++ b/src/projectfacestonodes.cpp @@ -32,6 +32,8 @@ public: auto B = -polygonNormal(*m_vertices, face); auto a = QVector3D::dotProduct(B, B); auto b = 2.0f * QVector3D::dotProduct(B, A - C); + if (b >= 0.0) + return false; const auto &r = nodeRadius; auto c = QVector3D::dotProduct(A - C, A - C) - r * r; if (b * b - 4 * a * c <= 0)