Skip to content

Commit

Permalink
Don’t adjust subantiparallels around secondary OU
Browse files Browse the repository at this point in the history
  • Loading branch information
dscorbett committed Sep 8, 2024
1 parent 564ee87 commit fb04a7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sources/phases/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def separate_subantiparallel_lines(
first_curve_op := next((op for op in schema.path.instructions if not callable(op) and isinstance(op.shape, Circle | Curve)), None)
):
clockwise = first_curve_op.shape.clockwise # type: ignore[attr-defined]
loop = isinstance(schema.path, Ou) or not isinstance(schema.path, Wi) and schema.is_primary
loop = not isinstance(schema.path, Wi) and schema.is_primary
case _:
continue
classes[f'clockwise_{clockwise}_i'].append(schema)
Expand Down
5 changes: 5 additions & 0 deletions sources/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,11 @@ def is_primary(self) -> bool:
match self.path:
case Circle():
return not self.path.reversed_circle
case Ou():
for op in self.path.instructions:
match op:
case Component(shape=Circle() | Curve() as shape):
return not shape.reversed_circle
case Complex():
for op in self.path.instructions:
match op:
Expand Down
2 changes: 2 additions & 0 deletions tests/subantiparallel.test
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@
1BC05 1BC44 034F 034F 034F 1BC06::[u1BC05.k@20,0|u1BC44_uni034F034F034F.o__cgj__cgj__cgj.240p225r@0,-225|u1BC06.l@30,17|_@770,0]
1BC05 1BC46 1BC06::[u1BC05.k@13,0|u1BC46.i.240p60@0,-150|u1BC06.l@187,-100|_@927,0]
1BC05 1BC47 1BC06::[u1BC05.k@187,0|u1BC47.e.240n60.ee@0,-50|u1BC06.l@50,-37|_@790,0]
1BC05 1BC5B 034F 034F 034F 1BC06::[u1BC05.k@20,0|u1BC5B_uni034F034F034F.ou__cgj__cgj__cgj.240p225r@0,-225|u1BC06.l@195,-69|_@935,0]
1BC05 1BC5C 034F 034F 034F 1BC06::[u1BC05.k@27,0|u1BC5C_uni034F034F034F.wa__cgj__cgj__cgj.150p45@0,-300|u1BC06.l@234,-34|_@974,0]
1BC05 1BC5E 1BC06::[u1BC05.k@27,0|u1BC5E.wi.240p110@0,-300|u1BC06.l@203,-34|_@943,0]
1BC05 1BC5E 034F 034F 034F 1BC06::[u1BC05.k@373,0|u1BC5E_uni034F034F034F.wi__cgj__cgj__cgj.240n10@0,-100|u1BC06.l@286,158|_@1026,0]
1BC06 1BC42 1BC05::[u1BC06.l@0,0|u1BC42.sloan_ow.45n60r@471,329|u1BC05.k@203,-10|_@911,0]
1BC06 1BC44 034F 034F 034F 1BC05::[u1BC06.l@0,0|u1BC44_uni034F034F034F.o__cgj__cgj__cgj.45n60r@456,244|u1BC05.k@198,-14|_@996,0]
1BC06 1BC46 1BC05::[u1BC06.l@0,0|u1BC46.i.45p225.ee@359,500|u1BC05.k@212,141|_@769,0]
1BC06 1BC47 1BC05::[u1BC06.l@0,0|u1BC47.e.45n225@500,359|u1BC05.k@353,-141|_@911,0]
1BC06 1BC5B 034F 034F 034F 1BC05::[u1BC06.l@0,0|u1BC5B_uni034F034F034F.ou__cgj__cgj__cgj.45n60r@456,244|u1BC05.k@324,-151|_@996,0]
1BC06 1BC5C 034F 034F 034F 1BC05::[u1BC06.l@0,0|u1BC5C_uni034F034F034F.wa__cgj__cgj__cgj.135n240@400,159|u1BC05.k@298,-191|_@1081,0]
1BC06 1BC5E 1BC05::[u1BC06.l@0,0|u1BC5E.wi.45p275@159,441|u1BC05.k@51,79|_@799,0]
1BC06 1BC5E 034F 034F 034F 1BC05::[u1BC06.l@0,0|u1BC5E_uni034F034F034F.wi__cgj__cgj__cgj.45n175@441,159|u1BC05.k@255,-174|_@1081,0]
Expand Down

0 comments on commit fb04a7c

Please sign in to comment.