Fixing issue #2134 ('merged' on edge layers not working in DRC)

This commit is contained in:
Matthias Koefferlein 2025-09-04 21:58:46 +02:00
parent 70ba27c8f2
commit af6762b52d
6 changed files with 48 additions and 2 deletions

View File

@ -5079,6 +5079,7 @@ CODE
#
# This method works both on edge or polygon layers. Edge merging forms
# single, continuous edges from coincident and connected individual edges.
# The overlap count is only available on polygon layers.
#
# A version that modifies the input layer is \merge.
#
@ -5106,7 +5107,13 @@ CODE
def merged(overlap_count = 1)
@engine._context("merged") do
requires_edges_or_region
aa = [ @engine._prep_value(overlap_count) ]
oc = @engine._prep_value(overlap_count)
if self.data.is_a?(RBA::Edges)
oc == 1 || raise("'overlap_count' (merged) is only available on polygon layers")
aa = []
else
aa = [ oc ]
end
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, self.data.class, :merged, *aa))
end
end
@ -5114,7 +5121,13 @@ CODE
def merge(overlap_count = 1)
@engine._context("merge") do
requires_edges_or_region
aa = [ @engine._prep_value(overlap_count) ]
oc = @engine._prep_value(overlap_count)
if self.data.is_a?(RBA::Edges)
oc == 1 || raise("'overlap_count' (merged) is only available on polygon layers")
aa = []
else
aa = [ oc ]
end
if @engine.is_tiled?
# in tiled mode, no modifying versions are available
self.data = @engine._tcmd(self.data, 0, self.data.class, :merged, *aa)

View File

@ -2044,3 +2044,14 @@ TEST(144d_combined_antennas)
run_test (_this, "144", true);
}
// issue 2134
TEST(145_edges_merge)
{
run_test (_this, "145", false);
}
TEST(145d_edges_merge)
{
run_test (_this, "145", true);
}

22
testdata/drc/drcSimpleTests_145.drc vendored Normal file
View File

@ -0,0 +1,22 @@
source $drc_test_source
target $drc_test_target
if $drc_test_deep
deep
end
l1 = input(1, 0)
l2 = input(2, 0)
l3 = input(3, 0)
l1.output(1, 0)
l2.output(2, 0)
l3.output(3, 0)
l1.raw.edges.merged.output(100, 0)
l2.raw.edges.merged.output(101, 0)
l3e = l3.raw.edges
l3e.merge
l3e.output(102, 0)

BIN
testdata/drc/drcSimpleTests_145.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au145.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au145d.gds vendored Normal file

Binary file not shown.