[Ref] get_bounds_single shoudl ignore repetition

This commit is contained in:
Jan Petykiewicz 2026-04-01 19:00:59 -07:00
commit f0eea0382b
2 changed files with 20 additions and 1 deletions

View file

@ -64,6 +64,22 @@ def test_ref_get_bounds() -> None:
assert_equal(bounds, [[10, 10], [20, 20]])
def test_ref_get_bounds_single_ignores_repetition_for_non_manhattan_rotation() -> None:
sub_pat = Pattern()
sub_pat.rect((1, 0), xmin=0, xmax=1, ymin=0, ymax=2)
rep = Grid(a_vector=(5, 0), b_vector=(0, 7), a_count=3, b_count=2)
ref = Ref(offset=(10, 20), rotation=pi / 4, repetition=rep)
bounds = ref.get_bounds_single(sub_pat)
repeated_bounds = ref.get_bounds(sub_pat)
assert bounds is not None
assert repeated_bounds is not None
assert repeated_bounds[1, 0] > bounds[1, 0]
assert repeated_bounds[1, 1] > bounds[1, 1]
def test_ref_copy() -> None:
ref1 = Ref(offset=(1, 2), rotation=0.5, annotations={"a": [1]})
ref2 = ref1.copy()