mirror of https://github.com/KLayout/klayout.git
Implemented #801: update, added test case
This commit is contained in:
parent
ea3bfabd90
commit
55bdd904cb
|
|
@ -842,18 +842,23 @@ CODE
|
||||||
# @name smoothed
|
# @name smoothed
|
||||||
# @brief Smoothes the polygons of the region
|
# @brief Smoothes the polygons of the region
|
||||||
# @synopsis layer.smoothed(d)
|
# @synopsis layer.smoothed(d)
|
||||||
|
# @synopsis layer.smoothed(d, hv_keep)
|
||||||
#
|
#
|
||||||
# "Smoothing" returns a simplified version of the polygons. Simplification is
|
# "Smoothing" returns a simplified version of the polygons. Simplification is
|
||||||
# achieved by removing vertices unless the resulting polygon deviates by more
|
# achieved by removing vertices unless the resulting polygon deviates by more
|
||||||
# than the given distance d from the original polygon.
|
# 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
|
# This method return a layer wit the modified polygons. Merged semantics applies for this
|
||||||
# method (see \raw and \clean).
|
# method (see \raw and \clean).
|
||||||
|
|
||||||
def smoothed(d)
|
def smoothed(d, hv_keep = false)
|
||||||
@engine._context("smoothed") do
|
@engine._context("smoothed") do
|
||||||
requires_region
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ c1.output(3, 0)
|
||||||
|
|
||||||
c1.rounded_corners(0.5, 0.5, 16).output(1010, 0)
|
c1.rounded_corners(0.5, 0.5, 16).output(1010, 0)
|
||||||
c1.smoothed(1.5).output(1011, 0)
|
c1.smoothed(1.5).output(1011, 0)
|
||||||
|
c1.smoothed(1.5, true).output(1012, 0)
|
||||||
|
|
||||||
a1.texts.output(1020, 0)
|
a1.texts.output(1020, 0)
|
||||||
a1.texts("A*").output(1021, 0)
|
a1.texts("A*").output(1021, 0)
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue