This commit is contained in:
Matthias Koefferlein 2024-03-07 22:08:45 +01:00
parent 853de5b0ae
commit ab5f215417
12 changed files with 108 additions and 6 deletions

View File

@ -536,6 +536,35 @@ run_demo gen, "input.edges.with_length(0, 3.5)\n .extended(:out => 1.0)", "drc
run_demo gen, "input.edges.with_length(0, 3.5)\n .extended(:out => 1.0, :joined => true)", "drc_extended3.png"
run_demo gen, "input.edges.with_length(2.0)\n .extended(0.0, -0.5, 1.0, -0.5)", "drc_extended4.png"
class Gen
def produce(s1, s2)
pts = [
RBA::Point::new(1000, 0),
RBA::Point::new(1000, 5000),
RBA::Point::new(2000, 5000),
RBA::Point::new(2000, 7000),
RBA::Point::new(4000, 7000),
RBA::Point::new(4000, 5000),
RBA::Point::new(5000, 5000),
RBA::Point::new(5000, 0),
RBA::Point::new(4000, 0),
RBA::Point::new(4000, 1000),
RBA::Point::new(2000, 1000),
RBA::Point::new(2000, 0)
];
s1.insert(RBA::Polygon::new(pts))
end
end
gen = Gen::new
run_demo gen, "input.edges", "drc_edge_modes1.png"
run_demo gen, "input.edges(convex)", "drc_edge_modes2.png"
run_demo gen, "input.edges(concave)", "drc_edge_modes3.png"
run_demo gen, "input.edges(step)", "drc_edge_modes4.png"
run_demo gen, "input.edges(step_in)", "drc_edge_modes5.png"
run_demo gen, "input.edges(step_out)", "drc_edge_modes6.png"
class Gen
def produce(s1, s2)
pts = [

View File

@ -453,6 +453,7 @@ out = in.drc(covering(other) > 2)
<p>Usage:</p>
<ul>
<li><tt>expression.edges</tt></li>
<li><tt>expression.edges(mode)</tt></li>
</ul>
<p>
Polygons will be separated into edges forming their contours. Edge pairs will be
@ -466,6 +467,20 @@ for the edges:
<pre>
out = in.drc(primary.edges)
</pre>
</p><p>
The "mode" argument allows selecting specific edges from polygons.
Allowed values are: "convex", "concave", "step", "step_in" and "step_out".
"step" generates edges only if they provide a step between two other
edges. "step_in" creates edges that make a step towards the inside of
the polygon and "step_out" creates edges that make a step towards the
outside:
</p><p>
<pre>
out = in.drc(primary.edges(convex))
</pre>
</p><p>
The mode argument is ignored when translating other objects than
polygons.
</p>
<a name="end_segments"/><h2>"end_segments" - Returns the part at the end of each edge of the input</h2>
<keyword name="end_segments"/>

View File

@ -783,6 +783,11 @@ apply to this method.
</ul>
<a name="edges"/><h2>"edges" - Decomposes the layer into single edges</h2>
<keyword name="edges"/>
<p>Usage:</p>
<ul>
<li><tt>layer.edges</tt></li>
<li><tt>layer.edges(mode)</tt></li>
</ul>
<p>
Edge pair collections are decomposed into the individual edges that make up
the edge pairs. Polygon layers are decomposed into the edges making up the
@ -791,6 +796,36 @@ is called on.
</p><p>
Merged semantics applies, i.e. the result reflects merged polygons rather than
individual ones unless raw mode is chosen.
</p><p>
The "mode" argument allows selecting specific edges from polygons.
Allowed values are: "convex", "concave", "step", "step_in" and "step_out".
"step" generates edges only if they provide a step between two other
edges. "step_in" creates edges that make a step towards the inside of
the polygon and "step_out" creates edges that make a step towards the
outside:
</p><p>
<pre>
out = in.edges(convex)
</pre>
</p><p>
This feature is only available for polygon layers.
</p><p>
The following images show the effect of the mode argument:
</p><p>
<table>
<tr>
<td><img src="/images/drc_edge_modes1.png"/></td>
<td><img src="/images/drc_edge_modes2.png"/></td>
</tr>
<tr>
<td><img src="/images/drc_edge_modes3.png"/></td>
<td><img src="/images/drc_edge_modes4.png"/></td>
</tr>
<tr>
<td><img src="/images/drc_edge_modes5.png"/></td>
<td><img src="/images/drc_edge_modes6.png"/></td>
</tr>
</table>
</p>
<a name="edges?"/><h2>"edges?" - Returns true, if the layer is an edge layer</h2>
<keyword name="edges?"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -54,6 +54,12 @@
<file alias="drc_extended2.png">doc/images/drc_extended2.png</file>
<file alias="drc_extended3.png">doc/images/drc_extended3.png</file>
<file alias="drc_extended4.png">doc/images/drc_extended4.png</file>
<file alias="drc_edge_modes1.png">doc/images/drc_edge_modes1.png</file>
<file alias="drc_edge_modes2.png">doc/images/drc_edge_modes2.png</file>
<file alias="drc_edge_modes3.png">doc/images/drc_edge_modes3.png</file>
<file alias="drc_edge_modes4.png">doc/images/drc_edge_modes4.png</file>
<file alias="drc_edge_modes5.png">doc/images/drc_edge_modes5.png</file>
<file alias="drc_edge_modes6.png">doc/images/drc_edge_modes6.png</file>
<file alias="drc_extents1.png">doc/images/drc_extents1.png</file>
<file alias="drc_extents2.png">doc/images/drc_extents2.png</file>
<file alias="drc_inside.png">doc/images/drc_inside.png</file>

View File

@ -1004,11 +1004,11 @@ CODE
# @/code
#
# The "mode" argument allows selecting specific edges from polygons.
# Allows values are: "convex", "concave", "step", "step_in" and "step_out".
# "step" generates edges only that provide a step between two other
# Allowed values are: "convex", "concave", "step", "step_in" and "step_out".
# "step" generates edges only if they provide a step between two other
# edges. "step_in" creates edges that make a step towards the inside of
# the polygon and "step_out" creates edges that make a step towards the
# outside (hull contours in clockwise orientation, holes counterclockwise):
# outside:
#
# @code
# out = in.drc(primary.edges(convex))

View File

@ -3399,17 +3399,34 @@ CODE
# individual ones unless raw mode is chosen.
#
# The "mode" argument allows selecting specific edges from polygons.
# Allows values are: "convex", "concave", "step", "step_in" and "step_out".
# "step" generates edges only that provide a step between two other
# Allowed values are: "convex", "concave", "step", "step_in" and "step_out".
# "step" generates edges only if they provide a step between two other
# edges. "step_in" creates edges that make a step towards the inside of
# the polygon and "step_out" creates edges that make a step towards the
# outside (hull contours in clockwise orientation, holes counterclockwise):
# outside:
#
# @code
# out = in.edges(convex)
# @/code
#
# This feature is only available for polygon layers.
#
# The following images show the effect of the mode argument:
#
# @table
# @tr
# @td @img(/images/drc_edge_modes1.png) @/td
# @td @img(/images/drc_edge_modes2.png) @/td
# @/tr
# @tr
# @td @img(/images/drc_edge_modes3.png) @/td
# @td @img(/images/drc_edge_modes4.png) @/td
# @/tr
# @tr
# @td @img(/images/drc_edge_modes5.png) @/td
# @td @img(/images/drc_edge_modes6.png) @/td
# @/tr
# @/table
%w(edges).each do |f|
eval <<"CODE"