March gen: refactor for easier testing
This commit is contained in:
parent
f15151ff57
commit
fc2f17b453
1 changed files with 14 additions and 11 deletions
|
@ -76,9 +76,21 @@ class Edg:
|
||||||
|
|
||||||
|
|
||||||
class TriangulatedCube:
|
class TriangulatedCube:
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, activated, triangles=None):
|
def __init__(self, activated, triangles=None):
|
||||||
self.triangles = [] if triangles is None else triangles
|
self.triangles = [] if triangles is None else triangles
|
||||||
self.activated = activated
|
self.activated = activated
|
||||||
|
self.non_activated = TriangulatedCube.ALL_ELTS - activated
|
||||||
|
|
||||||
def transform(self, transf):
|
def transform(self, transf):
|
||||||
n_tri = []
|
n_tri = []
|
||||||
|
@ -94,17 +106,8 @@ class TriangulatedCube:
|
||||||
return TriangulatedCube(n_act, n_tri)
|
return TriangulatedCube(n_act, n_tri)
|
||||||
|
|
||||||
def reverse_activated(self):
|
def reverse_activated(self):
|
||||||
all_elts = {
|
self.activated, self.non_activated = \
|
||||||
Vert.frnt_bot_l,
|
self.non_activated, self.activated
|
||||||
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):
|
def activated_code(self):
|
||||||
out = 0
|
out = 0
|
||||||
|
|
Loading…
Reference in a new issue