From 6191705fcde0dd76c2e36bfcd6023d7105702fec Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 7 Nov 2024 21:41:58 +0100 Subject: [PATCH] fixed generate_subcellshape in product --- graph.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graph.cpp b/graph.cpp index 1c5d319a..a5279676 100644 --- a/graph.cpp +++ b/graph.cpp @@ -4416,8 +4416,9 @@ EX subcellshape& generate_subcellshape_if_needed(cell *c, int id) { vector l; int z = a ? 1 : -1; hyperpoint ctr = zpush0(z * cgi.plevel/2); + int qty = (mproduct || WDIM == 2) ? 1 : 3; for(int i=0; itype; i++) - if(mproduct || WDIM == 2) + if(qty == 1) l.push_back(hybrid::get_corner(c1, i, 0, z)); else { l.push_back(ctr); @@ -4428,7 +4429,7 @@ EX subcellshape& generate_subcellshape_if_needed(cell *c, int id) { l.push_back(hybrid::get_corner(c1, i, 0, z)); } if(a == 0) std::reverse(l.begin()+1, l.end()); - if(a == 1) std::rotate(l.begin(), l.begin()+3, l.end()); + if(a == 1) std::rotate(l.begin(), l.begin()+qty, l.end()); ss.faces.push_back(l); }