mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-29 22:02:50 +00:00
arb:: fixed a bug with 'ended at wrong edge determining vertex_valence'
This commit is contained in:
parent
e175f522dc
commit
6999277715
@ -300,6 +300,7 @@ EX void compute_vertex_valence() {
|
|||||||
for(auto& sh: ac.shapes)
|
for(auto& sh: ac.shapes)
|
||||||
sh.cycle_length = isize(sh.vertices);
|
sh.cycle_length = isize(sh.vertices);
|
||||||
|
|
||||||
|
recompute:
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
||||||
for(auto& sh: ac.shapes) {
|
for(auto& sh: ac.shapes) {
|
||||||
@ -361,7 +362,10 @@ EX void compute_vertex_valence() {
|
|||||||
while(total < 360*degree - 1e-6);
|
while(total < 360*degree - 1e-6);
|
||||||
if(total > 360*degree + 1e-6) throw hr_parse_exception("improper total in compute_stats");
|
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.sid != i) throw hr_parse_exception("ended at wrong type determining vertex_valence");
|
||||||
if((at.eid - k) % ac.shapes[i].cycle_length) throw hr_parse_exception("ended at wrong edge determining vertex_valence");
|
if((at.eid - k) % ac.shapes[i].cycle_length) {
|
||||||
|
ac.shapes[i].cycle_length = abs(gcd(ac.shapes[i].cycle_length, at.eid - k));
|
||||||
|
goto recompute;
|
||||||
|
}
|
||||||
sh.vertex_valence[k] = qty;
|
sh.vertex_valence[k] = qty;
|
||||||
}
|
}
|
||||||
if(debugflags & DF_GEOM)
|
if(debugflags & DF_GEOM)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user