API reference - Class Edges

Notation used in Ruby API documentation

Description: A collection of edges (Not necessarily describing closed contours)

This class was introduced to simplify operations on edges sets. See Edge for a description of the individual edge object. The edge collection contains an arbitrary number of edges and supports operations to select edges by various criteria, produce polygons from the edges by applying an extension, filtering edges against other edges collections and checking geometrical relations to other edges (DRC functionality).

The edge collection is supposed to work closely with the Region polygon set. Both are related, although the edge collection has a lower rank since it potentially represents a disconnected collection of edges. Edge collections may form closed contours, for example immediately after they have been derived from a polygon set using Region#edges. But this state is volatile and can easily be destroyed by filtering edges. Hence the connected state does not play an important role in the edge collection's API.

Edge collections may also contain points (degenerated edges with identical start and end points). Such point-like objects participate in some although not all methods of the edge collection class. Edge collections can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected edges are considered to belong together and are effectively merged. Overlapping parts are counted once in that mode. Dot-like edges are not considered in merged semantics. In raw mode (without merged semantics), each edge is considered as it is. Overlaps between edges may exists and merging has to be done explicitly using the merge method. The semantics can be selected using merged_semantics=.

This class has been introduced in version 0.23.

Public constructors

new Edges ptrnewDefault constructor
new Edges ptrnew(const Edge edge)Constructor from a single edge
new Edges ptrnew(Polygon[] array)Constructor from a polygon array
new Edges ptrnew(Edge[] array)Constructor from an egde array
new Edges ptrnew(const Box box)Box constructor
new Edges ptrnew(const Polygon polygon)Polygon constructor
new Edges ptrnew(const SimplePolygon polygon)Simple polygon constructor
new Edges ptrnew(const Path path)Path constructor
new Edges ptrnew(const RecursiveShapeIterator shape_iterator,
bool as_edges)
Constructor from a hierarchical shape set
new Edges ptrnew(const RecursiveShapeIterator shape_iterator,
const ICplxTrans trans,
bool as_edges)
Constructor from a hierarchical shape set with a transformation

Public methods

[const]Edges&(const Edges other)Returns the boolean AND between self and the other edge collection
[const]Edges&(const Region other)Returns the parts of the edges inside the given region
Edges&=(const Edges other)Performs the boolean AND between self and the other edge collection
Edges&=(const Region other)Selects the parts of the edges inside the given region
[const]Edges+(const Edges other)Returns the combined edge set of self and the other one
Edges+=(const Edges other)Adds the edges of the other edge collection to self
[const]Edges-(const Edges other)Returns the boolean NOT between self and the other edge collection
[const]Edges-(const Region other)Returns the parts of the edges outside the given region
Edges-=(const Edges other)Performs the boolean NOT between self and the other edge collection
Edges-=(const Region other)Selects the parts of the edges outside the given region
[const]const Edge ptr[](unsigned long n)Returns the nth edge of the edge collection
[const]Edges^(const Edges other)Returns the boolean XOR between self and the other edge collection
Edges^=(const Edges other)Performs the boolean XOR between self and the other edge collection
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 Edges other)Assigns another object to self
[const]BoxbboxReturns the bounding box of the edge collection
[const]Edgescenters(unsigned int length,
double fraction)
Returns edges representing the center part of the edges
voidclearClears the edge collection
voiddisable_progressDisable progress reporting
[const]new Edges ptrdupCreates a copy of self
[const,iter]EdgeeachReturns each edge of the region
[const,iter]Edgeeach_mergedReturns each edge of the region
voidenable_progress(string label)Enable progress reporting
[const]EdgePairsenclosing_check(const Edges other,
int d)
Performs an enclosing check between edges
[const]EdgePairsenclosing_check(const Edges other,
int d,
bool whole_edges,
variant metrics,
variant ignore_angle,
variant min_projection,
variant max_projection)
Performs an enclosing check with options
[const]Edgesend_segments(unsigned int length,
double fraction)
Returns edges representing a part of the edge before the end point
[const]Regionextended(int b,
int e,
int o,
int i,
bool join)
Returns a region with shapes representing the edges with the specified extensions
[const]Regionextended_in(int e)Returns a region with shapes representing the edges with the given width
[const]Regionextended_out(int e)Returns a region with shapes representing the edges with the given width
[const]RegionextentsReturns a region with the bounding boxes of the edges
[const]Regionextents(int d)Returns a region with the enlarged bounding boxes of the edges
[const]Regionextents(int dx,
int dy)
Returns a region with the enlarged bounding boxes of the edges
voidinsert(const Edge edge)Inserts an edge
voidinsert(const Box box)Inserts a box
voidinsert(const Polygon polygon)Inserts a polygon
voidinsert(const SimplePolygon polygon)Inserts a simple polygon
voidinsert(const Path path)Inserts a path
voidinsert(const Edges edges)Inserts all edges from the other edge collection into this one
voidinsert(const Region region)Inserts a region
voidinsert(const Shapes shapes)Inserts all edges from the shape collection into this edge collection
voidinsert(const Shapes shapes,
const Trans arg2)
Inserts all edges from the shape collection into this edge collection (with transformation)
voidinsert(const Shapes shapes,
const ICplxTrans arg2)
Inserts all edges from the shape collection into this edge collection with complex transformation
voidinsert(RecursiveShapeIterator shape_iterator)Inserts all shapes delivered by the recursive shape iterator into this edge collection
voidinsert(RecursiveShapeIterator shape_iterator,
ICplxTrans trans)
Inserts all shapes delivered by the recursive shape iterator into this edge collection with a transformation
voidinsert(Polygon[] array)Inserts all polygons from the array into this edge collection
voidinsert(Edge[] array)Inserts all edges from the array into this edge collection
[const]EdgePairsinside_check(const Edges other,
int d)
Performs an inside check between edges
[const]EdgePairsinside_check(const Edges other,
int d,
bool whole_edges,
variant metrics,
variant ignore_angle,
variant min_projection,
variant max_projection)
Performs an inside check with options
[const]Edgesinside_part(const Region other)Returns the parts of the edges of this edge collection which are inside the polygons of the region
[const]Edgesinteracting(const Edges other)Returns the edges of this edge collection which overlap or touch edges from the other edge collection
[const]Edgesinteracting(const Region other)Returns the edges from this region which overlap or touch polygons from the region
[const]boolis_empty?Returns true if the edge collection is empty
[const]boolis_merged?Returns true if the edge collection is merged
[const]unsigned intlengthReturns the total length of all edges in the edge collection
[const]unsigned intlength(const Box rect)Returns the total length of all edges in the edge collection (restricted to a rectangle)
[const]Edgesmembers_of(const Edges other)Returns all edges which are members of the other edge collection
EdgesmergeMerge the edges
[const]EdgesmergedReturns the merged edge collection
voidmerged_semantics=(bool f)Enable or disable merged semantics
[const]boolmerged_semantics?Gets a flag indicating whether merged semantics is enabled
Edgesmove(const Vector v)Moves the edge collection
Edgesmove(int x,
int y)
Moves the edge collection
[const]Edgesmoved(const Vector v)Returns the moved edge collection (does not modify self)
[const]Edgesmoved(int x,
int y)
Returns the moved edge collection (does not modify self)
[const]Edgesnot_interacting(const Edges other)Returns the edges of this edge collection which do not overlap or touch edges from the other edge collection
[const]Edgesnot_interacting(const Region other)Returns the edges from this region which do not overlap or touch polygons from the region
[const]Edgesnot_members_of(const Edges other)Returns all edges which are not members of the other edge collection
[const]Edgesoutside_part(const Region other)Returns the parts of the edges of this edge collection which are outside the polygons of the region
[const]EdgePairsoverlap_check(const Edges other,
int d)
Performs an overlap check between edges
[const]EdgePairsoverlap_check(const Edges other,
int d,
bool whole_edges,
variant metrics,
variant ignore_angle,
variant min_projection,
variant max_projection)
Performs an overlap check with options
Edgesselect_inside_part(const Region other)Selects the parts of the edges from this edge collection which are inside the polygons of the given region
Edgesselect_interacting(const Edges other)Selects the edges from this edge collection which overlap or touch edges from the other edge collection
Edgesselect_interacting(const Region other)Selects the edges from this region which overlap or touch polygons from the region
Edgesselect_not_interacting(const Edges other)Selects the edges from this edge collection which do not overlap or touch edges from the other edge collection
Edgesselect_not_interacting(const Region other)Selects the edges from this region which do not overlap or touch polygons from the region
Edgesselect_outside_part(const Region other)Selects the parts of the edges from this edge collection which are outside the polygons of the given region
[const]EdgePairsseparation_check(const Edges other,
int d)
Performs an separation check between edges
[const]EdgePairsseparation_check(const Edges other,
int d,
bool whole_edges,
variant metrics,
variant ignore_angle,
variant min_projection,
variant max_projection)
Performs an overlap check with options
[const]unsigned longsizeReturns the number of edges in the edge collection
[const]EdgePairsspace_check(int d)Performs a space check between edges
[const]EdgePairsspace_check(int d,
bool whole_edges,
variant metrics,
variant ignore_angle,
variant min_projection,
variant max_projection)
Performs a space check with options
[const]Edgesstart_segments(unsigned int length,
double fraction)
Returns edges representing a part of the edge after the start point
voidswap(Edges other)Swap the contents of this edge collection with the contents of another one
[const]stringto_sConverts the edge collection to a string
[const]stringto_s(unsigned long max_count)Converts the edge collection to a string
Edgestransform(const Trans t)Transform the edge collection (modifies self)
Edgestransform(const ICplxTrans t)Transform the edge collection with a complex transformation (modifies self)
[const]Edgestransformed(const Trans t)Transform the edge collection
[const]Edgestransformed(const ICplxTrans t)Transform the edge collection with a complex transformation
[const]EdgePairswidth_check(int other)Performs a width check between edges
[const]EdgePairswidth_check(int d,
bool whole_edges,
variant metrics,
variant ignore_angle,
variant min_projection,
variant max_projection)
Performs a width check with options
[const]Edgeswith_angle(double length,
bool inverse)
Filter the edges by orientation
[const]Edgeswith_angle(double min_angle,
double max_angle,
bool inverse)
Filter the edges by orientation
[const]Edgeswith_length(unsigned int length,
bool inverse)
Filter the edges by length
[const]Edgeswith_length(variant min_length,
variant max_length,
bool inverse)
Filter the edges by length
[const]Edges|(const Edges other)Returns the boolean OR between self and the other edge set
Edges|=(const Edges other)Performs the boolean OR between self and the other redge set

Public static methods and constants

intEuclidianSpecifies Euclidian metrics for the check functions
intProjectionSpecifies projected distance metrics for the check functions
intSquareSpecifies square metrics for the check functions

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]Edgesin(const Edges other)Use of this method is deprecated. Use members_of instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead
[const]Edgesnot_in(const Edges other)Use of this method is deprecated. Use not_members_of instead
Edgestransform_icplx(const ICplxTrans t)Use of this method is deprecated. Use transform instead
[const]Edgestransformed_icplx(const ICplxTrans t)Use of this method is deprecated. Use transformed instead

Detailed description

&

Signature: [const] Edges & (const Edges other)

Description: Returns the boolean AND between self and the other edge collection

Returns:The result of the boolean AND operation

The boolean AND operation will return all parts of the edges in this collection which are coincident with parts of the edges in the other collection.The result will be a merged edge collection.

Signature: [const] Edges & (const Region other)

Description: Returns the parts of the edges inside the given region

Returns:The edges inside the given region

This operation returns the parts of the edges which are inside the given region. Edges on the borders of the polygons are included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

&=

Signature: Edges &= (const Edges other)

Description: Performs the boolean AND between self and the other edge collection

Returns:The edge collection after modification (self)

The boolean AND operation will return all parts of the edges in this collection which are coincident with parts of the edges in the other collection.The result will be a merged edge collection.

Signature: Edges &= (const Region other)

Description: Selects the parts of the edges inside the given region

Returns:The edge collection after modification (self)

This operation selects the parts of the edges which are inside the given region. Edges on the borders of the polygons are included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

+

Signature: [const] Edges + (const Edges other)

Description: Returns the combined edge set of self and the other one

Returns:The resulting edge set

This operator adds the edges of the other edge set to self and returns a new combined edge set. This usually creates unmerged edge sets and edges may overlap. Use merge if you want to ensure the result edge set is merged.

+=

Signature: Edges += (const Edges other)

Description: Adds the edges of the other edge collection to self

Returns:The edge set after modification (self)

This operator adds the edges of the other edge set to self. This usually creates unmerged edge sets and edges may overlap. Use merge if you want to ensure the result edge set is merged.

-

Signature: [const] Edges - (const Edges other)

Description: Returns the boolean NOT between self and the other edge collection

Returns:The result of the boolean NOT operation

The boolean NOT operation will return all parts of the edges in this collection which are not coincident with parts of the edges in the other collection.The result will be a merged edge collection.

Signature: [const] Edges - (const Region other)

Description: Returns the parts of the edges outside the given region

Returns:The edges outside the given region

This operation returns the parts of the edges which are outside the given region. Edges on the borders of the polygons are not included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

-=

Signature: Edges -= (const Edges other)

Description: Performs the boolean NOT between self and the other edge collection

Returns:The edge collection after modification (self)

The boolean NOT operation will return all parts of the edges in this collection which are not coincident with parts of the edges in the other collection.The result will be a merged edge collection.

Signature: Edges -= (const Region other)

Description: Selects the parts of the edges outside the given region

Returns:The edge collection after modification (self)

This operation selects the parts of the edges which are outside the given region. Edges on the borders of the polygons are not included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

Euclidian

Signature: [static] int Euclidian

Description: Specifies Euclidian metrics for the check functions

This value can be used for the metrics parameter in the check functions, i.e. width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by:

d = sqrt(dx^2 + dy^2)

All points within a circle with radius d around one point are considered to have a smaller distance than d.

Projection

Signature: [static] int Projection

Description: Specifies projected distance metrics for the check functions

This value can be used for the metrics parameter in the check functions, i.e. width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other.

Square

Signature: [static] int Square

Description: Specifies square metrics for the check functions

This value can be used for the metrics parameter in the check functions, i.e. width_check. This value specifies sqaure metrics, i.e. the distance between two points is measured by:

d = max(abs(dx), abs(dy))

All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics.

[]

Signature: [const] const Edge ptr [] (unsigned long n)

Description: Returns the nth edge of the edge collection

This method returns nil if the index is out of range.

^

Signature: [const] Edges ^ (const Edges other)

Description: Returns the boolean XOR between self and the other edge collection

Returns:The result of the boolean XOR operation

The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. The result will be a merged edge collection.

^=

Signature: Edges ^= (const Edges other)

Description: Performs the boolean XOR between self and the other edge collection

Returns:The edge collection after modification (self)

The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. The result will be a merged edge collection.

_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 Edges other)

Description: Assigns another object to self

bbox

Signature: [const] Box bbox

Description: Returns the bounding box of the edge collection

The bounding box is the box enclosing all points of all edges.

centers

Signature: [const] Edges centers (unsigned int length,double fraction)

Description: Returns edges representing the center part of the edges

Returns:A new collection of edges representing the part around the center

This method allows to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length:

edges = ...  # An edge collection
edges.centers(100, 0.0)     # All segments have a length of 100 DBU
edges.centers(0, 50.0)      # All segments have a length of half the original length
edges.centers(100, 50.0)    # All segments have a length of half the original length
                            # or 100 DBU, whichever is larger

It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the centers of the edges but can't participate in some functions.

clear

Signature: void clear

Description: Clears the edge collection

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

disable_progress

Signature: void disable_progress

Description: Disable progress reporting

Calling this method will disable progress reporting. See enable_progress.

dup

Signature: [const] new Edges ptr dup

Description: Creates a copy of self

each

Signature: [const,iter] Edge each

Description: Returns each edge of the region

Python specific notes:
This method enables iteration of the object

each_merged

Signature: [const,iter] Edge each_merged

Description: Returns each edge of the region

In contrast to each, this method delivers merged edges if merge semantics applies while each delivers the original edges only.

This method has been introduced in version 0.25.

enable_progress

Signature: void enable_progress (string label)

Description: Enable progress reporting

After calling this method, the edge collection will report the progress through a progress bar while expensive operations are running. The label is a text which is put in front of the progress bar. Using a progress bar will imply a performance penalty of a few percent typically.

enclosing_check

Signature: [const] EdgePairs enclosing_check (const Edges other,int d)

Description: Performs an enclosing check between edges

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check

To understand the enclosing check for edges, one has to be familiar with the concept of the inside and outside interpretation of an edge. An edge is considered a boundary between "inside" and "outside" where "inside" is right to the edge. Although there is not necessarily a contiguous region for edges, the definition of the inside part allows to specify edge relations which are denoted by "space", "width", "inside" and "enclosing". In that sense, enclosing means that another edge is parallel and left to the edge under test with a distance of less than the given threshold. This method returns an EdgePairs collection which contains the parts of the edges violating the check criterion.

A version of this method is available with more options (i.e. the option the deliver whole edges). Other checks with different edge relations are width_check, space_check, overlap_check, separation_check and inside_check.

Signature: [const] EdgePairs enclosing_check (const Edges other,int d,bool whole_edges,variant metrics,variant ignore_angle,variant min_projection,variant max_projection)

Description: Performs an enclosing check with options

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check
whole_edges:If true, deliver the whole edges
metrics:Specify the metrics type
ignore_angle:The threshold angle above which no check is performed
min_projection:The lower threshold of the projected length of one edge onto another
max_projection:The upper threshold of the projected length of one edge onto another

This version is similar to the simple version with one parameter. In addition, it allows to specify many more options.

If "whole_edges" is true, the resulting EdgePairs collection will receive the whole edges which contribute in the width check.

"metrics" can be one of the constants Euclidian, Square or Projection. See there for a description of these constants. Use nil for this value to select the default (Euclidian metrics).

"ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. Use nil for this value to select the default.

"min_projection" and "max_projection" allow to select edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value.

end_segments

Signature: [const] Edges end_segments (unsigned int length,double fraction)

Description: Returns edges representing a part of the edge before the end point

Returns:A new collection of edges representing the end part

This method allows to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length:

edges = ...  # An edge collection
edges.end_segments(100, 0.0)     # All segments have a length of 100 DBU
edges.end_segments(0, 50.0)      # All segments have a length of half the original length
edges.end_segments(100, 50.0)    # All segments have a length of half the original length
                                  # or 100 DBU, whichever is larger

It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the end positions of the edges but can't participate in some functions.

extended

Signature: [const] Region extended (int b,int e,int o,int i,bool join)

Description: Returns a region with shapes representing the edges with the specified extensions

b:the parallel extension at the start point of the edge
e:the parallel extension at the end point of the edge
o:the perpendicular extension to the "outside" (left side as seen in the direction of the edge)
i:the perpendicular extension to the "inside" (right side as seen in the dleftirection of the edge)
join:If true, connected edges are joined before the extension is applied
Returns:A region containing the polygons representing these extended edges

This is a generic version of extended_in and extended_out. It allows to specify extensions for all four directions of an edge and to join the edges before the extension is applied.

For degenerated edges forming a point, a rectangle with the b, e, o and i used as left, right, top and bottom distance to the center point of this edge is created.

If join is true and edges form a closed loop, the b and e parameters are ignored and a rim polygon is created that forms the loop with the outside and inside extension given by o and i.

extended_in

Signature: [const] Region extended_in (int e)

Description: Returns a region with shapes representing the edges with the given width

e:The extension width
Returns:A region containing the polygons representing these extended edges

The edges are extended to the "inside" by the given distance "e". The distance will be applied to the right side as seen in the direction of the edge. By definition, this is the side pointing to the inside of the polygon if the edge was derived from a polygon.

Other versions of this feature are extended_out and extended.

extended_out

Signature: [const] Region extended_out (int e)

Description: Returns a region with shapes representing the edges with the given width

e:The extension width
Returns:A region containing the polygons representing these extended edges

The edges are extended to the "outside" by the given distance "e". The distance will be applied to the left side as seen in the direction of the edge. By definition, this is the side pointing to the outside of the polygon if the edge was derived from a polygon.

Other versions of this feature are extended_in and extended.

extents

Signature: [const] Region extents

Description: Returns a region with the bounding boxes of the edges

This method will return a region consisting of the bounding boxes of the edges. The boxes will not be merged, so it is possible to determine overlaps of these boxes for example.

Signature: [const] Region extents (int d)

Description: Returns a region with the enlarged bounding boxes of the edges

This method will return a region consisting of the bounding boxes of the edges enlarged by the given distance d. The enlargement is specified per edge, i.e the width and height will be increased by 2*d. The boxes will not be merged, so it is possible to determine overlaps of these boxes for example.

Signature: [const] Region extents (int dx,int dy)

Description: Returns a region with the enlarged bounding boxes of the edges

This method will return a region consisting of the bounding boxes of the edges enlarged by the given distance dx in x direction and dy in y direction. The enlargement is specified per edge, i.e the width will be increased by 2*dx. The boxes will not be merged, so it is possible to determine overlaps of these boxes for example.

in

Signature: [const] Edges in (const Edges other)

Description: Returns all edges which are members of the other edge collection

Use of this method is deprecated. Use members_of instead

Python specific notes:
This method is available as method 'in_' in Python

insert

Signature: void insert (const Edge edge)

Description: Inserts an edge

Inserts the edge into the edge collection.

Signature: void insert (const Box box)

Description: Inserts a box

Inserts the edges that form the contour of the box into the edge collection.

Signature: void insert (const Polygon polygon)

Description: Inserts a polygon

Inserts the edges that form the contour of the polygon into the edge collection.

Signature: void insert (const SimplePolygon polygon)

Description: Inserts a simple polygon

Inserts the edges that form the contour of the simple polygon into the edge collection.

Signature: void insert (const Path path)

Description: Inserts a path

Inserts the edges that form the contour of the path into the edge collection.

Signature: void insert (const Edges edges)

Description: Inserts all edges from the other edge collection into this one

This method has been introduced in version 0.25.

Signature: void insert (const Region region)

Description: Inserts a region

Inserts the edges that form the contours of the polygons from the region into the edge collection.

This method has been introduced in version 0.25.

Signature: void insert (const Shapes shapes)

Description: Inserts all edges from the shape collection into this edge collection

This method takes each edge from the shape collection and insertes it into the region. "Polygon-like" objects are inserted as edges forming the contours of the polygons. Text objects are ignored.

This method has been introduced in version 0.25.

Signature: void insert (const Shapes shapes,const Trans arg2)

Description: Inserts all edges from the shape collection into this edge collection (with transformation)

This method acts as the version without transformation, but will apply the given transformation before inserting the edges.

This method has been introduced in version 0.25.

Signature: void insert (const Shapes shapes,const ICplxTrans arg2)

Description: Inserts all edges from the shape collection into this edge collection with complex transformation

This method acts as the version without transformation, but will apply the given complex transformation before inserting the edges.

This method has been introduced in version 0.25.

Signature: void insert (RecursiveShapeIterator shape_iterator)

Description: Inserts all shapes delivered by the recursive shape iterator into this edge collection

For "solid" shapes (boxes, polygons, paths), this method inserts the edges that form the contour of the shape into the edge collection. Edge shapes are inserted as such. Text objects are not inserted, because they cannot be converted to polygons.

Signature: void insert (RecursiveShapeIterator shape_iterator,ICplxTrans trans)

Description: Inserts all shapes delivered by the recursive shape iterator into this edge collection with a transformation

For "solid" shapes (boxes, polygons, paths), this method inserts the edges that form the contour of the shape into the edge collection. Edge shapes are inserted as such. Text objects are not inserted, because they cannot be converted to polygons. This variant will apply the given transformation to the shapes. This is useful to scale the shapes to a specific database unit for example.

Signature: void insert (Polygon[] array)

Description: Inserts all polygons from the array into this edge collection

Signature: void insert (Edge[] array)

Description: Inserts all edges from the array into this edge collection

inside_check

Signature: [const] EdgePairs inside_check (const Edges other,int d)

Description: Performs an inside check between edges

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check

To understand the inside check for edges, one has to be familiar with the concept of the inside and outside interpretation of an edge. An edge is considered a boundary between "inside" and "outside" where "inside" is right to the edge. Although there is not necessarily a contiguous region for edges, the definition of the inside part allows to specify edge relations which are denoted by "space", "width", "inside" and "enclosing". In that sense, inside means that another edge is parallel and right to the edge under test with a distance of less than the given threshold. This method returns an EdgePairs collection which contains the parts of the edges violating the check criterion.

A version of this method is available with more options (i.e. the option the deliver whole edges). Other checks with different edge relations are width_check, space_check, overlap_check, separation_check and enclosing_check.

Signature: [const] EdgePairs inside_check (const Edges other,int d,bool whole_edges,variant metrics,variant ignore_angle,variant min_projection,variant max_projection)

Description: Performs an inside check with options

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check
whole_edges:If true, deliver the whole edges
metrics:Specify the metrics type
ignore_angle:The threshold angle above which no check is performed
min_projection:The lower threshold of the projected length of one edge onto another
max_projection:The upper threshold of the projected length of one edge onto another

This version is similar to the simple version with one parameter. In addition, it allows to specify many more options.

If "whole_edges" is true, the resulting EdgePairs collection will receive the whole edges which contribute in the width check.

"metrics" can be one of the constants Euclidian, Square or Projection. See there for a description of these constants. Use nil for this value to select the default (Euclidian metrics).

"ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. Use nil for this value to select the default.

"min_projection" and "max_projection" allow to select edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value.

inside_part

Signature: [const] Edges inside_part (const Region other)

Description: Returns the parts of the edges of this edge collection which are inside the polygons of the region

Returns:A new edge collection containing the edge parts inside the region

This operation returns the parts of the edges which are inside the given region. This functionality is similar to the '&' operator, but edges on the borders of the polygons are not included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

interacting

Signature: [const] Edges interacting (const Edges other)

Description: Returns the edges of this edge collection which overlap or touch edges from the other edge collection

Returns:A new edge collection containing the edges overlapping or touching edges from the other region

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

Signature: [const] Edges interacting (const Region other)

Description: Returns the edges from this region which overlap or touch polygons from the region

Returns:A new edge collection containing the edges overlapping or touching polygons from the region

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

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

is_empty?

Signature: [const] bool is_empty?

Description: Returns true if the edge collection is empty

is_merged?

Signature: [const] bool is_merged?

Description: Returns true if the edge collection is merged

If the region is merged, coincident edges have been merged into single edges. You can ensure merged state by calling merge.

length

Signature: [const] unsigned int length

Description: Returns the total length of all edges in the edge collection

Merged semantics applies for this method (see merged_semantics= of merged semantics)

Signature: [const] unsigned int length (const Box rect)

Description: Returns the total length of all edges in the edge collection (restricted to a rectangle)

This version will compute the total length of all edges in the collection, restricting the computation to the given rectangle. Edges along the border are handled in a special way: they are counted when they are oriented with their inside side toward the rectangle (in other words: outside edges must coincide with the rectangle's border in order to be counted).

Merged semantics applies for this method (see merged_semantics= of merged semantics)

members_of

Signature: [const] Edges members_of (const Edges other)

Description: Returns all edges which are members of the other edge collection

This method returns all edges in self which can be found in the other edge collection as well with exactly the same geometry.

Python specific notes:
This method is available as method 'in_' in Python

merge

Signature: Edges merge

Description: Merge the edges

Returns:The edge collection after the edges have been merged (self).

Merging joins parallel edges which overlap or touch. Crossing edges are not merged. If the edge collection is already merged, this method does nothing

merged

Signature: [const] Edges merged

Description: Returns the merged edge collection

Returns:The edge collection after the edges have been merged.

Merging joins parallel edges which overlap or touch. Crossing edges are not merged. In contrast to merge, this method does not modify the edge collection but returns a merged copy.

merged_semantics=

Signature: void merged_semantics= (bool f)

Description: Enable or disable merged semantics

If merged semantics is enabled (the default), colinear, connected or overlapping edges will be considered as single edges.

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

merged_semantics?

Signature: [const] bool merged_semantics?

Description: Gets a flag indicating whether merged semantics is enabled

See merged_semantics= for a description of this attribute.

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

move

Signature: Edges move (const Vector v)

Description: Moves the edge collection

v:The distance to move the edge collection.
Returns:The moved edge collection (self).

Moves the polygon by the given offset and returns the moved edge collection. The edge collection is overwritten.

Starting with version 0.25 the displacement type is a vector.

Signature: Edges move (int x,int y)

Description: Moves the edge collection

x:The x distance to move the edge collection.
y:The y distance to move the edge collection.
Returns:The moved edge collection (self).

Moves the edge collection by the given offset and returns the moved edge collection. The edge collection is overwritten.

moved

Signature: [const] Edges moved (const Vector v)

Description: Returns the moved edge collection (does not modify self)

v:The distance to move the edge collection.
Returns:The moved edge collection.

Moves the edge collection by the given offset and returns the moved edge collection. The edge collection is not modified.

Starting with version 0.25 the displacement type is a vector.

Signature: [const] Edges moved (int x,int y)

Description: Returns the moved edge collection (does not modify self)

x:The x distance to move the edge collection.
y:The y distance to move the edge collection.
Returns:The moved edge collection.

Moves the edge collection by the given offset and returns the moved edge collection. The edge collection is not modified.

new

Signature: [static] new Edges ptr new

Description: Default constructor

This constructor creates an empty edge collection.

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

Signature: [static] new Edges ptr new (const Edge edge)

Description: Constructor from a single edge

This constructor creates an edge collection with a single edge.

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

Signature: [static] new Edges ptr new (Polygon[] array)

Description: Constructor from a polygon array

This constructor creates a region from an array of polygons. The edges form the contours of the polygons.

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

Signature: [static] new Edges ptr new (Edge[] array)

Description: Constructor from an egde array

This constructor creates a region from an array of edges.

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

Signature: [static] new Edges ptr new (const Box box)

Description: Box constructor

This constructor creates an edge collection from a box. The edges form the contour of the box.

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

Signature: [static] new Edges ptr new (const Polygon polygon)

Description: Polygon constructor

This constructor creates an edge collection from a polygon. The edges form the contour of the polygon.

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

Signature: [static] new Edges ptr new (const SimplePolygon polygon)

Description: Simple polygon constructor

This constructor creates an edge collection from a simple polygon. The edges form the contour of the polygon.

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

Signature: [static] new Edges ptr new (const Path path)

Description: Path constructor

This constructor creates an edge collection from a path. The edges form the contour of the path.

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

Signature: [static] new Edges ptr new (const RecursiveShapeIterator shape_iterator,bool as_edges)

Description: Constructor from a hierarchical shape set

This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. It feeds the shapes from a hierarchy of cells into the edge set.

Text objects are not inserted, because they cannot be converted to edges. Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored.

layout = ... # a layout
cell   = ... # the index of the initial cell
layer  = ... # the index of the layer from where to take the shapes from
r = RBA::Edges::new(layout.begin_shapes(cell, layer), false)

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

Signature: [static] new Edges ptr new (const RecursiveShapeIterator shape_iterator,const ICplxTrans trans,bool as_edges)

Description: Constructor from a hierarchical shape set with a transformation

This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. It feeds the shapes from a hierarchy of cells into the edge set. The transformation is useful to scale to a specific database unit for example.

Text objects are not inserted, because they cannot be converted to edges. Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored.

layout = ... # a layout
cell   = ... # the index of the initial cell
layer  = ... # the index of the layer from where to take the shapes from
dbu    = 0.1 # the target database unit
r = RBA::Edges::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu))

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

not_in

Signature: [const] Edges not_in (const Edges other)

Description: Returns all edges which are not members of the other edge collection

Use of this method is deprecated. Use not_members_of instead

not_interacting

Signature: [const] Edges not_interacting (const Edges other)

Description: Returns the edges of this edge collection which do not overlap or touch edges from the other edge collection

Returns:A new edge collection containing the edges not overlapping or touching edges from the other region

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

Signature: [const] Edges not_interacting (const Region other)

Description: Returns the edges from this region which do not overlap or touch polygons from the region

Returns:A new edge collection containing the edges not overlapping or touching polygons from the region

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

not_members_of

Signature: [const] Edges not_members_of (const Edges other)

Description: Returns all edges which are not members of the other edge collection

This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry.

outside_part

Signature: [const] Edges outside_part (const Region other)

Description: Returns the parts of the edges of this edge collection which are outside the polygons of the region

Returns:A new edge collection containing the edge parts outside the region

This operation returns the parts of the edges which are not inside the given region. This functionality is similar to the '-' operator, but edges on the borders of the polygons are included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

overlap_check

Signature: [const] EdgePairs overlap_check (const Edges other,int d)

Description: Performs an overlap check between edges

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check

Technically, the overlap check is a width check between edges from different collections. The check is performed where the edges are orientation towards each other with their 'inside' side and they are orientation anti-parallel. This situation is found where two polygons overlap. Hence the check is an 'overlap' check.

This method returns an EdgePairs collection which contains the parts of the edges violating the check criterion.

A version of this method is available with more options (i.e. the option the deliver whole edges). Other checks with different edge relations are width_check, space_check, enclosing_check, separation_check and inside_check.

Signature: [const] EdgePairs overlap_check (const Edges other,int d,bool whole_edges,variant metrics,variant ignore_angle,variant min_projection,variant max_projection)

Description: Performs an overlap check with options

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check
whole_edges:If true, deliver the whole edges
metrics:Specify the metrics type
ignore_angle:The threshold angle above which no check is performed
min_projection:The lower threshold of the projected length of one edge onto another
max_projection:The upper threshold of the projected length of one edge onto another

This version is similar to the simple version with one parameter. In addition, it allows to specify many more options.

If "whole_edges" is true, the resulting EdgePairs collection will receive the whole edges which contribute in the width check.

"metrics" can be one of the constants Euclidian, Square or Projection. See there for a description of these constants. Use nil for this value to select the default (Euclidian metrics).

"ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. Use nil for this value to select the default.

"min_projection" and "max_projection" allow to select edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value.

select_inside_part

Signature: Edges select_inside_part (const Region other)

Description: Selects the parts of the edges from this edge collection which are inside the polygons of the given region

Returns:The edge collection after the edges have been selected (self)

This operation selects the parts of the edges which are inside the given region. This functionality is similar to the '&=' operator, but edges on the borders of the polygons are not included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

select_interacting

Signature: Edges select_interacting (const Edges other)

Description: Selects the edges from this edge collection which overlap or touch edges from the other edge collection

Returns:The edge collection after the edges have been selected (self)

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

Signature: Edges select_interacting (const Region other)

Description: Selects the edges from this region which overlap or touch polygons from the region

Returns:The edge collection after the edges have been selected (self)

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

select_not_interacting

Signature: Edges select_not_interacting (const Edges other)

Description: Selects the edges from this edge collection which do not overlap or touch edges from the other edge collection

Returns:The edge collection after the edges have been selected (self)

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

Signature: Edges select_not_interacting (const Region other)

Description: Selects the edges from this region which do not overlap or touch polygons from the region

Returns:The edge collection after the edges have been selected (self)

This method does not merge the edges before they are selected. If you want to select coherent edges, make sure the edge collection is merged before this method is used.

select_outside_part

Signature: Edges select_outside_part (const Region other)

Description: Selects the parts of the edges from this edge collection which are outside the polygons of the given region

Returns:The edge collection after the edges have been selected (self)

This operation selects the parts of the edges which are not inside the given region. This functionality is similar to the '-=' operator, but edges on the borders of the polygons are included in the edge set. As a side effect, the edges are made non-intersecting by introducing cut points where edges intersect.

This method has been introduced in version 0.24.

separation_check

Signature: [const] EdgePairs separation_check (const Edges other,int d)

Description: Performs an separation check between edges

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check

Technically, the separation check is a space check between edges from different collections. The check is performed where the edges are orientation towards each other with their 'outside' side and they are orientation anti-parallel. This situation is found where two polygons have a space. Hence the check is a 'separation' check.

This method returns an EdgePairs collection which contains the parts of the edges violating the check criterion.

A version of this method is available with more options (i.e. the option the deliver whole edges). Other checks with different edge relations are width_check, space_check, enclosing_check, overlap_check and inside_check.

Signature: [const] EdgePairs separation_check (const Edges other,int d,bool whole_edges,variant metrics,variant ignore_angle,variant min_projection,variant max_projection)

Description: Performs an overlap check with options

d:The minimum distance for which the edges are checked
other:The other edge collection against which to check
whole_edges:If true, deliver the whole edges
metrics:Specify the metrics type
ignore_angle:The threshold angle above which no check is performed
min_projection:The lower threshold of the projected length of one edge onto another
max_projection:The upper threshold of the projected length of one edge onto another

This version is similar to the simple version with one parameter. In addition, it allows to specify many more options.

If "whole_edges" is true, the resulting EdgePairs collection will receive the whole edges which contribute in the width check.

"metrics" can be one of the constants Euclidian, Square or Projection. See there for a description of these constants. Use nil for this value to select the default (Euclidian metrics).

"ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. Use nil for this value to select the default.

"min_projection" and "max_projection" allow to select edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value.

size

Signature: [const] unsigned long size

Description: Returns the number of edges in the edge collection

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

space_check

Signature: [const] EdgePairs space_check (int d)

Description: Performs a space check between edges

d:The minimum distance for which the edges are checked

To understand the space check for edges, one has to be familiar with the concept of the inside and outside interpretation of an edge. An edge is considered a boundary between "inside" and "outside" where "inside" is right to the edge. Although there is not necessarily a contiguous region for edges, the definition of the inside part allows to specify edge relations which are denoted by "space", "width", "inside" and "enclosing". In that sense, space means that another edge is anti-parallel and right to the edge under test with a distance of less than the given threshold. This method returns an EdgePairs collection which contains the parts of the edges violating the check criterion.

A version of this method is available with more options (i.e. the option the deliver whole edges). Other checks with different edge relations are width_check, inside_check, overlap_check, separation_check and enclosing_check.

Signature: [const] EdgePairs space_check (int d,bool whole_edges,variant metrics,variant ignore_angle,variant min_projection,variant max_projection)

Description: Performs a space check with options

d:The minimum distance for which the edges are checked
whole_edges:If true, deliver the whole edges
metrics:Specify the metrics type
ignore_angle:The threshold angle above which no check is performed
min_projection:The lower threshold of the projected length of one edge onto another
max_projection:The upper threshold of the projected length of one edge onto another

This version is similar to the simple version with one parameter. In addition, it allows to specify many more options.

If "whole_edges" is true, the resulting EdgePairs collection will receive the whole edges which contribute in the space check.

"metrics" can be one of the constants Euclidian, Square or Projection. See there for a description of these constants. Use nil for this value to select the default (Euclidian metrics).

"ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. Use nil for this value to select the default.

"min_projection" and "max_projection" allow to select edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value.

start_segments

Signature: [const] Edges start_segments (unsigned int length,double fraction)

Description: Returns edges representing a part of the edge after the start point

Returns:A new collection of edges representing the start part

This method allows to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length:

edges = ...  # An edge collection
edges.start_segments(100, 0.0)    # All segments have a length of 100 DBU
edges.start_segments(0, 50.0)     # All segments have a length of half the original length
edges.start_segments(100, 50.0)   # All segments have a length of half the original length
                                  # or 100 DBU, whichever is larger

It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the start positions of the edges but can't participate in some functions.

swap

Signature: void swap (Edges other)

Description: Swap the contents of this edge collection with the contents of another one

This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare.

to_s

Signature: [const] string to_s

Description: Converts the edge collection to a string

The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter.

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

Signature: [const] string to_s (unsigned long max_count)

Description: Converts the edge collection to a string

This version allows specification of the maximum number of edges contained in the string.

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

transform

Signature: Edges transform (const Trans t)

Description: Transform the edge collection (modifies self)

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

Transforms the edge collection with the given transformation. This version modifies the edge collection and returns a reference to self.

Signature: Edges transform (const ICplxTrans t)

Description: Transform the edge collection with a complex transformation (modifies self)

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

Transforms the edge collection with the given transformation. This version modifies the edge collection and returns a reference to self.

transform_icplx

Signature: Edges transform_icplx (const ICplxTrans t)

Description: Transform the edge collection with a complex transformation (modifies self)

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

Use of this method is deprecated. Use transform instead

transformed

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

Description: Transform the edge collection

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

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

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

Description: Transform the edge collection with a complex transformation

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

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

transformed_icplx

Signature: [const] Edges transformed_icplx (const ICplxTrans t)

Description: Transform the edge collection with a complex transformation

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

Use of this method is deprecated. Use transformed instead

width_check

Signature: [const] EdgePairs width_check (int other)

Description: Performs a width check between edges

d:The minimum width for which the edges are checked
other:The other edge collection against which to check

To understand the overlap check for edges, one has to be familiar with the concept of the inside and outside interpretation of an edge. An edge is considered a boundary between "inside" and "outside" where "inside" is right to the edge. Although there is not necessarily a contiguous region for edges, the definition of the inside part allows to specify edge relations which are denoted by "space", "width", "inside" and "enclosing". In that sense, width means that another edge is anti-parallel and left to the edge under test with a distance of less than the given threshold. This method returns an EdgePairs collection which contains the parts of the edges violating the check criterion.

A version of this method is available with more options (i.e. the option the deliver whole edges). Other checks with different edge relations are space_check, inside_check, overlap_check, separation_check and enclosing_check.

Signature: [const] EdgePairs width_check (int d,bool whole_edges,variant metrics,variant ignore_angle,variant min_projection,variant max_projection)

Description: Performs a width check with options

d:The minimum width for which the edges are checked
whole_edges:If true, deliver the whole edges
metrics:Specify the metrics type
ignore_angle:The threshold angle above which no check is performed
min_projection:The lower threshold of the projected length of one edge onto another
max_projection:The upper threshold of the projected length of one edge onto another

This version is similar to the simple version with one parameter. In addition, it allows to specify many more options.

If "whole_edges" is true, the resulting EdgePairs collection will receive the whole edges which contribute in the width check.

"metrics" can be one of the constants Euclidian, Square or Projection. See there for a description of these constants. Use nil for this value to select the default (Euclidian metrics).

"ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. Use nil for this value to select the default.

"min_projection" and "max_projection" allow to select edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value.

with_angle

Signature: [const] Edges with_angle (double length,bool inverse)

Description: Filter the edges by orientation

Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have the given angle to the x-axis are returned. If "inverse" is true, edges not having the given angle are returned.

This will filter horizontal edges:

horizontal = edges.with_orientation(0, true)

Signature: [const] Edges with_angle (double min_angle,double max_angle,bool inverse)

Description: Filter the edges by orientation

Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have an angle to the x-axis larger or equal to "min_angle" and less than "max_angle" are returned. If "inverse" is true, edges which do not conform to this criterion are returned.

with_length

Signature: [const] Edges with_length (unsigned int length,bool inverse)

Description: Filter the edges by length

Filters the edges in the edge collection by length. If "inverse" is false, only edges which have the given length are returned. If "inverse" is true, edges not having the given length are returned.

Signature: [const] Edges with_length (variant min_length,variant max_length,bool inverse)

Description: Filter the edges by length

Filters the edges in the edge collection by length. If "inverse" is false, only edges which have a length larger or equal to "min_length" and less than "max_length" are returned. If "inverse" is true, edges not having a length less than "min_length" or larger or equal than "max_length" are returned.

If you don't want to specify a lower or upper limit, pass nil to that parameter.

|

Signature: [const] Edges | (const Edges other)

Description: Returns the boolean OR between self and the other edge set

Returns:The resulting edge collection

The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient.

|=

Signature: Edges |= (const Edges other)

Description: Performs the boolean OR between self and the other redge set

Returns:The edge collection after modification (self)

The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient.