[set_dead / skip_geometry] Improve dead pathers so more "broken" layouts can be successfully executed
This commit is contained in:
parent
cf822c7dcf
commit
f42e720c68
7 changed files with 273 additions and 73 deletions
|
|
@ -73,3 +73,23 @@ def test_renderpather_retool(rpather_setup: tuple[RenderPather, PathTool, Librar
|
|||
# Different tools should cause different batches/shapes
|
||||
assert len(rp.pattern.shapes[(1, 0)]) == 1
|
||||
assert len(rp.pattern.shapes[(2, 0)]) == 1
|
||||
|
||||
|
||||
def test_renderpather_dead_ports() -> None:
|
||||
lib = Library()
|
||||
tool = PathTool(layer=(1, 0), width=1)
|
||||
rp = RenderPather(lib, ports={"in": Port((0, 0), 0)}, tools=tool)
|
||||
rp.set_dead()
|
||||
|
||||
# Impossible path
|
||||
rp.path("in", None, -10)
|
||||
|
||||
# port_rot=0, forward is -x. path(-10) means moving -10 in -x direction -> +10 in x.
|
||||
assert_allclose(rp.ports["in"].offset, [10, 0], atol=1e-10)
|
||||
|
||||
# Verify no render steps were added
|
||||
assert len(rp.paths["in"]) == 0
|
||||
|
||||
# Verify no geometry
|
||||
rp.render()
|
||||
assert not rp.pattern.has_shapes()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue