diff --git a/scripts/drc_lvs_doc/create_drc_samples.rb b/scripts/drc_lvs_doc/create_drc_samples.rb index 5594555be..b09ed46fd 100644 --- a/scripts/drc_lvs_doc/create_drc_samples.rb +++ b/scripts/drc_lvs_doc/create_drc_samples.rb @@ -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 = [ diff --git a/src/doc/doc/about/drc_ref_drc.xml b/src/doc/doc/about/drc_ref_drc.xml index 3fab7774b..2a81774f7 100644 --- a/src/doc/doc/about/drc_ref_drc.xml +++ b/src/doc/doc/about/drc_ref_drc.xml @@ -453,6 +453,7 @@ out = in.drc(covering(other) > 2)

Usage:

Polygons will be separated into edges forming their contours. Edge pairs will be @@ -466,6 +467,20 @@ for the edges:

 out = in.drc(primary.edges)
 
+

+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: +

+

+out = in.drc(primary.edges(convex))
+
+

+The mode argument is ignored when translating other objects than +polygons.

"end_segments" - Returns the part at the end of each edge of the input

diff --git a/src/doc/doc/about/drc_ref_layer.xml b/src/doc/doc/about/drc_ref_layer.xml index 2e5e6b2b9..1a691b473 100644 --- a/src/doc/doc/about/drc_ref_layer.xml +++ b/src/doc/doc/about/drc_ref_layer.xml @@ -783,6 +783,11 @@ apply to this method.

"edges" - Decomposes the layer into single edges

+

Usage:

+

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.

Merged semantics applies, i.e. the result reflects merged polygons rather than individual ones unless raw mode is chosen. +

+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: +

+

+out = in.edges(convex)
+
+

+This feature is only available for polygon layers. +

+The following images show the effect of the mode argument: +

+ + + + + + + + + + + + + +

"edges?" - Returns true, if the layer is an edge layer

diff --git a/src/doc/doc/images/drc_edge_modes1.png b/src/doc/doc/images/drc_edge_modes1.png new file mode 100644 index 000000000..f5270d944 Binary files /dev/null and b/src/doc/doc/images/drc_edge_modes1.png differ diff --git a/src/doc/doc/images/drc_edge_modes2.png b/src/doc/doc/images/drc_edge_modes2.png new file mode 100644 index 000000000..5005e888d Binary files /dev/null and b/src/doc/doc/images/drc_edge_modes2.png differ diff --git a/src/doc/doc/images/drc_edge_modes3.png b/src/doc/doc/images/drc_edge_modes3.png new file mode 100644 index 000000000..cbc9c978b Binary files /dev/null and b/src/doc/doc/images/drc_edge_modes3.png differ diff --git a/src/doc/doc/images/drc_edge_modes4.png b/src/doc/doc/images/drc_edge_modes4.png new file mode 100644 index 000000000..94cf50140 Binary files /dev/null and b/src/doc/doc/images/drc_edge_modes4.png differ diff --git a/src/doc/doc/images/drc_edge_modes5.png b/src/doc/doc/images/drc_edge_modes5.png new file mode 100644 index 000000000..706c18fa4 Binary files /dev/null and b/src/doc/doc/images/drc_edge_modes5.png differ diff --git a/src/doc/doc/images/drc_edge_modes6.png b/src/doc/doc/images/drc_edge_modes6.png new file mode 100644 index 000000000..e90b4380f Binary files /dev/null and b/src/doc/doc/images/drc_edge_modes6.png differ diff --git a/src/doc/docDRCLVSResources.qrc b/src/doc/docDRCLVSResources.qrc index e91766fe5..acf5f25a2 100644 --- a/src/doc/docDRCLVSResources.qrc +++ b/src/doc/docDRCLVSResources.qrc @@ -54,6 +54,12 @@ doc/images/drc_extended2.png doc/images/drc_extended3.png doc/images/drc_extended4.png + doc/images/drc_edge_modes1.png + doc/images/drc_edge_modes2.png + doc/images/drc_edge_modes3.png + doc/images/drc_edge_modes4.png + doc/images/drc_edge_modes5.png + doc/images/drc_edge_modes6.png doc/images/drc_extents1.png doc/images/drc_extents2.png doc/images/drc_inside.png diff --git a/src/drc/drc/built-in-macros/_drc_complex_ops.rb b/src/drc/drc/built-in-macros/_drc_complex_ops.rb index 23b5b13b5..9950da2e9 100644 --- a/src/drc/drc/built-in-macros/_drc_complex_ops.rb +++ b/src/drc/drc/built-in-macros/_drc_complex_ops.rb @@ -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)) diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index fe89bb036..5d0409e2a 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -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"