API reference - Class EdgePair

Notation used in Ruby API documentation

Description: An edge pair (a pair of two edges)

Edge pairs are objects representing two edges or parts of edges. They play a role mainly in the context of DRC functions, where they specify a DRC violation by connecting two edges which violate the condition checked. Within the framework of polygon and edge collections which provide DRC functionality, edges pairs are used in the form of edge pair collections (EdgePairs).

Edge pairs basically consist of two edges, called first and second. If created by a two-layer DRC function, the first edge will correspond to edges from the first layer and the second to edges from the second layer.

This class has been introduced in version 0.23.

Public constructors

new EdgePair ptrnew(const DEdgePair dedge_pair)Creates an integer coordinate edge pair from a floating-point coordinate edge pair
new EdgePair ptrnewDefault constructor
new EdgePair ptrnew(const Edge arg1,
const Edge arg2)
Constructor from two edges

Public methods

[const]bool!=(const EdgePair box)Inequality
[const]bool<(const EdgePair box)Less operator
[const]bool==(const EdgePair box)Equality
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
voidassign(const EdgePair other)Assigns another object to self
[const]BoxbboxGets the bounding box of the edge pair
[const]new EdgePair ptrdupCreates a copy of self
[const]EdgefirstGets the first edge
voidfirst=(const Edge edge)Sets the first edge
[const]unsigned longhashComputes a hash value
[const]EdgePairnormalizedNormalizes the edge pair
[const]Polygonpolygon(int e The enlargement (set to zero for exact representation))Convert an edge pair to a polygon
[const]EdgesecondGets the second edge
voidsecond=(const Edge edge)Sets the second edge
[const]SimplePolygonsimple_polygon(int e The enlargement (set to zero for exact representation))Convert an edge pair to a simple polygon
[const]DEdgePairto_dtype(double dbu = 1)Converts the edge pair to a floating-point coordinate edge pair
[const]stringto_sReturns a string representing the edge pair
[const]EdgePairtransformed(const ICplxTrans t)Returns the transformed edge pair
[const]EdgePairtransformed(const Trans t)Returns the transformed pair
[const]DEdgePairtransformed(const CplxTrans t)Returns the transformed edge pair

Public static methods and constants

new EdgePair ptrfrom_s(string s)Creates an object from a string

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead

Detailed description

!=

Signature: [const] bool != (const EdgePair box)

Description: Inequality

Returns true, if this edge pair and the given one are not equal

This method has been introduced in version 0.25.

<

Signature: [const] bool < (const EdgePair box)

Description: Less operator

Returns true, if this edge pair is 'less' with respect to first and second edge

This method has been introduced in version 0.25.

==

Signature: [const] bool == (const EdgePair box)

Description: Equality

Returns true, if this edge pair and the given one are equal

This method has been introduced in version 0.25.

_create

Signature: void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

_destroy

Signature: void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

_destroyed?

Signature: [const] bool _destroyed?

Description: Returns a value indicating whether the object was already destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

_is_const_object?

Signature: [const] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

_manage

Signature: void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

_unmanage

Signature: void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

assign

Signature: void assign (const EdgePair other)

Description: Assigns another object to self

bbox

Signature: [const] Box bbox

Description: Gets the bounding box of the edge pair

create

Signature: void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

destroy

Signature: void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

destroyed?

Signature: [const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

dup

Signature: [const] new EdgePair ptr dup

Description: Creates a copy of self

first

Signature: [const] Edge first

Description: Gets the first edge

Python specific notes:
The object exposes a readable attribute 'first'. This is the getter.

first=

Signature: void first= (const Edge edge)

Description: Sets the first edge

Python specific notes:
The object exposes a writable attribute 'first'. This is the setter.

from_s

Signature: [static] new EdgePair ptr from_s (string s)

Description: Creates an object from a string

Creates the object from a string representation (as returned by to_s)

This method has been added in version 0.23.

hash

Signature: [const] unsigned long hash

Description: Computes a hash value

Returns a hash value for the given edge pair. This method enables edge pairs as hash keys.

This method has been introduced in version 0.25.

Python specific notes:
This method is also available as 'hash(object)'

is_const_object?

Signature: [const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

new

Signature: [static] new EdgePair ptr new (const DEdgePair dedge_pair)

Description: Creates an integer coordinate edge pair from a floating-point coordinate edge pair

This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge_pair'.

Python specific notes:
This method is the default initializer of the object

Signature: [static] new EdgePair ptr new

Description: Default constructor

This constructor creates an default edge pair.

Python specific notes:
This method is the default initializer of the object

Signature: [static] new EdgePair ptr new (const Edge arg1,const Edge arg2)

Description: Constructor from two edges

This constructor creates an edge pair from the two edges given.

Python specific notes:
This method is the default initializer of the object

normalized

Signature: [const] EdgePair normalized

Description: Normalizes the edge pair

This method normalized the edge pair such that when connecting the edges at their start and end points a closed loop is formed which is oriented clockwise. To achieve this, the points of the first and/or first and second edge are swapped. Normalization is a first step recommended before converting an edge pair to a polygon, because that way the polygons won't be self-overlapping and the enlargement parameter is applied properly.

polygon

Signature: [const] Polygon polygon (int e The enlargement (set to zero for exact representation))

Description: Convert an edge pair to a polygon

The polygon is formed by connecting the end and start points of the edges. It is recommended to use normalized before converting the edge pair to a polygon.

The enlargement parameter allows to apply the specified enlargement parallel and perpendicular to the edges. Basically this introduces a bias which blows up edge pairs by the specified amount. That parameter is useful to convert degenerated edge pairs to valid polygons, i.e. edge pairs with coincident edges and edge pairs consisting of two point-like edges.

Another version for converting edge pairs to simple polygons is simple_polygon which renders a SimplePolygon object.

second

Signature: [const] Edge second

Description: Gets the second edge

Python specific notes:
The object exposes a readable attribute 'second'. This is the getter.

second=

Signature: void second= (const Edge edge)

Description: Sets the second edge

Python specific notes:
The object exposes a writable attribute 'second'. This is the setter.

simple_polygon

Signature: [const] SimplePolygon simple_polygon (int e The enlargement (set to zero for exact representation))

Description: Convert an edge pair to a simple polygon

The polygon is formed by connecting the end and start points of the edges. It is recommended to use normalized before converting the edge pair to a polygon.

The enlargement parameter allows to apply the specified enlargement parallel and perpendicular to the edges. Basically this introduces a bias which blows up edge pairs by the specified amount. That parameter is useful to convert degenerated edge pairs to valid polygons, i.e. edge pairs with coincident edges and edge pairs consisting of two point-like edges.

Another version for converting edge pairs to polygons is polygon which renders a Polygon object.

to_dtype

Signature: [const] DEdgePair to_dtype (double dbu = 1)

Description: Converts the edge pair to a floating-point coordinate edge pair

The database unit can be specified to translate the integer-coordinate edge pair into a floating-point coordinate edge pair in micron units. The database unit is basically a scaling factor.

This method has been introduced in version 0.25.

to_s

Signature: [const] string to_s

Description: Returns a string representing the edge pair

Python specific notes:
This method is also available as 'str(object)' and 'repr(object)'

transformed

Signature: [const] EdgePair transformed (const ICplxTrans t)

Description: Returns the transformed edge pair

t:The transformation to apply.
Returns:The transformed edge pair (in this case an integer coordinate edge pair).

Transforms the edge pair with the given complex transformation. Does not modify the edge pair but returns the transformed edge.

Signature: [const] EdgePair transformed (const Trans t)

Description: Returns the transformed pair

t:The transformation to apply.
Returns:The transformed edge pair

Transforms the edge pair with the given transformation. Does not modify the edge pair but returns the transformed edge.

Signature: [const] DEdgePair transformed (const CplxTrans t)

Description: Returns the transformed edge pair

t:The transformation to apply.
Returns:The transformed edge pair

Transforms the edge pair with the given complex transformation. Does not modify the edge pair but returns the transformed edge.