march generator: add reverse activated points

This commit is contained in:
Théophile Bastian 2018-02-09 00:53:47 +01:00
parent 39d12ef8a4
commit 1dece061a3

View file

@ -83,6 +83,19 @@ class TriangulatedCube:
n_act.add(transf(act))
return TriangulatedCube(n_act, n_tri)
def reverse_activated(self):
all_elts = {
Vert.frnt_bot_l,
Vert.frnt_bot_r,
Vert.frnt_top_l,
Vert.frnt_top_r,
Vert.back_bot_l,
Vert.back_bot_r,
Vert.back_top_l,
Vert.back_top_r,
}
self.activated = all_elts - self.activated
def activated_code(self):
out = 0
for act in self.activated:
@ -181,11 +194,14 @@ def do_main(base_cases):
index[code] = case
for transf in transforms:
for case in base_cases:
tr_case = case.transform(transf)
code = tr_case.activated_code()
if index[code] is None:
index[code] = tr_case
for rev_activated in [False, True]:
for case in base_cases:
tr_case = case.transform(transf)
if rev_activated:
tr_case.reverse_activated()
code = tr_case.activated_code()
if index[code] is None:
index[code] = tr_case
for (val, tri) in enumerate(index):
if tri is None: