Convenience: simple version of DRC layer.with_holes and layer.without_holes

This commit is contained in:
Matthias Koefferlein 2021-09-20 21:36:46 +02:00
parent 93e789a861
commit 29384bf3f3
5 changed files with 13 additions and 5 deletions

View File

@ -544,22 +544,24 @@ CODE
# %DRC% # %DRC%
# @name with_holes # @name with_holes
# @brief Selects all polygons with the specified number of holes # @brief Selects all polygons with the specified number of holes
# @synopsis layer.with_holes
# @synopsis layer.with_holes(count) # @synopsis layer.with_holes(count)
# @synopsis layer.with_holes(min_count, max_count) # @synopsis layer.with_holes(min_count, max_count)
# @synopsis layer.with_holes(min_count .. max_count) # @synopsis layer.with_holes(min_count .. max_count)
# #
# This method is available for polygon layers. It will select all polygons from the input layer # This method is available for polygon layers. It will select all polygons from the input layer
# which have the specified number of holes. # which have the specified number of holes. Without any argument, all polygons with holes are selected.
# %DRC% # %DRC%
# @name without_holes # @name without_holes
# @brief Selects all polygons with the specified number of holes # @brief Selects all polygons with the specified number of holes
# @synopsis layer.without_holes
# @synopsis layer.without_holes(count) # @synopsis layer.without_holes(count)
# @synopsis layer.without_holes(min_count, max_count) # @synopsis layer.without_holes(min_count, max_count)
# @synopsis layer.without_holes(min_count .. max_count) # @synopsis layer.without_holes(min_count .. max_count)
# #
# This method is available for polygon layers. It will select all polygons from the input layer # This method is available for polygon layers. It will select all polygons from the input layer
# which do not have the specified number of holes. # which do not have the specified number of holes. Without any arguments, all polygons without holes are selected.
%w(holes).each do |f| %w(holes).each do |f|
[true, false].each do |inv| [true, false].each do |inv|
@ -570,7 +572,9 @@ CODE
@engine._context("#{mn}") do @engine._context("#{mn}") do
requires_region requires_region
if args.size == 1 if args.size == 0
DRCLayer::new(@engine, @engine._tcmd(self.data, 0, RBA::Region, :with_#{f}, 1, nil, #{inv.inspect}))
elsif args.size == 1
a = args[0] a = args[0]
if a.is_a?(Range) if a.is_a?(Range)
min = @engine._make_numeric_value_with_nil(a.begin) min = @engine._make_numeric_value_with_nil(a.begin)

View File

@ -3423,13 +3423,14 @@ This method is available for edge pair layers only.
<keyword name="with_holes"/> <keyword name="with_holes"/>
<p>Usage:</p> <p>Usage:</p>
<ul> <ul>
<li><tt>layer.with_holes</tt></li>
<li><tt>layer.with_holes(count)</tt></li> <li><tt>layer.with_holes(count)</tt></li>
<li><tt>layer.with_holes(min_count, max_count)</tt></li> <li><tt>layer.with_holes(min_count, max_count)</tt></li>
<li><tt>layer.with_holes(min_count .. max_count)</tt></li> <li><tt>layer.with_holes(min_count .. max_count)</tt></li>
</ul> </ul>
<p> <p>
This method is available for polygon layers. It will select all polygons from the input layer This method is available for polygon layers. It will select all polygons from the input layer
which have the specified number of holes. which have the specified number of holes. Without any argument, all polygons with holes are selected.
</p> </p>
<a name="with_internal_angle"/><h2>"with_internal_angle" - Selects edge pairs by their internal angle</h2> <a name="with_internal_angle"/><h2>"with_internal_angle" - Selects edge pairs by their internal angle</h2>
<keyword name="with_internal_angle"/> <keyword name="with_internal_angle"/>
@ -3667,13 +3668,14 @@ This method is available for edge pair layers only.
<keyword name="without_holes"/> <keyword name="without_holes"/>
<p>Usage:</p> <p>Usage:</p>
<ul> <ul>
<li><tt>layer.without_holes</tt></li>
<li><tt>layer.without_holes(count)</tt></li> <li><tt>layer.without_holes(count)</tt></li>
<li><tt>layer.without_holes(min_count, max_count)</tt></li> <li><tt>layer.without_holes(min_count, max_count)</tt></li>
<li><tt>layer.without_holes(min_count .. max_count)</tt></li> <li><tt>layer.without_holes(min_count .. max_count)</tt></li>
</ul> </ul>
<p> <p>
This method is available for polygon layers. It will select all polygons from the input layer This method is available for polygon layers. It will select all polygons from the input layer
which do not have the specified number of holes. which do not have the specified number of holes. Without any arguments, all polygons without holes are selected.
</p> </p>
<a name="without_internal_angle"/><h2>"without_internal_angle" - Selects edge pairs by their internal angle</h2> <a name="without_internal_angle"/><h2>"without_internal_angle" - Selects edge pairs by their internal angle</h2>
<keyword name="without_internal_angle"/> <keyword name="without_internal_angle"/>

View File

@ -22,4 +22,6 @@ h.with_holes(1..3).output(103, 0)
h.with_holes(1..1).output(104, 0) h.with_holes(1..1).output(104, 0)
h.with_holes(2, nil).output(105, 0) h.with_holes(2, nil).output(105, 0)
h.with_holes(0, nil).output(106, 0) h.with_holes(0, nil).output(106, 0)
h.with_holes.output(107, 0)
h.without_holes.output(108, 0)

Binary file not shown.

Binary file not shown.