From 55bdd904cbd6be9402dd3e24f8d2aab719700d56 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 19 May 2021 22:25:49 +0200 Subject: [PATCH] Implemented #801: update, added test case --- src/drc/drc/built-in-macros/_drc_layer.rb | 9 +++++++-- testdata/drc/drcSimpleTests_2.drc | 1 + testdata/drc/drcSimpleTests_au2.gds | Bin 12542 -> 12638 bytes 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index 4d22374b8..fa0735ba2 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -842,18 +842,23 @@ CODE # @name smoothed # @brief Smoothes the polygons of the region # @synopsis layer.smoothed(d) + # @synopsis layer.smoothed(d, hv_keep) # # "Smoothing" returns a simplified version of the polygons. Simplification is # achieved by removing vertices unless the resulting polygon deviates by more # than the given distance d from the original polygon. # + # "hv_keep" is a boolean parameter which makes the smoothing function maintain + # horizontal or vertical edges. The default is false, meaning horizontal or + # vertical edges may be changed into tilted ones. + # # This method return a layer wit the modified polygons. Merged semantics applies for this # method (see \raw and \clean). - def smoothed(d) + def smoothed(d, hv_keep = false) @engine._context("smoothed") do requires_region - DRCLayer::new(@engine, @engine._tcmd(self.data, 0, RBA::Region, :smoothed, @engine._make_value(d))) + DRCLayer::new(@engine, @engine._tcmd(self.data, 0, RBA::Region, :smoothed, @engine._make_value(d), hv_keep)) end end diff --git a/testdata/drc/drcSimpleTests_2.drc b/testdata/drc/drcSimpleTests_2.drc index 5582c41dd..66faa4c55 100644 --- a/testdata/drc/drcSimpleTests_2.drc +++ b/testdata/drc/drcSimpleTests_2.drc @@ -12,6 +12,7 @@ c1.output(3, 0) c1.rounded_corners(0.5, 0.5, 16).output(1010, 0) c1.smoothed(1.5).output(1011, 0) +c1.smoothed(1.5, true).output(1012, 0) a1.texts.output(1020, 0) a1.texts("A*").output(1021, 0) diff --git a/testdata/drc/drcSimpleTests_au2.gds b/testdata/drc/drcSimpleTests_au2.gds index c85d1eebe58f18ada5c281a5d054731b71f7e3b7..76c8b8afe3ea045d93a6b2382300fd039ce43d2e 100644 GIT binary patch delta 164 zcmeyDcrPi6fsKKQDS|{L4=vr&au1_lNn0p|bzzj*xr|E2;$e@OWM9~u8J`2Qb) OC%{L4=vr&au