From bdfe78eaf5123b4cd4241e8492b1edf7e9b1c158 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 29 Jul 2021 12:03:20 +0200 Subject: [PATCH] arb:: fixed compute_vertex_valence --- arbitrile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index e801261f..863b50af 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -340,7 +340,10 @@ EX void compute_vertex_valence() { int qty = 0; connection_t at = {i, k, false}; do { - total += shs[at.sid].angles[at.eid]; + ld a = shs[at.sid].angles[at.eid]; + while(a < 0) a += 360 * degree; + while(a > 360 * degree) a -= 360 * degree; + total += a; qty++; at.eid++;