DRC Reference: Layer Object

The layer object represents a collection of polygons, edges or edge pairs.

"&" - Boolean AND operation

Usage:

  • self & other

The method computes a boolean AND between self and other.

This method is available for polygon and edge layers. An alias is "and". See there for a description of the function.

"+" - Join layers

Usage:

  • self + other

The method includes the edges or polygons from the other layer into this layer. The "+" operator is an alias for the join method.

This method is available for polygon, edge and edge pair layers. An alias is "join". See there for a description of the function.

"-" - Boolean NOT operation

Usage:

  • self - other

The method computes a boolean NOT between self and other.

This method is available for polygon and edge layers. An alias is "not". See there for a description of the function.

"^" - Boolean XOR operation

Usage:

  • self ^ other

The method computes a boolean XOR between self and other.

This method is available for polygon and edge layers. An alias is "xor". See there for a description of the function.

"and" - Boolean AND operation

Usage:

  • layer.and(other)

The method computes a boolean AND between self and other. It is an alias for the "&" operator.

This method is available for polygon and edge layers. If the first operand is an edge layer and the second is an edge layer, the result will be the edges of the first operand which are inside or on the borders of the polygons of the second operand.

The following images show the effect of the "and" method on polygons and egdes (layer1: red, layer2: blue):

"area" - Returns the total area of the polygons in the region

Usage:

  • layer.area

This method requires a polygon layer. It returns the total area of all polygons in square micron. Merged semantics applies, i.e. before computing the area, the polygons are merged unless raw mode is chosen (see raw). Hence, in clean mode, overlapping polygons are not counted twice.

The returned value gives the area in square micrometer units.

"bbox" - Returns the overall bounding box of the layer

Usage:

  • layer.bbox

The return value is a DBox object giving the bounding box in micrometer units.

"centers" - Returns the center parts of the edges

Usage:

  • layer.centers(length)
  • layer.centers(length, fraction)

Similar to start_segments and end_segments, this method will return partial edges for each given edge in the input. For the description of the parameters see start_segments or end_segments.

The following images show the effect of the method:

"clean" - Marks a layer as clean

Usage:

  • layer.clean

A layer marked as clean will provide "merged" semantics, i.e. overlapping or touching polygons are considered as single polygons. Inner edges are removed and collinear edges are connected. Clean state is the default.

See raw for some remarks about how this state is propagated.

"data" - Gets the low-level data object

Usage:

  • layer.data

This method returns a Region, Edges or EdgePairs object representing the underlying RBA object for the data. Access to these objects is provided to support low-level iteration and manipulation of the layer's data.

"dup" - Duplicates a layer

Usage:

  • layer.dup

Duplicates the layer. This basically will create a copy and modifications of the original layer will not affect the duplicate. Please note that just assigning the layer to another variable will not create a copy but rather a pointer to the original layer. Hence modifications will then be visible on the original and derived layer. Using the dup method will avoid that.

However, dup will double the memory required to hold the data and performing the deep copy may be expensive in terms of CPU time.

"edge_pairs?" - Returns true, if the layer is an edge pair collection

Usage:

  • layer.edge_pairs?

"edges" - Decomposes the layer into single edges

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 polygons. This method returns an edge layer but will not modify the layer it is called on.

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

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

Usage:

  • layer.edges?

"enc" - An alias for "enclosing"

Usage:

  • layer.enc(value [, options])

See enclosing for a description of that method

"enclosing" - An enclosing check

Usage:

  • layer.enclosing(other_layer, value [, options])

This method checks whether layer encloses (is bigger than) other_layer by the given dimension. Locations, where this is not the case will be reported in form of edge pair error markers. Locations, where both edges coincide will be reported as errors as well. Formally such locations form an enclosure with a distance of 0. Locations, where other_layer extends outside layer will not be reported as errors. Such regions can be detected by not_inside or a boolean "not" operation.

The enclosing method can be applied to both edge or polygon layers. On edge layers the orientation of the edges matters and only edges looking into the same direction are checked.

As for the other DRC methods, merged semantics applies. The options available are the same than for width. Distance values can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

The following images show the effect of two enclosing checks (red: input1, blue: input2):

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

Usage:

  • layer.end_segments(length)
  • layer.end_segments(length, fraction)

This method will return a partial edge for each edge in the input, located and the end of the original edge. The new edges will share the end point with the original edges, but not necessarily their start point. This method applies to edge layers only. The direction of edges is defined by the clockwise orientation of a polygon: the end point of the edges will be the terminal point of each edge when walking a polygon in clockwise direction. Or in other words: when looking from start to the end point of an edge, the filled part of the polygon is to the right.

The length of the new edge can be given in two ways: as a fixed length, or a fraction, or both. In the latter case, the length of the resulting edge will be either the fraction or the fixed length, whichever is larger. To specify a length only, omit the fraction argument or leave it at 0. To specify a fraction only, pass 0 to the length argument and specify the fraction in the second parameter. A fraction of 0.5 will result in edges which cover the end half of the edge.

The following images show the effect of the method:

"extended" - Returns polygons describing an area along the edges of the input

Usage:

  • layer.extended([:begin => b,] [:end => e,] [:out => o,] [:in => i], [:joined => true])
  • layer.extended(b, e, o, i)
  • layer.extended(b, e, o, i, joined)

This method is available for edge layers only. It will create a polygon for each edge tracing the edge with certain offsets to the edge. "o" is the offset applied to the outer side of the edge, "i" is the offset applied to the inner side of the edge. "b" is the offset applied at the beginning and "e" is the offset applied at the end.

When looking from start to end point, the "inside" side is to the right, while the "outside" side is to the left.

"joined" is a flag, which, if present, will make connected edges behave as a continuous line. Start and end offsets are applied to the first and last unconnected point respectively. Please note that in order to specify joined mode, you'll need to specify "joined" as a keyword in the third form of the method.

The following images show the effects of some parameters:

"extended_in" - Returns polygons describing an area along the edges of the input

Usage:

  • layer.extended_in(d)

This method applies to edge layers only. Polygons are generated for each edge describing the edge drawn with a certain width extending into the "inside" (the right side when looking from start to end). This method is basically equivalent to the extended method: "extended(0, 0, 0, dist)". A version extending to the outside is extended_out.

"extended_out" - Returns polygons describing an area along the edges of the input

Usage:

  • layer.extended_out(d)

This method applies to edge layers only. Polygons are generated for each edge describing the edge drawn with a certain width extending into the "outside" (the left side when looking from start to end). This method is basically equivalent to the extended method: "extended(0, 0, dist, 0)". A version extending to the inside is extended_in.

"extents" - Returns the bounding box of each input object

Usage:

  • layer.extents([ enlargement ])

Applies to edge layers, polygon layers on edge pair collections. Returns a polygon layer consisting of boxes for each input object. The boxes enclose the original object.

Merged semantics applies, so the box encloses the merged polygons or edges unless raw mode is chosen (see raw).

The enlargement parameter specifies an optional enlargement which will make zero width/zero height object render valid polygons (i.e. horizontal/vertical edges).

The following images show the effect of the extents method:

"first_edges" - Returns the first edges of an edge pair collection

Usage:

  • layer.first_edges

Applies to edge pair collections only. Returns the first edges of the edge pairs in the collection.

"holes" - Selects all polygon holes from the input

Usage:

  • layer.holes

This method is available for polygon layers. It will create polygons from all holes inside polygons of the input. Although it is possible, running this method on raw polygon layers will usually not render the expected result, since raw layers do not contain polygons with holes in most cases.

The following image shows the effects of the holes method:

"hulls" - Selects all polygon hulls from the input

Usage:

  • layer.hulls

This method is available for polygon layers. It will remove all holes from the input and render the hull polygons only. Although it is possible, running this method on raw polygon layers will usually not render the expected result, since raw layers do not contain polygons with holes in most cases.

The following image shows the effects of the hulls method:

"in" - Selects shapes or regions of self which are contained in the other layer

Usage:

  • layer.in(other)

This method selects all shapes or regions from self which are contained the other region exactly. It will use individual shapes from self or other if the respective region is in raw mode. If not, it will use coherent regions or combined edges from self or other.

It will return a new layer containing the selected shapes. A method which selects all shapes not contained in the other layer is not_in.

This method is available for polygon and edge layers.

The following image shows the effect of the "in" method (input1: red, input2: blue):

"insert" - Inserts one or many objects into the layer

Usage:

  • insert(object, object ...)

Objects that can be inserted are Edge objects (into edge layers) or DPolygon, DSimplePolygon, Path, DBox (into polygon layers). Convenience methods exist to create such objects (global#edge, global#polygon, global#box and #global#path). However, RBA constructors can used as well.

The insert method is useful in combination with the global#polygon_layer or global#edge_layer functions:

el = edge_layer
el.insert(edge(0.0, 0.0, 100.0, 0.0)

pl = polygon_layer
pl.insert(box(0.0, 0.0, 100.0, 200.0)

"inside" - Selects shapes or regions of self which are inside the other region

Usage:

  • layer.inside(other)

This method selects all shapes or regions from self which are inside the other region. completely (completely covered by polygons from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may be outside the other region. It returns a new layer containing the selected shapes. A version which modifies self is select_inside.

This method is available for polygon layers.

The following image shows the effect of the "inside" method (input1: red, input2: blue):

"inside_part" - Returns the parts of the edges inside the given region

Usage:

  • layer.inside_part(region)

This method returns the parts of the edges which are inside the given region. This is similar to the "&" operator, but this method does not return edges that are exactly on the boundaries of the polygons of the region.

This method is available for edge layers. The argument must be a polygon layer.

"interacting" - Selects shapes or regions of self which touch or overlap shapes from the other region

Usage:

  • layer.interacting(other)

This method selects all shapes or regions from self which touch or overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It returns a new layer containing the selected shapes. A version which modifies self is select_interacting.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

The following image shows the effect of the "interacting" method (input1: red, input2: blue):

"is_box?" - Returns true, if the region contains a single box

Usage:

  • layer.is_box?

The method returns true, if the region consists of a single box only. Merged semantics does not apply - if the region forms a box which is composed of multiple pieces, this method will not return true.

"is_clean?" - Returns true, if the layer is clean state

Usage:

  • layer.is_clean?

See clean for a discussion of the clean state.

"is_empty?" - Returns true, if the layer is empty

Usage:

  • layer.is_empty?

"is_merged?" - Returns true, if the polygons of the layer are merged

Usage:

  • layer.is_merged?

This method will return true, if the polygons of this layer are merged, i.e. they don't overlap and form single continuous polygons. In clean mode, this is ensured implicitly. In raw mode (see raw), merging can be achieved by using the merge method. is_merged? tells, whether calling merge is necessary.

"is_raw?" - Returns true, if the layer is raw state

Usage:

  • layer.is_raw?

See clean for a discussion of the raw state.

"iso" - An alias for "isolated"

Usage:

  • layer.iso(value [, options])

See isolated for a description of that method

"isolated" - An isolation check

Usage:

  • layer.isolated(value [, options])

See space for a description of this method. In contrast to space, this method is available for polygon layers only, since only on such layers different polygons can be identified.

The following image shows the effect of the isolated check:

"join" - Joins the layer with another layer

Usage:

  • layer.join(other)

The method includes the edges or polygons from the other layer into this layer. It is an alias for the "+" operator.

This method is available for polygon, edge and edge pair layers.

The following images show the effect of the "join" method on polygons and egdes (layer1: red, layer2: blue):

"length" - Returns the total length of the edges in the edge layer

Usage:

  • layer.length

This method requires an edge layer. It returns the total length of all edges in micron. Merged semantics applies, i.e. before computing the length, the edges are merged unless raw mode is chosen (see raw). Hence in clean mode (see clean), overlapping edges are not counted twice.

"merge" - Merges the layer (modifies the layer)

Usage:

  • layer.merge([overlap_count])

Like merged, but modifies the input and returns a reference to the new layer.

"merged" - Returns the merged layer

Usage:

  • layer.merged([overlap_count])

Returns the merged input. Usually, merging is done implicitly using the clean state (which is default). However, in raw state, merging can be enforced by using this method. In addition, this method allows specification of a minimum overlap count, i.e. only where at least the given number of polygons overlap, output is produced. See sized for an application of that.

This method works both on edge or polygon layers. Edge merging forms single, continuous edges from coincident and connected individual edges.

A version that modifies the input layer is merge.

The following images show the effect of various forms of the "merged" method:

"move" - Moves (shifts, translates) a layer (modifies the layer)

Usage:

  • layer.move(dx, dy)

Moved the input by the given distance. The layer that this method is called upon is modified and the modified version is returned for further processing.

Shift distances can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

"moved" - Moves (shifts, translates) a layer

Usage:

  • layer.moved(dx, dy)

Moves the input layer by the given distance (x, y) and returns the moved layer. The layer that this method is called upon is not modified.

Shift distances can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

The following images shows the effect of the "moved" method:

"non_rectangles" - Selects all polygons from the input which are not rectangles

Usage:

  • layer.non_rectangles

This method is available for polygon layers. By default "merged" semantics applies, i.e. all polygons are merged before non-rectangles are selected (see clean and raw).

"non_rectilinear" - Selects all non-rectilinear polygons from the input

Usage:

  • layer.non_rectilinear

This method is available for polygon layers. By default "merged" semantics applies, i.e. all polygons are merged before non-rectilinear polygons are selected (see clean and raw).

"non_strict" - Marks a layer for non-strict handling

Usage:

  • layer.non_strict

See strict for details about this option.

This feature has been introduced in version 0.23.2.

"not" - Boolean NOT operation

Usage:

  • layer.not(other)

The method computes a boolean NOT between self and other. It is an alias for the "-" operator.

This method is available for polygon and edge layers. If the first operand is an edge layer and the second is an edge layer, the result will be the edges of the first operand which are outside the polygons of the second operand.

The following images show the effect of the "not" method on polygons and egdes (layer1: red, layer2: blue):

"not_in" - Selects shapes or regions of self which are not contained in the other layer

Usage:

  • layer.not_in(other)

This method selects all shapes or regions from self which are not contained the other region exactly. It will use individual shapes from self or other if the respective region is in raw mode. If not, it will use coherent regions or combined edges from self or other.

It will return a new layer containing the selected shapes. A method which selects all shapes contained in the other layer is in.

This method is available for polygon and edge layers.

The following image shows the effect of the "not_in" method (input1: red, input2: blue):

"not_inside" - Selects shapes or regions of self which are not inside the other region

Usage:

  • layer.not_inside(other)

This method selects all shapes or regions from self which are not inside the other region. completely (completely covered by polygons from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may be outside the other region. It returns a new layer containing the selected shapes. A version which modifies self is select_not_inside.

This method is available for polygon layers.

The following image shows the effect of the "not_inside" method (input1: red, input2: blue):

"not_interacting" - Selects shapes or regions of self which do not touch or overlap shapes from the other region

Usage:

  • layer.not_interacting(other)

This method selects all shapes or regions from self which do not touch or overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It returns a new layer containing the selected shapes. A version which modifies self is select_not_interacting.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

The following image shows the effect of the "not_interacting" method (input1: red, input2: blue):

"not_outside" - Selects shapes or regions of self which are not outside the other region

Usage:

  • layer.not_outside(other)

This method selects all shapes or regions from self which are not completely outside the other region (part of these shapes or regions may be covered by shapes from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may overlap with shapes from the other region. It returns a new layer containing the selected shapes. A version which modifies self is select_not_outside.

This method is available for polygon layers.

The following image shows the effect of the "not_outside" method (input1: red, input2: blue):

"not_overlapping" - Selects shapes or regions of self which do not overlap shapes from the other region

Usage:

  • layer.not_overlapping(other)

This method selects all shapes or regions from self which do not overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected.

The "not_overlapping" method is equivalent to the outside method. It is provided as an alias for consistency.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons. It returns a new layer containing the selected shapes. A version which modifies self is select_not_overlapping.

"notch" - An intra-region spacing check

Usage:

  • layer.notch(value [, options])

See space for a description of this method. In contrast to space, this method is available for polygon layers only, since only on such layers different polygons can be identified.

The following image shows the effect of the notch check:

"odd_polygons" - Checks for odd polygons (self-overlapping, non-orientable)

Usage:

  • layer.odd_polygons

Returns the parts of the polygons which are not orientable (i.e. "8" configuration) or self-overlapping. Merged semantics does not apply for this method. Always the raw polygons are taken (see raw).

"ongrid" - Checks for on-grid vertices

Usage:

  • layer.ongrid(g)
  • layer.ongrid(gx, gy)

Returns a single-vertex marker for each vertex whose x coordinate is not a multiple of g or gx or whose y coordinate is not a multiple of g or gy. The single-vertex markers are edge pair objects which describe a single point. When setting the grid to 0, no grid check is performed in that specific direction.

This method requires a polygon layer. Merged semantics applies (see raw and clean).

"or" - Boolean OR operation

Usage:

  • layer.or(other)

The method computes a boolean OR between self and other. It is an alias for the "|" operator.

This method is available for polygon and edge layers.

The following images show the effect of the "or" method on polygons and egdes (layer1: red, layer2: blue):

"output" - Output the content of the layer

Usage:

  • layer.output(specs)

This method will output the content of the layer to the specified output.

If a report database is selected for the output, the specification has to include a category name and optionally a category description.

If the layout is selected for the output, the specification can consist of one to three parameters: a layer number, a data type (optional, default is 0) and a layer name (optional).

See global#report and global#target on how to configure output to a target layout or report database.

"outside" - Selects shapes or regions of self which are outside the other region

Usage:

  • layer.outside(other)

This method selects all shapes or regions from self which are completely outside the other region (no part of these shapes or regions may be covered by shapes from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may overlap with shapes from the other region. It returns a new layer containing the selected shapes. A version which modifies self is select_outside.

This method is available for polygon layers.

The following image shows the effect of the "outside" method (input1: red, input2: blue):

"outside_part" - Returns the parts of the edges outside the given region

Usage:

  • layer.outside_part(region)

This method returns the parts of the edges which are outside the given region. This is similar to the "&" operator, but this method does not remove edges that are exactly on the boundaries of the polygons of the region.

This method is available for edge layers. The argument must be a polygon layer.

"overlap" - An overlap check

Usage:

  • layer.overlap(other_layer, value [, options])

This method checks whether layer and other_layer overlap by at least the given length. Locations, where this is not the case will be reported in form of edge pair error markers. Locations, where both layers touch will be reported as errors as well. Formally such locations form an overlap with a value of 0. Locations, where both regions do not overlap or touch will not be reported. Such regions can be detected with outside or by a boolean "not".

Formally, the overlap method is a two-layer width check. In contrast to the single- layer width method (width), the zero value also triggers an error and separate polygons are checked against each other, while for the single-layer width, only single polygons are considered.

The overlap method can be applied to both edge or polygon layers. On edge layers the orientation of the edges matters: only edges which run back to back with their inside side pointing towards each other are checked for distance.

As for the other DRC methods, merged semantics applies. The options available are the same than for width. Distance values can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

The following images show the effect of the overlap check (layer1: red, layer2: blue):

"overlapping" - Selects shapes or regions of self which overlap shapes from the other region

Usage:

  • layer.overlapping(other)

This method selects all shapes or regions from self which overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It returns a new layer containing the selected shapes. A version which modifies self is select_overlapping.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

The following image shows the effect of the "overlapping" method:

"perimeter" - Returns the total perimeter of the polygons in the region

Usage:

  • layer.perimeter

This method requires a polygon layer. It returns the total perimeter of all polygons in micron. Merged semantics applies, i.e. before computing the perimeter, the polygons are merged unless raw mode is chosen (see raw).

The returned value gives the perimeter in micrometer units.

"polygons" - Returns polygons from edge pairs

Usage:

  • layer.polygons([ enlargement ])

This method applies to edge pair collections. The edge pairs will be converted into polygons connecting the edges the edge pairs are made of. In order to properly handle special edge pairs (coincident edges, point-like edges etc.) an enlargement parameter can be specified which will make the resulting polygon somewhat larger than the original edge pair. If the enlargement parameter is 0, special edge pairs with an area of 0 will be dropped.

"polygons?" - Returns true, if the layer is a polygon layer

Usage:

  • layer.polygons?

"raw" - Marks a layer as raw

Usage:

  • layer.raw

A raw layer basically is the opposite of a "clean" layer (see clean). Polygons on a raw layer are considered "as is", i.e. overlapping polygons are not connected and inner edges may occur due to cut lines. Holes may not exists if the polygons are derived from a representation that does not allow holes (i.e. GDS2 files).

Note that this method will set the state of the layer. In combination with the fact, that copied layers are references to the original layer, this may lead to unexpected results:

l = ...
l2 = l1
... do something
l.raw
# now l2 is also a raw layer

To avoid that, use the dup method to create a real (deep) copy.

"rectangles" - Selects all rectangle polygons from the input

Usage:

  • layer.rectangles

This method is available for polygon layers. By default "merged" semantics applies, i.e. all polygons are merged before rectangles are selected (see clean and raw). non_rectangles will select all non-rectangles.

"rectilinear" - Selects all rectilinear polygons from the input

Usage:

  • layer.rectilinear

This method is available for polygon layers. By default "merged" semantics applies, i.e. all polygons are merged before rectilinear polygons are selected (see clean and raw). non_rectilinear will select all non-rectangles.

"rotate" - Rotates a layer (modifies the layer)

Usage:

  • layer.rotate(a)

Rotates the input by the given angle (in degree). The layer that this method is called upon is modified and the modified version is returned for further processing.

"rotated" - Rotates a layer

Usage:

  • layer.rotated(a)

Rotates the input layer by the given angle (in degree) and returns the rotated layer. The layer that this method is called upon is not modified.

The following image shows the effect of the "rotated" method:

"rounded_corners" - Applies corner rounding to each corner of the polygon

Usage:

  • layer.rounded_corners(inner, outer, n)

Inner (concave) corners are replaced by circle segments with a radius given by the "inner" parameter. Outer (convex) corners are relaced by circle segments with a radius given by the "outer" parameter.

The circles are approximated by polygons. "n" segments are used to approximate a full circle.

This method return a layer wit the modified polygons. Merged semantics applies for this method (see raw and clean).

The following image shows the effect of the "rounded_corners" method. The upper ends of the vertical bars are rounded with a smaller radius automatically because their width does not allow a larger radius.

"scale" - Scales a layer (modifies the layer)

Usage:

  • layer.scale(f)

Scales the input. After scaling, features have a f times bigger dimension. The layer that this method is called upon is modified and the modified version is returned for further processing.

"scaled" - Scales a layer

Usage:

  • layer.scaled(f)

Scales the input layer and returns a new layer whose features have a f times bigger dimension. The layer that this method is called upon is not modified.

The following images shows the effect of the "scaled" method:

"second_edges" - Returns the second edges of an edge pair collection

Usage:

  • layer.second_edges

Applies to edge pair collections only. Returns the second edges of the edge pairs in the collection.

"select_inside" - Selects shapes or regions of self which are inside the other region

Usage:

  • layer.select_inside(other)

This method selects all shapes or regions from self which are inside the other region. completely (completely covered by polygons from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may be outside the other region. It modifies self to contain the selected shapes. A version which does not modify self is inside.

This method is available for polygon layers.

"select_interacting" - Selects shapes or regions of self which touch or overlap shapes from the other region

Usage:

  • layer.select_interacting(other)

This method selects all shapes or regions from self which touch or overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It modifies self to contain the selected shapes. A version which does not modify self is interacting.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

"select_not_inside" - Selects shapes or regions of self which are not inside the other region

Usage:

  • layer.select_not_inside(other)

This method selects all shapes or regions from self which are not inside the other region. completely (completely covered by polygons from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may be outside the other region. It modifies self to contain the selected shapes. A version which does not modify self is not_inside.

This method is available for polygon layers.

"select_not_interacting" - Selects shapes or regions of self which do not touch or overlap shapes from the other region

Usage:

  • layer.select_interacting(other)

This method selects all shapes or regions from self which do not touch or overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It modifies self to contain the selected shapes. A version which does not modify self is not_interacting.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

"select_not_outside" - Selects shapes or regions of self which are not outside the other region

Usage:

  • layer.select_not_outside(other)

This method selects all shapes or regions from self which are not completely outside the other region (part of these shapes or regions may be covered by shapes from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may overlap with shapes from the other region. It modifies self to contain the selected shapes. A version which does not modify self is not_outside.

This method is available for polygon layers.

"select_not_overlapping" - Selects shapes or regions of self which do not overlap shapes from the other region

Usage:

  • layer.select_not_overlapping(other)

This method selects all shapes or regions from self which do not overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It modifies self to contain the selected shapes. A version which does not modify self is not_overlapping.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

"select_outside" - Selects shapes or regions of self which are outside the other region

Usage:

  • layer.select_outside(other)

This method selects all shapes or regions from self which are completely outside the other region (no part of these shapes or regions may be covered by shapes from the other region). If self is in raw mode, this method will select individual shapes. Otherwise, this method will select coherent regions and no part of these regions may overlap with shapes from the other region. It modifies self to contain the selected shapes. A version which does not modify self is outside.

This method is available for polygon layers.

"select_overlapping" - Selects shapes or regions of self which overlap shapes from the other region

Usage:

  • layer.select_overlapping(other)

This method selects all shapes or regions from self which overlap shapes from the other region. If self is in raw mode (see raw), coherent regions are selected from self, otherwise individual shapes are selected. It modifies self to contain the selected shapes. A version which does not modify self is overlapping.

This method is available for polygon and edge layers. Edges can be selected with respect to other edges or polygons.

"sep" - An alias for "separation"

Usage:

  • layer.sep(value [, options])

See separation for a description of that method

"separation" - A two-layer spacing check

Usage:

  • layer.separation(other_layer, value [, options])

This method performs a two-layer spacing check. Like space, this method can be applied to edge or polygon layers. Locations where edges of the layer are closer than the specified distance to the other layer are reported as edge pair error markers.

In contrast to the space and related methods, locations where both layers touch are also reported. More specifically, the case of zero spacing will also trigger an error while for space it will not.

As for the other DRC methods, merged semantics applies. The options available are the same than for width. Distance values can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

The following image shows the effect of the separation check (layer1: red, layer2: blue):

"size" - Polygon sizing (per-edge biasing, modifies the layer)

Usage:

  • layer.size(d [, mode])
  • layer.size(dx, dy [, mode]))

See sized. The size method basically does the same but modifies the layer it is called on. The input layer is returned and available for further processing.

"sized" - Polygon sizing (per-edge biasing)

Usage:

  • layer.sized(d [, mode])
  • layer.sized(dx, dy [, mode]))

This method requires a polygon layer. It will apply a bias per edge of the polygons and return the biased layer. The layer that this method is called on is not modified.

In the single-value form, that bias is applied both in horizontal or vertical direction. In the two-value form, the horizontal and vertical bias can be specified separately.

The mode defines how to handle corners. The following modes are available:

  • diamond_limit:This mode will connect the shifted edges without corner interpolation
  • octagon_limit:This mode will create octagon-shaped corners
  • square_limit:This mode will leave 90 degree corners untouched but cut off corners with a sharper angle. This is the default mode.
  • acute_limit:This mode will leave 45 degree corners untouched but cut off corners with a sharper angle
  • no_limit:This mode will not cut off (only at extremely sharp angles

Merged semantics applies, i.e. polygons will be merged before the sizing is applied unless the layer was put into raw mode (see raw). On output, the polygons are not merged immediately, so it is possible to detect overlapping regions after a positive sizing using raw and merged with an overlap count, for example:

layer.sized(300.nm).raw.merged(2)

Bias values can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

size is working like sized but modifies the layer it is called on.

The following images show the effect of various forms of the "sized" method:

"snap" - Brings each vertex on the given grid (g or gx/gy for x or y direction)

Usage:

  • layer.snap(g)
  • layer.snap(gx, gy)

Shifts each off-grid vertex to the nearest on-grid location. If one grid is given, this grid is applied to x and y coordinates. If two grids are given, gx is applied to the x coordinates and gy is applied to the y coordinates. If 0 is given as a grid, no snapping is performed in that direction.

This method modifies the layer. A version that returns a snapped version of the layer without modifying the layer is snapped.

This method requires a polygon layer. Merged semantics applies (see raw and clean).

"snapped" - Returns a snapped version of the layer

Usage:

  • layer.snapped(g)
  • layer.snapped(gx, gy)

See snap for a description of the functionality. In contrast to snap, this method does not modify the layer but returns a snapped copy.

"space" - A space check

Usage:

  • layer.space(value [, options])

This method performs a space check and returns a collection of edge pairs. A space check can be performed on polygon and edge layers. On edge layers, all edges are checked against all other edges. If two edges form a "face to face" relation (i.e. their outer sides face each other) and their distance is less than the specified value, an error shape is generated for that edge pair. On polygon layers, the polygons on each layer are checked for space against other polygons for locations where their space is less than the specified value. In that case, an edge pair error shape is generated. The space check will also check the polygons for space violations against themselves, i.e. notches violating the space condition are reported.

The notch method is similar, but will only report self-space violations. The isolated method will only report space violations to other polygons. separation is a two-layer space check where space is checked against polygons of another layer.

The options available are the same than for the width method. Like for the width method, merged semantics applies. Distance values can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators.

The following image shows the effect of the space check:

"start_segments" - Returns the part at the beginning of each edge

Usage:

  • layer.start_segments(length)
  • layer.start_segments(length, fraction)

This method will return a partial edge for each edge in the input, located and the end of the original edge. The new edges will share the start point with the original edges, but not necessarily their end points. For further details about the orientation of edges and the parameters of this method, see end_segments.

The following images show the effect of the method:

"strict" - Marks a layer for strict handling

Usage:

  • layer.strict

If a layer is marked for strict handling, some optimizations are disabled. Specifically for boolean operations, the results will also be merged if one input is empty. For boolean operations, strict handling should be enabled for both inputs. Strict handling is disabled by default.

See non_strict about how to reset this mode.

This feature has been introduced in version 0.23.2.

"strict?" - Returns true, if strict handling is enabled for this layer

Usage:

  • layer.is_strict?

See strict for a discussion of strict handling.

This feature has been introduced in version 0.23.2.

"transform" - Transforms a layer (modifies the layer)

Usage:

  • layer.transform(t)

Like transform, but modifies the input and returns a reference to it for further processing.

"transformed" - Transforms a layer

Usage:

  • layer.transformed(t)

Transforms the input layer by the given transformation and returns the moved layer. The layer that this method is called upon is not modified. This is the most generic method is transform a layer. The transformation is a DCplxTrans object which describes many different kinds of affine transformations except shear and anisotropic magnification.

The following image shows the effect of the "moved" method:

"width" - A width check

Usage:

  • layer.width(value [, options])

This method performs a width check and returns a collection of edge pairs. A width check can be performed on polygon and edge layers. On edge layers, all edges are checked against all other edges. If two edges form a "back to back" relation (i.e. their inner sides face each other) and their distance is less than the specified value, an error shape is generated for that edge pair. On polygon layers, the polygons on each layer are checked for locations where their width is less than the specified value. In that case, an edge pair error shape is generated.

The options available are:

  • euclidian: perform the check using Euclidian metrics (this is the default)
  • square: perform the check using Square metrics
  • projection: perform the check using projection metrics
  • whole_edges: With this option, the check will return all of the edges, even if the criterion is violated only over a part of the edge
  • angle_limit(a): Specifies the angle above or equal to which no check is performed. The default value is 90, which means that for edges having an angle of 90 degree or more, no check is performed. Setting this value to 45 will make the check only consider edges enclosing angles of less than 45 degree.
  • projection_limits(min, max) or projection_limits(min .. max): this option makes the check only consider edge pairs whose projected length on each other is more or equal than min and less than max

Note that without the angle_limit, acute corners will always be reported, since two connected edges always violate the width in the corner. By adjusting the angle_limit, an acute corner check can be implemented.

Merge semantics applies to this method, i.e. disconnected polygons are merged before the width is checked unless "raw" mode is chosen.

The resulting edge pairs can be converted to polygons using the polygons method.

Distance values can be given as floating-point values (in micron) or integer values (in database units). To explicitly specify the unit, use the unit denominators, i.e.

# width check for 1.5 micron:
markers = in.width(1.5)
# width check for 2 database units:
markers = in.width(2)
# width check for 2 micron:
markers = in.width(2.um)
# width check for 20 nanometers:
markers = in.width(20.nm)

The following images show the effect of various forms of the width check:

"with_angle" - Selects edges by their angle

Usage:

  • layer.with_angle(min .. max)
  • layer.with_angle(value)
  • layer.with_angle(min, max)

When called on an edge layer, the method selects edges by their angle, measured against the horizontal axis in the mathematical sense. The first version selects edges with a angle larger or equal to min and less than max (but not equal). The second version selects edges with exactly the given angle. The third version is identical to the first one.

When called on a polygon layer, this method selects corners which match the given angle or is within the given angle interval. The angle is measured between the edges forming the corner. For each corner, an edge pair containing the edges forming in the angle is returned.

A method delivering all objects not matching the angle criterion is without_angle.

The following images demonstrate some use cases of with_angle and without_angle:

"with_area" - Selects polygons by area

Usage:

  • layer.with_area(min .. max)
  • layer.with_area(value)
  • layer.with_area(min, max)

The first form will select all polygons with an area larger or equal to min and less (but not equal to) max. The second form will select the polygons with exactly the given area. The third form basically is equivalent to the first form, but allows specification of nil for min or max indicating no lower or upper limit.

"with_bbox_height" - Selects polygons by the height of the bounding box

Usage:

  • layer.with_bbox_height(min .. max)
  • layer.with_bbox_height(value)
  • layer.with_bbox_height(min, max)

The method selects polygons similar to with_area or with_perimeter. However, the measured dimension is the width of the bounding box.

This method is available for polygon layers only.

"with_bbox_max" - Selects polygons by the maximum dimension of the bounding box

Usage:

  • layer.with_bbox_max(min .. max)
  • layer.with_bbox_max(value)
  • layer.with_bbox_max(min, max)

The method selects polygons similar to with_area or with_perimeter. However, the measured dimension is the maximum dimension of the bounding box. The maximum dimension is either the width or height of the bounding box, whichever is larger.

This method is available for polygon layers only.

"with_bbox_min" - Selects polygons by the minimum dimension of the bounding box

Usage:

  • layer.with_bbox_min(min .. max)
  • layer.with_bbox_min(value)
  • layer.with_bbox_min(min, max)

The method selects polygons similar to with_area or with_perimeter. However, the measured dimension is the minimum dimension of the bounding box. The minimum dimension is either the width or height of the bounding box, whichever is smaller.

This method is available for polygon layers only.

"with_bbox_width" - Selects polygons by the width of the bounding box

Usage:

  • layer.with_bbox_width(min .. max)
  • layer.with_bbox_width(value)
  • layer.with_bbox_width(min, max)

The method selects polygons similar to with_area or with_perimeter. However, the measured dimension is the width of the bounding box.

This method is available for polygon layers only.

"with_length" - Selects edges by their length

Usage:

  • layer.with_length(min .. max)
  • layer.with_length(value)
  • layer.with_length(min, max)

The method selects edges by their length. The first version selected edges with a length larger or equal to min and less than max (but not equal). The second version selects edges with exactly the given length. The third version is similar to the first one, but allows specification of nil for min or max indicating that there is no lower or upper limit.

This method is available for edge layers only.

"with_perimeter" - Selects polygons by perimeter

Usage:

  • layer.with_perimeter(min .. max)
  • layer.with_perimeter(value)
  • layer.with_perimeter(min, max)

The first form will select all polygons with an perimeter larger or equal to min and less (but not equal to) max. The second form will select the polygons with exactly the given perimeter. The third form basically is equivalent to the first form, but allows specification of nil for min or max indicating no lower or upper limit.

This method is available for polygon layers only.

"without_angle" - Selects edges by the their angle

Usage:

  • layer.without_angle(min .. max)
  • layer.without_angle(value)
  • layer.without_angle(min, max)

The method basically is the inverse of with_angle. It selects all edges of the edge layer or corners of the polygons which do not have the given angle (second form) or whose angle is not inside the given interval (first and third form).

"without_area" - Selects polygons by area

Usage:

  • layer.without_area(min .. max)
  • layer.without_area(value)
  • layer.without_area(min, max)

This method is the inverse of "with_area". It will select polygons without an area equal to the given one or outside the given interval.

This method is available for polygon layers only.

"without_bbox_height" - Selects polygons by the height of the bounding box

Usage:

  • layer.without_bbox_height(min .. max)
  • layer.without_bbox_height(value)
  • layer.without_bbox_height(min, max)

The method selects polygons similar to without_area or without_perimeter. However, the measured dimension is the width of the bounding box.

This method is available for polygon layers only.

"without_bbox_max" - Selects polygons by the maximum dimension of the bounding box

Usage:

  • layer.without_bbox_max(min .. max)
  • layer.without_bbox_max(value)
  • layer.without_bbox_max(min, max)

The method selects polygons similar to without_area or without_perimeter. However, the measured dimension is the maximum dimension of the bounding box. The minimum dimension is either the width or height of the bounding box, whichever is larger.

This method is available for polygon layers only.

"without_bbox_min" - Selects polygons by the minimum dimension of the bounding box

Usage:

  • layer.without_bbox_min(min .. max)
  • layer.without_bbox_min(value)
  • layer.without_bbox_min(min, max)

The method selects polygons similar to without_area or without_perimeter. However, the measured dimension is the minimum dimension of the bounding box. The minimum dimension is either the width or height of the bounding box, whichever is smaller.

This method is available for polygon layers only.

"without_bbox_width" - Selects polygons by the width of the bounding box

Usage:

  • layer.without_bbox_width(min .. max)
  • layer.without_bbox_width(value)
  • layer.without_bbox_width(min, max)

The method selects polygons similar to without_area or without_perimeter. However, the measured dimension is the width of the bounding box.

This method is available for polygon layers only.

"without_length" - Selects edges by the their length

Usage:

  • layer.without_length(min .. max)
  • layer.without_length(value)
  • layer.without_length(min, max)

The method basically is the inverse of with_length. It selects all edges of the edge layer which do not have the given length (second form) or are not inside the given interval (first and third form).

This method is available for edge layers only.

"without_perimeter" - Selects polygons by perimeter

Usage:

  • layer.without_perimeter(min .. max)
  • layer.without_perimeter(value)
  • layer.without_perimeter(min, max)

This method is the inverse of "with_perimeter". It will select polygons without a perimeter equal to the given one or outside the given interval.

This method is available for polygon layers only.

"xor" - Boolean XOR operation

Usage:

  • layer.xor(other)

The method computes a boolean XOR between self and other. It is an alias for the "^" operator.

This method is available for polygon and edge layers.

The following images show the effect of the "xor" method on polygons and egdes (layer1: red, layer2: blue):

"|" - Boolean OR operation

Usage:

  • self | other

The method computes a boolean OR between self and other. A similar operation is join which will basically gives the same result but won't merge the shapes.

This method is available for polygon and edge layers. An alias is "or". See there for a description of the function.