From 06c8f48aa0957bea3ac08571ed4419f0ae039a04 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 30 Jul 2021 15:29:19 +0200 Subject: [PATCH] arb:: style improvement in compute_vertex_valence --- arbitrile.cpp | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/arbitrile.cpp b/arbitrile.cpp index 3dc63964..84a2d531 100644 --- a/arbitrile.cpp +++ b/arbitrile.cpp @@ -290,19 +290,17 @@ EX void unmirror() { } EX void compute_vertex_valence() { - auto& shs = arb::current.shapes; + auto& ac = arb::current; int tcl = -1; - for(int i=0; i 360 * degree) a -= 360 * degree; total += a; qty++; at.eid++; - if(at.eid == isize(shs[at.sid].angles)) at.eid = 0; + if(at.eid == isize(ac.shapes[at.sid].angles)) at.eid = 0; - at = shs[at.sid].connections[at.eid]; + at = ac.shapes[at.sid].connections[at.eid]; } while(total < 360*degree - 1e-6); if(total > 360*degree + 1e-6) throw hr_parse_exception("improper total in compute_stats"); if(at.sid != i) throw hr_parse_exception("ended at wrong type determining vertex_valence"); - if((at.eid - k) % shs[i].cycle_length) throw hr_parse_exception("ended at wrong edge determining vertex_valence"); - shs[i].vertex_valence[k] = qty; + if((at.eid - k) % ac.shapes[i].cycle_length) throw hr_parse_exception("ended at wrong edge determining vertex_valence"); + sh.vertex_valence[k] = qty; } if(debugflags & DF_GEOM) - println(hlog, "computed vertex_valence of ", i, " as ", shs[i].vertex_valence); + println(hlog, "computed vertex_valence of ", i, " as ", ac.shapes[i].vertex_valence); } }