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 EdgePairnewDefault constructor
new EdgePairnew(const Edge arg1,
const Edge arg2)
Constructor from two edges

Public methods

[const]voidassign(const EdgePair other)Assign the contents of another object to self
[const]BoxbboxGets the bounding box of the edge pair
voidcreateEnsures the C++ object is created
voiddestroyExplicitly destroy the object
[const]booldestroyed?Returns a value indicating whether the object was already destroyed
[const]EdgePairdupCreates a copy of self
[const]EdgefirstGets the first edge
voidfirst=(const Edge edge)Sets the first edge
[const]boolis_const_object?Returns a value indicating whether the reference is a const reference
[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]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

EdgePairfrom_dedge_pair(const DEdgePair double_edge_pair)Construct an integer coordinate edge pair from a floating-point coordinate edge pair
new EdgePairfrom_s(string s)Creates an object from a string

Detailed description

[const] void assign(const EdgePair other)

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] Box bbox

Description: Gets the bounding box of the edge pair

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.

void destroy

Description: Explicitly destroy the object

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

[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.

[const] EdgePair dup

Description: Creates a copy of self

[const] Edge first

Description: Gets the first edge

void first=(const Edge edge)

Description: Sets the first edge

[static] EdgePair from_dedge_pair(const DEdgePair double_edge_pair)

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

Create a integer coordinate edge pair from a floating-point coordinate edge pair

[static] new EdgePair 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.

[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.

[static] new EdgePair new

Description: Default constructor

This constructor creates an default edge pair.

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

Description: Constructor from two edges

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

[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.

[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.

[const] Edge second

Description: Gets the second edge

void second=(const Edge edge)

Description: Sets the second edge

[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.

[const] string to_s

Description: Returns a string representing the edge pair

[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.

[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.

[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.