dbcore
KLayout core module 'db'
__all__
module
__all__ = ['__doc__', '__version__', 'Box', 'DBox', 'Cell', 'Instance', 'ParentInstArray', 'CellInstArray', 'DCellInstArray', 'CellMapping', 'CompoundRegionOperationNode', 'TrapezoidDecompositionMode', 'PreferredOrientation', 'DeepShapeStore', 'Edge', 'DEdge', 'EdgePair', 'DEdgePair', 'EdgePairFilter', 'EdgePairOperator', 'EdgePairToPolygonOperator', 'EdgePairToEdgeOperator', 'EdgeProcessor', 'EdgeFilter', 'EdgeOperator', 'EdgeToPolygonOperator', 'EdgeToEdgePairOperator', 'TextGenerator', 'Connectivity', 'InstElement', 'LayerMapping', 'LayerInfo', 'Layout', 'SaveLayoutOptions', 'LayoutDiff', 'LayoutQueryIterator', 'LayoutQuery', 'LayoutToNetlist', 'LayoutVsSchematic', 'Library', 'PCellDeclaration_Native', 'PCellParameterState', 'PCellParameterStates', 'PCellDeclaration', 'PCellParameterDeclaration', 'LogEntryData', 'Severity', 'Manager', 'Matrix2d', 'IMatrix2d', 'Matrix3d', 'IMatrix3d', 'LayoutMetaInfo', 'NetlistObject', 'Pin', 'DeviceReconnectedTerminal', 'DeviceAbstractRef', 'Device', 'DeviceAbstract', 'SubCircuit', 'NetTerminalRef', 'NetPinRef', 'NetSubcircuitPinRef', 'Net', 'DeviceTerminalDefinition', 'DeviceParameterDefinition', 'EqualDeviceParameters', 'GenericDeviceParameterCompare', 'GenericDeviceCombiner', 'DeviceClass', 'Circuit', 'Netlist', 'NetlistSpiceWriterDelegate', 'NetlistWriter', 'NetlistSpiceWriter', 'NetlistReader', 'ParseElementComponentsData', 'ParseElementData', 'NetlistSpiceReaderDelegate', 'NetlistSpiceReader', 'NetlistCompareLogger', 'GenericNetlistCompareLogger', 'NetlistComparer', 'NetlistCrossReference', 'DeviceClassResistor', 'DeviceClassResistorWithBulk', 'DeviceClassCapacitor', 'DeviceClassCapacitorWithBulk', 'DeviceClassInductor', 'DeviceClassDiode', 'DeviceClassBJT3Transistor', 'DeviceClassBJT4Transistor', 'DeviceClassMOS3Transistor', 'DeviceClassMOS4Transistor', 'DeviceClassFactory', 'NetlistDeviceExtractorLayerDefinition', 'DeviceExtractorBase', 'GenericDeviceExtractor', 'DeviceExtractorMOS3Transistor', 'DeviceExtractorMOS4Transistor', 'DeviceExtractorResistor', 'DeviceExtractorResistorWithBulk', 'DeviceExtractorCapacitor', 'DeviceExtractorCapacitorWithBulk', 'DeviceExtractorBJT3Transistor', 'DeviceExtractorBJT4Transistor', 'DeviceExtractorDiode', 'Path', 'DPath', 'DPoint', 'Point', 'SimplePolygon', 'DSimplePolygon', 'Polygon', 'DPolygon', 'LayerMap', 'LoadLayoutOptions', 'RecursiveInstanceIterator', 'RecursiveShapeIterator', 'PolygonFilter', 'PolygonOperator', 'PolygonToEdgeOperator', 'PolygonToEdgePairOperator', 'Metrics', 'EdgeMode', 'ZeroDistanceMode', 'PropertyConstraint', 'Shape', 'ShapeCollection', 'ShapeProcessor', 'Shapes', 'TechnologyComponent', 'Technology', 'Text', 'DText', 'HAlign', 'VAlign', 'TextFilter', 'TextOperator', 'TextToPolygonOperator', 'Texts', 'TileOutputReceiverBase', 'TileOutputReceiver', 'TilingProcessor', 'Trans', 'DTrans', 'DCplxTrans', 'CplxTrans', 'ICplxTrans', 'VCplxTrans', 'Utils', 'DVector', 'Vector', 'LEFDEFReaderConfiguration', 'NetTracerConnectionInfo', 'NetTracerSymbolInfo', 'NetTracerConnectivity', 'NetTracerTechnologyComponent', 'NetElement', 'NetTracer', 'EdgePairs', 'Edges', 'Region']
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
__doc__
module
__doc__ = "KLayout core module 'db'"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__file__
module
__file__ = '/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/klayout/dbcore.cpython-311-x86_64-linux-gnu.so'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__name__
module
__name__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__package__
module
__package__ = 'klayout'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__version__
module
__version__ = '0.29.8'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
Box
@brief A box class with integer coordinates
This object represents a box (a rectangular shape).
The definition of the attributes is: p1 is the lower left point, p2 the upper right one. If a box is constructed from two points (or four coordinates), the coordinates are sorted accordingly.
A box can be empty. An empty box represents no area (not even a point). Empty boxes behave neutral with respect to most operations. Empty boxes return true on \empty?.
A box can be a point or a single line. In this case, the area is zero but the box still can overlap other boxes for example and it is not empty.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A box class with integer coordinates\n\nThis object represents a box (a rectangular shape).\n\nThe definition of the attributes is: p1 is the lower left point, p2 the \nupper right one. If a box is constructed from two points (or four coordinates), the \ncoordinates are sorted accordingly.\n\nA box can be empty. An empty box represents no area\n(not even a point). Empty boxes behave neutral with respect to most operations. \nEmpty boxes return true on \\empty?.\n\nA box can be a point or a single\nline. In this case, the area is zero but the box still\ncan overlap other boxes for example and it is not empty. \n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 27
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Box' objects>
list of weak references to the object
bottom
class
bottom: int = <attribute 'bottom' of 'Box' objects>
@brief Gets the bottom coordinate of the box
@brief Sets the bottom coordinate of the box
left
class
left: int = <attribute 'left' of 'Box' objects>
@brief Gets the left coordinate of the box
@brief Sets the left coordinate of the box
p1
class
p1: Point = <attribute 'p1' of 'Box' objects>
@brief Gets the lower left point of the box
@brief Sets the lower left point of the box
p2
class
p2: Point = <attribute 'p2' of 'Box' objects>
@brief Gets the upper right point of the box
@brief Sets the upper right point of the box
right
class
right: int = <attribute 'right' of 'Box' objects>
@brief Gets the right coordinate of the box
@brief Sets the right coordinate of the box
top
class
top: int = <attribute 'top' of 'Box' objects>
@brief Gets the top coordinate of the box
@brief Sets the top coordinate of the box
__add__
method descriptor
__add__(box: Box) -> Box
__add__(point: Point) -> Box
__add__()
@brief Joins two boxes
The + operator joins the first box with the one given as the second argument. Joining constructs a box that encloses both boxes given. Empty boxes are neutral: they do not change another box when joining. Overwrites this box with the result.
@param box The box to join with this box.
@return The joined box
__and__
method descriptor
__and__() -> Box
@brief Returns the intersection of this box with another box
The intersection of two boxes is the largest box common to both boxes. The intersection may be empty if both boxes to not touch. If the boxes do not overlap but touch the result may be a single line or point with an area of zero. Overwrites this box with the result.
@param box The box to take the intersection with
@return The intersection box
__copy__
method descriptor
__copy__() -> Box
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Box
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns true if this box is equal to the other box Returns true, if this box and the given box are equal
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given box. This method enables boxes as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(dbox: DBox) -> None
__init__(left: int, bottom: int, right: int, top: int) -> None
__init__(lower_left: Point, upper_right: Point) -> None
__init__(w: int) -> None
__init__(w: int, h: int) -> None
__init__()
@brief Creates a box from two points
Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped.
__lt__
method descriptor
__lt__() -> bool
@brief Returns true if this box is 'less' than another box Returns true, if this box is 'less' with respect to first and second point (in this order)
__mul__
method descriptor
__mul__(box: Box) -> Box
__mul__(scale_factor: float) -> Box
__mul__()
@brief Returns the scaled box
The * operator scales the box with the given factor and returns the result.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled box
__ne__
method descriptor
__ne__() -> bool
@brief Returns true if this box is not equal to the other box Returns true, if this box and the given box are not equal
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing this box
This string can be turned into a box again by using \from_s . If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: Box) -> Box
__rmul__(scale_factor: float) -> Box
__rmul__()
@brief Returns the scaled box
The * operator scales the box with the given factor and returns the result.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled box
__str__
method descriptor
__str__() -> str
@brief Returns a string representing this box
This string can be turned into a box again by using \from_s . If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__sub__
method descriptor
__sub__() -> Box
@brief Subtraction of boxes
The - operator subtracts the argument box from self. This will return the bounding box of the are covered by self, but not by argument box. Subtracting a box from itself will render an empty box. Subtracting another box from self will modify the first box only if the argument box covers one side entirely.
@param box The box to subtract from this box.
@return The result box
This feature has been introduced in version 0.29.
area
method descriptor
area() -> float
@brief Computes the box area
Returns the box area or 0 if the box is empty
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Returns the bounding box This method is provided for consistency of the shape API is returns the box itself.
This method has been introduced in version 0.27.
center
method descriptor
center() -> Point
@brief Gets the center of the box
contains
method descriptor
contains(point: Point) -> bool
contains(x: int, y: int) -> bool
contains()
@brief Returns true if the box contains the given point
Tests whether a point is inside the box. It also returns true if the point is exactly on the box contour.
@param p The point to test against.
@return true if the point is inside the box.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Box
@brief Creates a copy of self
empty
method descriptor
empty() -> bool
@brief Returns a value indicating whether the box is empty
An empty box may be created with the default constructor for example. Such a box is neutral when combining it with other boxes and renders empty boxes if used in box intersections and false in geometrical relationship tests.
enlarge
method descriptor
enlarge(d: int) -> Box
enlarge(dx: int, dy: int) -> Box
enlarge(enlargement: Vector) -> Box
enlarge()
@brief Enlarges the box by a certain amount.
Enlarges the box by x and y value specified in the vector passed. Positive values with grow the box, negative ones will shrink the box. The result may be an empty box if the box disappears. The amount specifies the grow or shrink per edge. The width and height will change by twice the amount. Does not check for coordinate overflows.
@param enlargement The grow or shrink amount in x and y direction
@return A reference to this box.
enlarged
method descriptor
enlarged(d: int) -> Box
enlarged(dx: int, dy: int) -> Box
enlarged(enlargement: Vector) -> Box
enlarged()
@brief Returns the enlarged box.
Enlarges the box by x and y value specified in the vector passed. Positive values with grow the box, negative ones will shrink the box. The result may be an empty box if the box disappears. The amount specifies the grow or shrink per edge. The width and height will change by twice the amount. Does not modify this box. Does not check for coordinate overflows.
@param enlargement The grow or shrink amount in x and y direction
@return The enlarged box.
from_dbox
builtin
from_dbox() -> Box
@brief Creates an integer coordinate box from a floating-point coordinate box
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dbox'.
from_s
builtin
from_s() -> Box
@brief Creates a box 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given box. This method enables boxes as hash keys.
This method has been introduced in version 0.25.
height
method descriptor
height() -> int
@brief Gets the height of the box
inside
method descriptor
inside() -> bool
@brief Tests if this box is inside the argument box
Returns true, if this box is inside the given box, i.e. the box intersection renders this box
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_point
method descriptor
is_point() -> bool
@brief Returns true, if the box is a single point
move
method descriptor
move(distance: Vector) -> Box
move(dx: int, dy: int) -> Box
move()
@brief Moves the box by a certain distance
Moves the box by a given offset and returns the moved box. Does not check for coordinate overflows.
@param distance The offset to move the box.
@return A reference to this box.
moved
method descriptor
moved(distance: Vector) -> Box
moved(dx: int, dy: int) -> Box
moved()
@brief Returns the box moved by a certain distance
Moves the box by a given offset and returns the moved box. Does not modify this box. Does not check for coordinate overflows.
@param distance The offset to move the box.
@return The moved box.
new
builtin
new() -> Box
new(dbox: DBox) -> Box
new(left: int, bottom: int, right: int, top: int) -> Box
new(lower_left: Point, upper_right: Point) -> Box
new(w: int) -> Box
new(w: int, h: int) -> Box
new()
@brief Creates a box from two points
Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped.
overlaps
method descriptor
overlaps() -> bool
@brief Tests if this box overlaps the argument box
Returns true, if the intersection box of this box with the argument box exists and has a non-vanishing area
perimeter
method descriptor
perimeter() -> int
@brief Returns the perimeter of the box
This method is equivalent to 2*(width+height). For empty boxes, this method returns 0.
This method has been introduced in version 0.23.
to_dtype
method descriptor
to_dtype() -> DBox
@brief Converts the box to a floating-point coordinate box
The database unit can be specified to translate the integer-coordinate box into a floating-point coordinate box in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing this box
This string can be turned into a box again by using \from_s . If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
touches
method descriptor
touches() -> bool
@brief Tests if this box touches the argument box
Two boxes touch if they overlap or their boundaries share at least one common point. Touching is equivalent to a non-empty intersection ('!(b1 & b2).empty?').
transformed
method descriptor
transformed(t: CplxTrans) -> DBox
transformed(t: ICplxTrans) -> Box
transformed(t: Trans) -> Box
transformed()
@brief Returns the box transformed with the given complex transformation
@param t The magnifying transformation to apply @return The transformed box (a DBox now)
width
method descriptor
width() -> int
@brief Gets the width of the box
world
builtin
world() -> Box
@brief Gets the 'world' box The world box is the biggest box that can be represented. So it is basically 'all'. The world box behaves neutral on intersections for example. In other operations such as displacement or transformations, the world box may render unexpected results because of coordinate overflow.
The world box can be used @ul @li for comparison ('==', '!=', '<') @/li @li in union and intersection ('+' and '&') @/li @li in relations (\contains?, \overlaps?, \touches?) @/li @li as 'all' argument in region queries @/li @/ul
This method has been introduced in version 0.28.
Cell
@brief A cell
A cell object consists of a set of shape containers (called layers), a set of child cell instances and auxiliary information such as the parent instance list. A cell is identified through an index given to the cell upon instantiation. Cell instances refer to single instances or array instances. Both are encapsulated in the same object, the \CellInstArray object. In the simple case, this object refers to a single instance. In the general case, this object may refer to a regular array of cell instances as well.
Starting from version 0.16, the child_inst and erase_inst methods are no longer available since they were using index addressing which is no longer supported. Instead, instances are now addressed with the \Instance reference objects.
See @The Database API@ for more details about the database objects like the Cell class.
__doc__
class
__doc__ = '@brief A cell\n\nA cell object consists of a set of shape containers (called layers),\na set of child cell instances and auxiliary information such as\nthe parent instance list.\nA cell is identified through an index given to the cell upon instantiation.\nCell instances refer to single instances or array instances. Both are encapsulated in the\nsame object, the \\CellInstArray object. In the simple case, this object refers to a single instance.\nIn the general case, this object may refer to a regular array of cell instances as well.\n\nStarting from version 0.16, the child_inst and erase_inst methods are no longer available since\nthey were using index addressing which is no longer supported. Instead, instances are now addressed\nwith the \\Instance reference objects.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects like the Cell class.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 29
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Cell' objects>
list of weak references to the object
ghost_cell
class
ghost_cell: bool = <attribute 'ghost_cell' of 'Cell' objects>
@brief Returns a value indicating whether the cell is a "ghost cell"
The ghost cell flag is used by the GDS reader for example to indicate that the cell is not located inside the file. Upon writing the reader can determine whether to write the cell or not. To satisfy the references inside the layout, a dummy cell is created in this case which has the "ghost cell" flag set to true.
This method has been introduced in version 0.20.
@brief Sets the "ghost cell" flag
See \is_ghost_cell? for a description of this property.
This method has been introduced in version 0.20.
name
class
name: str = <attribute 'name' of 'Cell' objects>
@brief Gets the cell's name
This may be an internal name for proxy cells. See \basic_name for the formal name (PCell name or library cell name).
This method has been introduced in version 0.22.
@brief Renames the cell Renaming a cell may cause name clashes, i.e. the name may be identical to the name of another cell. This does not have any immediate effect, but the cell needs to be renamed, for example when writing the layout to a GDS file.
This method has been introduced in version 0.22.
prop_id
class
prop_id: int = <attribute 'prop_id' of 'Cell' objects>
@brief Gets the properties ID associated with the cell
This method has been introduced in version 0.23.
@brief Sets the properties ID associated with the cell This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property.
This method has been introduced in version 0.23.
__copy__
method descriptor
__copy__() -> Cell
@brief Creates a copy of the cell
This method will create a copy of the cell. The new cell will be member of the same layout the original cell was member of. The copy will inherit all shapes and instances, but get a different cell_index and a modified name as duplicate cell names are not allowed in the same layout.
This method has been introduced in version 0.27.
__deepcopy__
method descriptor
__deepcopy__() -> Cell
@brief Creates a copy of the cell
This method will create a copy of the cell. The new cell will be member of the same layout the original cell was member of. The copy will inherit all shapes and instances, but get a different cell_index and a modified name as duplicate cell names are not allowed in the same layout.
This method has been introduced in version 0.27.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
add_meta_info
method descriptor
add_meta_info() -> None
@brief Adds meta information to the cell See \LayoutMetaInfo for details about cells and meta information.
This method has been introduced in version 0.28.8.
basic_name
method descriptor
basic_name() -> str
@brief Returns the name of the library or PCell or the real name of the cell For non-proxy cells (see \is_proxy?), this method simply returns the cell name. For proxy cells, this method returns the PCells definition name or the library cell name. This name may differ from the actual cell's name because to ensure that cell names are unique, KLayout may assign different names to the actual cell compared to the source cell.
This method has been introduced in version 0.22.
bbox
method descriptor
bbox() -> Box
bbox(layer_index: int) -> Box
bbox()
@brief Gets the per-layer bounding box of the cell
@return The bounding box of the cell considering only the given layer
The bounding box is the box enclosing all shapes on the given layer.
'bbox' is the preferred synonym since version 0.28.
bbox_per_layer
method descriptor
bbox_per_layer() -> Box
@brief Gets the per-layer bounding box of the cell
@return The bounding box of the cell considering only the given layer
The bounding box is the box enclosing all shapes on the given layer.
'bbox' is the preferred synonym since version 0.28.
begin_instances_rec
method descriptor
begin_instances_rec() -> RecursiveInstanceIterator
@brief Delivers a recursive instance iterator for the instances below the cell @return A suitable iterator
For details see the description of the \RecursiveInstanceIterator class.
This method has been added in version 0.27.
begin_instances_rec_overlapping
method descriptor
begin_instances_rec_overlapping(region: Box) -> RecursiveInstanceIterator
begin_instances_rec_overlapping(region: DBox) -> RecursiveInstanceIterator
begin_instances_rec_overlapping()
@brief Delivers a recursive instance iterator for the instances below the cell using a region search, with the region given in micrometer units @param region The search region as \DBox object in micrometer units @return A suitable iterator
For details see the description of the \RecursiveInstanceIterator class. This version gives an iterator delivering instances whose bounding box overlaps the given region.
This variant has been added in version 0.27.
begin_instances_rec_touching
method descriptor
begin_instances_rec_touching(region: Box) -> RecursiveInstanceIterator
begin_instances_rec_touching(region: DBox) -> RecursiveInstanceIterator
begin_instances_rec_touching()
@brief Delivers a recursive instance iterator for the instances below the cell using a region search, with the region given in micrometer units @param region The search region as \DBox object in micrometer units @return A suitable iterator
For details see the description of the \RecursiveInstanceIterator class. This version gives an iterator delivering instances whose bounding box touches the given region.
This variant has been added in version 0.27.
begin_shapes_rec
method descriptor
begin_shapes_rec() -> RecursiveShapeIterator
@brief Delivers a recursive shape iterator for the shapes below the cell on the given layer @param layer The layer from which to get the shapes @return A suitable iterator
For details see the description of the \RecursiveShapeIterator class.
This method has been added in version 0.23.
begin_shapes_rec_overlapping
method descriptor
begin_shapes_rec_overlapping(layer: int, region: Box) -> RecursiveShapeIterator
begin_shapes_rec_overlapping(layer: int, region: DBox) -> RecursiveShapeIterator
begin_shapes_rec_overlapping()
@brief Delivers a recursive shape iterator for the shapes below the cell on the given layer using a region search, with the region given in micrometer units @param layer The layer from which to get the shapes @param region The search region as \DBox object in micrometer units @return A suitable iterator
For details see the description of the \RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region.
This variant has been added in version 0.25.
begin_shapes_rec_touching
method descriptor
begin_shapes_rec_touching(layer: int, region: Box) -> RecursiveShapeIterator
begin_shapes_rec_touching(layer: int, region: DBox) -> RecursiveShapeIterator
begin_shapes_rec_touching()
@brief Delivers a recursive shape iterator for the shapes below the cell on the given layer using a region search, with the region given in micrometer units @param layer The layer from which to get the shapes @param region The search region as \DBox object in micrometer units @return A suitable iterator
For details see the description of the \RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region.
This variant has been added in version 0.25.
called_cells
method descriptor
called_cells() -> List[int]
@brief Gets a list of all called cells
This method determines all cells which are called either directly or indirectly by the cell. It returns an array of cell indexes. Use the 'cell' method of \Layout to retrieve the corresponding Cell object.
This method has been introduced in version 0.19.
@return A list of cell indices.
caller_cells
method descriptor
caller_cells() -> List[int]
@brief Gets a list of all caller cells
This method determines all cells which call this cell either directly or indirectly. It returns an array of cell indexes. Use the 'cell' method of \Layout to retrieve the corresponding Cell object.
This method has been introduced in version 0.19.
@return A list of cell indices.
cell_index
method descriptor
cell_index() -> int
@brief Gets the cell index
@return The cell index of the cell
change_pcell_parameter
method descriptor
change_pcell_parameter() -> Instance
@brief Changes a single parameter for an individual PCell instance given by name @return The new instance (the old may be invalid) This will set the PCell parameter named 'name' to the given value for the instance addressed by 'instance'. If no parameter with that name exists, the method will do nothing.
This method has been introduced in version 0.23.
change_pcell_parameters
method descriptor
change_pcell_parameters(instance: Instance, dict: Dict[str, Any]) -> Instance
change_pcell_parameters(instance: Instance, parameters: Sequence[Any]) -> Instance
change_pcell_parameters()
@brief Changes the parameters for an individual PCell instance @return The new instance (the old may be invalid) If necessary, this method creates a new variant and replaces the given instance by an instance of this variant.
The parameters are given in the order the parameters are declared. Use \pcell_declaration on the instance to get the PCell declaration object of the cell. That PCellDeclaration object delivers the parameter declaration with its 'get_parameters' method. Each parameter in the variant list passed to the second list of values corresponds to one parameter declaration.
There is a more convenient method (\change_pcell_parameter) that changes a single parameter by name.
This method has been introduced in version 0.22.
child_cells
method descriptor
child_cells() -> int
@brief Gets the number of child cells
The number of child cells (not child instances!) is returned. CAUTION: this method is SLOW, in particular if many instances are present.
child_instances
method descriptor
child_instances() -> int
@brief Gets the number of child instances
@return Returns the number of cell instances
clear
method descriptor
clear() -> None
clear(layer: LayerInfo) -> None
clear(layer_index: int) -> None
clear()
@brief Clears the cell (deletes shapes and instances) This method has been introduced in version 0.23.
clear_insts
method descriptor
clear_insts() -> None
@brief Clears the instance list
clear_meta_info
method descriptor
clear_meta_info() -> None
@brief Clears the meta information of the cell See \LayoutMetaInfo for details about cells and meta information.
This method has been introduced in version 0.28.8.
clear_shapes
method descriptor
clear_shapes() -> None
@brief Clears all shapes in the cell
copy
method descriptor
copy(src: int, dest: int) -> None
copy(src_cell: Cell, src_layer: int, dest: int) -> None
copy()
@brief Copies shapes from another cell to the target layer in this cell
This method will copy all shapes on layer 'src_layer' of cell 'src_cell' to the layer 'dest' of this cell. The destination layer is not overwritten. Instead, the shapes are added to the shapes of the destination layer. If the source cell lives in a layout with a different database unit than that current cell is in, the shapes will be transformed accordingly. The same way, shape properties are transformed as well. Note that the shape transformation may require rounding to smaller coordinates. This may result in a slight distortion of the original shapes, in particular when transforming into a layout with a bigger database unit. @param src_cell The cell where to take the shapes from @param src_layer The layer index of the layer from which to take the shapes @param dest The layer index of the destination layer
copy_instances
method descriptor
copy_instances() -> None
@brief Copies the instances of child cells in the source cell to this cell @param source_cell The cell where the instances are copied from The source cell must reside in the same layout than this cell. The instances of child cells inside the source cell are copied to this cell. No new cells are created, just new instances are created to already existing cells in the target cell.
The instances will be added to any existing instances in the cell.
More elaborate methods of copying hierarchy trees between layouts or duplicating trees are provided through the \copy_tree_shapes (in cooperation with the \CellMapping class) or \copy_tree methods.
This method has been added in version 0.23.
copy_meta_info
method descriptor
copy_meta_info() -> None
@brief Copies the meta information from the other cell into this cell See \LayoutMetaInfo for details about cells and meta information. The meta information from this cell will be replaced by the meta information from the other cell.
This method has been introduced in version 0.28.16.
copy_shapes
method descriptor
copy_shapes(source_cell: Cell) -> None
copy_shapes(source_cell: Cell, layer_mapping: LayerMapping) -> None
copy_shapes()
@brief Copies the shapes from the given cell into this cell @param source_cell The cell from where to copy shapes @param layer_mapping A \LayerMapping object that specifies which layers are copied and where All shapes on layers specified in the layer mapping object are copied from the source cell to this cell. Instances are not copied. The target layer is taken from the mapping table.
The shapes will be added to any shapes already in the cell.
This method has been added in version 0.23.
copy_tree
method descriptor
copy_tree() -> List[int]
@brief Copies the cell tree of the given cell into this cell @param source_cell The cell from where to copy the cell tree @return A list of indexes of newly created cells The complete cell tree of the source cell is copied to the target cell plus all shapes in that tree are copied as well. This method will basically duplicate the cell tree of the source cell.
The source cell may reside in a separate layout. This method therefore provides a way to copy over complete cell trees from one layout to another.
The shapes and instances will be added to any shapes or instances already in the cell.
This method has been added in version 0.23.
copy_tree_shapes
method descriptor
copy_tree_shapes(source_cell: Cell, cell_mapping: CellMapping) -> None
copy_tree_shapes(source_cell: Cell, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None
copy_tree_shapes()
@brief Copies the shapes from the given cell and the cell tree below into this cell or subcells of this cell with layer mapping @param source_cell The cell from where to copy shapes and instances @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout
This method is provided if source and target cell reside in different layouts. If will copy the shapes from all cells below the given source cell, but use a cell mapping object that provides a specification how cells are identified between the layouts. Cells in the source tree, for which no mapping is provided, will be flattened - their shapes will be propagated into parent cells for which a mapping is provided.
The cell mapping object provides various methods to map cell trees between layouts. See the \CellMapping class for details about the mapping methods available. The cell mapping object is also responsible for creating a proper hierarchy of cells in the target layout if that is required.
In addition, the layer mapping object can be specified which maps source to target layers. This feature can be used to restrict the copy operation to a subset of layers or to convert shapes to different layers in that step.
The shapes copied will be added to any shapes already in the cells.
This method has been added in version 0.23.
create
method descriptor
create() -> None
@brief 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.
dbbox
method descriptor
dbbox() -> DBox
dbbox(layer_index: int) -> DBox
dbbox()
@brief Gets the per-layer bounding box of the cell in micrometer units
@return The bounding box of the cell considering only the given layer
The bounding box is the box enclosing all shapes on the given layer.
This method has been introduced in version 0.25. 'dbbox' is the preferred synonym since version 0.28.
dbbox_per_layer
method descriptor
dbbox_per_layer() -> DBox
@brief Gets the per-layer bounding box of the cell in micrometer units
@return The bounding box of the cell considering only the given layer
The bounding box is the box enclosing all shapes on the given layer.
This method has been introduced in version 0.25. 'dbbox' is the preferred synonym since version 0.28.
delete
method descriptor
delete() -> None
@brief Deletes this cell
This deletes the cell but not the sub cells of the cell. These subcells will likely become new top cells unless they are used otherwise. All instances of this cell are deleted as well. Hint: to delete multiple cells, use "delete_cells" which is far more efficient in this case.
After the cell has been deleted, the Cell object becomes invalid. Do not access methods or attributes of this object after deleting the cell.
This method has been introduced in version 0.23.
delete_property
method descriptor
delete_property() -> None
@brief Deletes the user property with the given key This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID.
This method has been introduced in version 0.23.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
display_title
method descriptor
display_title() -> str
@brief Returns a nice looking name for display purposes
For example, this name include PCell parameters for PCell proxy cells.
This method has been introduced in version 0.22.
dump_mem_statistics
method descriptor
dump_mem_statistics() -> None
@hide
dup
method descriptor
dup() -> Cell
@brief Creates a copy of the cell
This method will create a copy of the cell. The new cell will be member of the same layout the original cell was member of. The copy will inherit all shapes and instances, but get a different cell_index and a modified name as duplicate cell names are not allowed in the same layout.
This method has been introduced in version 0.27.
each_child_cell
method descriptor
each_child_cell() -> Iterator[int]
@brief Iterates over all child cells
This iterator will report the child cell indices, not every instance.
each_inst
method descriptor
each_inst() -> Iterator[Instance]
@brief Iterates over all child instances (which may actually be instance arrays)
Starting with version 0.15, this iterator delivers \Instance objects rather than \CellInstArray objects.
each_meta_info
method descriptor
each_meta_info() -> Iterator[LayoutMetaInfo]
@brief Iterates over the meta information of the cell See \LayoutMetaInfo for details about cells and meta information.
This method has been introduced in version 0.28.8.
each_overlapping_inst
method descriptor
each_overlapping_inst(b: Box) -> Iterator[Instance]
each_overlapping_inst(b: DBox) -> Iterator[Instance]
each_overlapping_inst()
@brief Gets the instances overlapping the given rectangle, with the rectangle in micrometer units
This will iterate over all child cell instances overlapping with the given rectangle b. This method is identical to the \each_overlapping_inst version that takes a \Box object, but instead of taking database unit coordinates in will take a micrometer unit \DBox object.
@param b The region to iterate over
This variant has been introduced in version 0.25.
each_overlapping_shape
method descriptor
each_overlapping_shape(layer_index: int, box: Box) -> Iterator[Shape]
each_overlapping_shape(layer_index: int, box: Box, flags: int) -> Iterator[Shape]
each_overlapping_shape(layer_index: int, box: DBox) -> Iterator[Shape]
each_overlapping_shape(layer_index: int, box: DBox, flags: int) -> Iterator[Shape]
each_overlapping_shape()
@brief Iterates over all shapes of a given layer that overlap the given box, with the box given in micrometer units
@param box The box by which to query the shapes as a \DBox object in micrometer units @param layer_index The layer on which to run the query
This call is equivalent to each_overlapping_shape(layer_index,box,RBA::Shapes::SAll). This convenience method has been introduced in version 0.16.
each_parent_cell
method descriptor
each_parent_cell() -> Iterator[int]
@brief Iterates over all parent cells
This iterator will iterate over the parent cells, just returning their cell index.
each_parent_inst
method descriptor
each_parent_inst() -> Iterator[ParentInstArray]
@brief Iterates over the parent instance list (which may actually be instance arrays)
The parent instances are basically inversions of the instances. Using parent instances it is possible to determine how a specific cell is called from where.
each_shape
method descriptor
each_shape(layer_index: int) -> Iterator[Shape]
each_shape(layer_index: int, flags: int) -> Iterator[Shape]
each_shape()
@brief Iterates over all shapes of a given layer
@param layer_index The layer on which to run the query
This call is equivalent to each_shape(layer_index,RBA::Shapes::SAll). This convenience method has been introduced in version 0.16.
each_touching_inst
method descriptor
each_touching_inst(b: Box) -> Iterator[Instance]
each_touching_inst(b: DBox) -> Iterator[Instance]
each_touching_inst()
@brief Gets the instances touching the given rectangle, with the rectangle in micrometer units
This will iterate over all child cell instances touching the given rectangle b. This method is identical to the \each_touching_inst version that takes a \Box object, but instead of taking database unit coordinates in will take a micrometer unit \DBox object.
@param b The region to iterate over
This variant has been introduced in version 0.25.
each_touching_shape
method descriptor
each_touching_shape(layer_index: int, box: Box) -> Iterator[Shape]
each_touching_shape(layer_index: int, box: Box, flags: int) -> Iterator[Shape]
each_touching_shape(layer_index: int, box: DBox) -> Iterator[Shape]
each_touching_shape(layer_index: int, box: DBox, flags: int) -> Iterator[Shape]
each_touching_shape()
@brief Iterates over all shapes of a given layer that touch the given box, with the box given in micrometer units
@param box The box by which to query the shapes as a \DBox object in micrometer units @param layer_index The layer on which to run the query
This call is equivalent to each_touching_shape(layer_index,box,RBA::Shapes::SAll). This convenience method has been introduced in version 0.16.
erase
method descriptor
erase() -> None
@brief Erases the instance given by the Instance object
This method has been introduced in version 0.16. It can only be used in editable mode.
fill_region
method descriptor
fill_region(region: Region, fill_cell_index: int, fc_bbox: Box, row_step: Vector, column_step: Vector, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None
fill_region(region: Region, fill_cell_index: int, fc_box: Box, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None
fill_region()
@brief Fills the given region with cells of the given type (skew step version) @param region The region to fill @param fill_cell_index The fill cell to place @param fc_bbox The fill cell's box to place @param row_step The 'rows' step vector @param column_step The 'columns' step vector @param origin The global origin of the fill pattern or nil to allow local (per-polygon) optimization @param remaining_parts See explanation in other version @param fill_margin See explanation in other version @param remaining_polygons See explanation in other version
This version is similar to the version providing an orthogonal fill, but it offers more generic stepping of the fill cell. The step pattern is defined by an origin and two vectors (row_step and column_step) which span the axes of the fill cell pattern.
The fill box and the step vectors are decoupled which means the fill box can be larger or smaller than the step pitch - it can be overlapping and there can be space between the fill box instances. Fill boxes are placed where they fit entirely into a polygon of the region. The fill boxes lower left corner is the reference for the fill pattern and aligns with the origin if given.
This variant has been introduced in version 0.27.
fill_region_multi
method descriptor
fill_region_multi() -> None
@brief Fills the given region with cells of the given type in enhanced mode with iterations This version operates like \fill_region, but repeats the fill generation until no further fill cells can be placed. As the fill pattern origin changes between the iterations, narrow regions can be filled which cannot with a fixed fill pattern origin. The \fill_margin parameter is important as it controls the distance between fill cells with a different origin and therefore introduces a safety distance between pitch-incompatible arrays.
The origin is ignored unless a glue box is given. See \fill_region for a description of this concept.
This method has been introduced in version 0.27.
flatten
method descriptor
flatten(levels: int, prune: bool) -> None
flatten(prune: bool) -> None
flatten()
@brief Flattens the given cell
This method propagates all shapes from the specified number of hierarchy levels below into the given cell. It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. If prune is set to true, these cells are removed if not used otherwise.
@param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) @param prune Set to true to remove orphan cells.
This method has been introduced in version 0.23.
has_prop_id
method descriptor
has_prop_id() -> bool
@brief Returns true, if the cell has user properties
This method has been introduced in version 0.23.
hierarchy_levels
method descriptor
hierarchy_levels() -> int
@brief Returns the number of hierarchy levels below
This method returns the number of call levels below the current cell. If there are no child cells, this method will return 0, if there are only direct children, it will return 1.
CAUTION: this method may be expensive!
insert
method descriptor
insert(cell_inst_array: CellInstArray) -> Instance
insert(cell_inst_array: CellInstArray, property_id: int) -> Instance
insert(cell_inst_array: DCellInstArray) -> Instance
insert(cell_inst_array: DCellInstArray, property_id: int) -> Instance
insert(inst: Instance) -> Instance
insert()
@brief Inserts a cell instance (array) with properties @return An \Instance object representing the new instance The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. With version 0.16, this method returns an Instance object that represents the new instance. It's use is discouraged in readonly mode, since it invalidates other Instance references.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_empty
method descriptor
is_empty() -> bool
@brief Returns a value indicating whether the cell is empty
An empty cell is a cell not containing instances nor any shapes.
This method has been introduced in version 0.20.
is_ghost_cell
method descriptor
is_ghost_cell() -> bool
@brief Returns a value indicating whether the cell is a "ghost cell"
The ghost cell flag is used by the GDS reader for example to indicate that the cell is not located inside the file. Upon writing the reader can determine whether to write the cell or not. To satisfy the references inside the layout, a dummy cell is created in this case which has the "ghost cell" flag set to true.
This method has been introduced in version 0.20.
is_leaf
method descriptor
is_leaf() -> bool
@brief Gets a value indicating whether the cell is a leaf cell
A cell is a leaf cell if there are no child instantiations.
is_library_cell
method descriptor
is_library_cell() -> bool
@brief Returns true, if the cell is a proxy cell pointing to a library cell If the cell is imported from some library, this attribute returns true. Please note, that this attribute can combine with \is_pcell? for PCells imported from a library.
This method has been introduced in version 0.22.
is_pcell_variant
method descriptor
is_pcell_variant() -> bool
is_pcell_variant(instance: Instance) -> bool
is_pcell_variant()
@brief Returns true, if this instance is a PCell variant This method returns true, if this instance represents a PCell with a distinct set of parameters. This method also returns true, if it is a PCell imported from a library.
This method has been introduced in version 0.22.
is_proxy
method descriptor
is_proxy() -> bool
@brief Returns true, if the cell presents some external entity
A cell may represent some data which is imported from some other source, i.e.
a library. Such cells are called "proxy cells". For a library reference, the
proxy cell is some kind of pointer to the library and the cell within the library.
For PCells, this data can even be computed through some script. A PCell proxy represents all instances with a given set of parameters.
Proxy cells cannot be modified, except that pcell parameters can be modified and PCell instances can be recomputed.
This method has been introduced in version 0.22.
is_top
method descriptor
is_top() -> bool
@brief Gets a value indicating whether the cell is a top-level cell
A cell is a top-level cell if there are no parent instantiations.
is_valid
method descriptor
is_valid() -> bool
@brief Tests if the given \Instance object is still pointing to a valid object This method has been introduced in version 0.16. If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again.
layout
method descriptor
layout() -> Layout
layout() -> Layout
layout()
@brief Returns a reference to the layout where the cell resides (const references)
this method has been introduced in version 0.22.
library
method descriptor
library() -> Library
@brief Returns a reference to the library from which the cell is imported if the cell is not imported from a library, this reference is nil.
this method has been introduced in version 0.22.
library_cell_index
method descriptor
library_cell_index() -> int
@brief Returns the index of the cell in the layout of the library (if it's a library proxy) Together with the \library method, it is possible to locate the source cell of a library proxy. The source cell can be retrieved from a cell "c" with
@code c.library.layout.cell(c.library_cell_index) @/code
This cell may be itself a proxy, i.e. for pcell libraries, where the library cells are pcell variants which itself are proxies to a pcell.
This method has been introduced in version 0.22.
merge_meta_info
method descriptor
merge_meta_info() -> None
@brief Merges the meta information from the other cell into this cell See \LayoutMetaInfo for details about cells and meta information. Existing keys in this cell will be overwritten by the respective values from the other cell. New keys will be added.
This method has been introduced in version 0.28.16.
meta_info
method descriptor
meta_info() -> LayoutMetaInfo
@brief Gets the meta information for a given name See \LayoutMetaInfo for details about cells and meta information.
If no meta information with the given name exists, a default object with empty fields will be returned.
This method has been introduced in version 0.28.8.
meta_info_value
method descriptor
meta_info_value() -> Any
@brief Gets the meta information value for a given name See \LayoutMetaInfo for details about cells and meta information.
If no meta information with the given name exists, a nil value will be returned. A more generic version that delivers all fields of the meta information is \meta_info.
This method has been introduced in version 0.28.8.
move
method descriptor
move(src: int, dest: int) -> None
move(src_cell: Cell, src_layer: int, dest: int) -> None
move()
@brief Moves shapes from another cell to the target layer in this cell
This method will move all shapes on layer 'src_layer' of cell 'src_cell' to the layer 'dest' of this cell. The destination layer is not overwritten. Instead, the shapes are added to the shapes of the destination layer. If the source cell lives in a layout with a different database unit than that current cell is in, the shapes will be transformed accordingly. The same way, shape properties are transformed as well. Note that the shape transformation may require rounding to smaller coordinates. This may result in a slight distortion of the original shapes, in particular when transforming into a layout with a bigger database unit. @param src_cell The cell where to take the shapes from @param src_layer The layer index of the layer from which to take the shapes @param dest The layer index of the destination layer
move_instances
method descriptor
move_instances() -> None
@brief Moves the instances of child cells in the source cell to this cell @param source_cell The cell where the instances are moved from The source cell must reside in the same layout than this cell. The instances of child cells inside the source cell are moved to this cell. No new cells are created, just new instances are created to already existing cells in the target cell.
The instances will be added to any existing instances in the cell.
More elaborate methods of moving hierarchy trees between layouts are provided through the \move_tree_shapes (in cooperation with the \CellMapping class) or \move_tree methods.
This method has been added in version 0.23.
move_shapes
method descriptor
move_shapes(source_cell: Cell) -> None
move_shapes(source_cell: Cell, layer_mapping: LayerMapping) -> None
move_shapes()
@brief Moves the shapes from the given cell into this cell @param source_cell The cell from where to move shapes @param layer_mapping A \LayerMapping object that specifies which layers are moved and where All shapes on layers specified in the layer mapping object are moved from the source cell to this cell. Instances are not moved. The target layer is taken from the mapping table.
The shapes will be added to any shapes already in the cell.
This method has been added in version 0.23.
move_tree
method descriptor
move_tree() -> List[int]
@brief Moves the cell tree of the given cell into this cell @param source_cell The cell from where to move the cell tree @return A list of indexes of newly created cells The complete cell tree of the source cell is moved to the target cell plus all shapes in that tree are moved as well. This method will basically rebuild the cell tree of the source cell and empty the source cell.
The source cell may reside in a separate layout. This method therefore provides a way to move over complete cell trees from one layout to another.
The shapes and instances will be added to any shapes or instances already in the cell.
This method has been added in version 0.23.
move_tree_shapes
method descriptor
move_tree_shapes(source_cell: Cell, cell_mapping: CellMapping) -> None
move_tree_shapes(source_cell: Cell, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None
move_tree_shapes()
@brief Moves the shapes from the given cell and the cell tree below into this cell or subcells of this cell with layer mapping @param source_cell The cell from where to move shapes and instances @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout
This method is provided if source and target cell reside in different layouts. If will move the shapes from all cells below the given source cell, but use a cell mapping object that provides a specification how cells are identified between the layouts. Cells in the source tree, for which no mapping is provided, will be flattened - their shapes will be propagated into parent cells for which a mapping is provided.
The cell mapping object provides various methods to map cell trees between layouts. See the \CellMapping class for details about the mapping methods available. The cell mapping object is also responsible for creating a proper hierarchy of cells in the target layout if that is required.
In addition, the layer mapping object can be specified which maps source to target layers. This feature can be used to restrict the move operation to a subset of layers or to convert shapes to different layers in that step.
The shapes moved will be added to any shapes already in the cells.
This method has been added in version 0.23.
new
builtin
new() -> Cell
@brief Creates a new object of this class
parent_cells
method descriptor
parent_cells() -> int
@brief Gets the number of parent cells
The number of parent cells (cells which reference our cell) is reported.
pcell_declaration
method descriptor
pcell_declaration() -> PCellDeclaration_Native
pcell_declaration(instance: Instance) -> PCellDeclaration_Native
pcell_declaration()
@brief Returns the PCell declaration of a pcell instance If the instance is not a PCell instance, this method returns nil. The \PCellDeclaration object allows one to retrieve PCell parameter definitions for example.
This method has been introduced in version 0.22.
pcell_id
method descriptor
pcell_id() -> int
@brief Returns the PCell ID if the cell is a pcell variant This method returns the ID which uniquely identifies the PCell within the layout where it's declared. It can be used to retrieve the PCell declaration or to create new PCell variants.
The method will be rarely used. It's more convenient to use \pcell_declaration to directly retrieve the PCellDeclaration object for example.
This method has been introduced in version 0.22.
pcell_library
method descriptor
pcell_library() -> Library
@brief Returns the library where the PCell is declared if this cell is a PCell and it is not defined locally. A PCell often is not declared within the current layout but in some library. This method returns a reference to that library, which technically is the last of the chained library proxies. If this cell is not a PCell or it is not located in a library, this method returns nil.
This method has been introduced in version 0.22.
pcell_parameter
method descriptor
pcell_parameter(instance: Instance, name: str) -> Any
pcell_parameter(name: str) -> Any
pcell_parameter()
@brief Returns a PCell parameter by name for a pcell instance
If the given instance is a PCell instance, this method returns the value of the PCell parameter with the given name. If the instance is not a PCell instance or the name is not a valid PCell parameter name, this method returns nil.
This method has been introduced in version 0.25.
pcell_parameters
method descriptor
pcell_parameters() -> List[Any]
pcell_parameters(instance: Instance) -> List[Any]
pcell_parameters()
@brief Returns the PCell parameters for a pcell instance If the given instance is a PCell instance, this method returns a list of values for the PCell parameters. If the instance is not a PCell instance, this method returns an empty list.
This method has been introduced in version 0.22.
pcell_parameters_by_name
method descriptor
pcell_parameters_by_name() -> Dict[str, Any]
pcell_parameters_by_name(instance: Instance) -> Dict[str, Any]
pcell_parameters_by_name()
@brief Returns the PCell parameters for a pcell instance as a name to value dictionary If the given instance is a PCell instance, this method returns a dictionary of values for the PCell parameters with the parameter names as the keys. If the instance is not a PCell instance, this method returns an empty dictionary.
This method has been introduced in version 0.24.
properties
method descriptor
properties() -> Any
@brief Gets the user properties as a hash This method is a convenience method that gets all user properties as a single hash.
This method has been introduced in version 0.29.5.
property
method descriptor
property() -> Any
@brief Gets the user property with the given key This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value.
This method has been introduced in version 0.23.
prune_cell
method descriptor
prune_cell() -> None
prune_cell(levels: int) -> None
prune_cell()
@brief Deletes the cell plus subcells not used otherwise
This deletes the cell and also all sub cells of the cell which are not used otherwise. The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. All instances of this cell are deleted as well.
After the cell has been deleted, the Cell object becomes invalid. Do not access methods or attributes of this object after deleting the cell.
@param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.)
This method has been introduced in version 0.23.
prune_subcells
method descriptor
prune_subcells() -> None
prune_subcells(levels: int) -> None
prune_subcells()
@brief Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy
This deletes all sub cells of the cell which are not used otherwise. All instances of the deleted cells are deleted as well. It is possible to specify how many levels of hierarchy below the given root cell are considered.
@param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.)
This method has been introduced in version 0.23.
qname
method descriptor
qname() -> str
@brief Returns the library-qualified name
Library cells will be indicated by returning a qualified name composed of the library name, a dot and the basic cell name. For example: "Basic.TEXT" will be the qname of the TEXT cell of the Basic library. For non-library cells, the qname is identical to the basic name (see \name).
This method has been introduced in version 0.25.
read
method descriptor
read(file_name: str) -> List[int]
read(file_name: str, options: LoadLayoutOptions) -> List[int]
read()
@brief Reads a layout file into this cell This version uses the default options for reading the file.
This method has been introduced in version 0.28.
refresh
method descriptor
refresh() -> None
@brief Refreshes a proxy cell
If the cell is a PCell variant, this method recomputes the PCell. If the cell is a library proxy, this method reloads the information from the library, but not the library itself. Note that if the cell is an PCell variant for a PCell coming from a library, this method will not recompute the PCell. Instead, you can use \Library#refresh to recompute all PCells from that library.
You can use \Layout#refresh to refresh all cells from a layout.
This method has been introduced in version 0.22.
remove_meta_info
method descriptor
remove_meta_info() -> None
@brief Removes meta information from the cell See \LayoutMetaInfo for details about cells and meta information.
This method has been introduced in version 0.28.8.
replace
method descriptor
replace(instance: Instance, cell_inst_array: CellInstArray) -> Instance
replace(instance: Instance, cell_inst_array: CellInstArray, property_id: int) -> Instance
replace(instance: Instance, cell_inst_array: DCellInstArray) -> Instance
replace(instance: Instance, cell_inst_array: DCellInstArray, property_id: int) -> Instance
replace()
@brief Replaces a cell instance (array) with a different one and new properties, where the cell instance is given in micrometer units @return An \Instance object representing the new instance This method is identical to the corresponding \replace variant with a \CellInstArray argument and a property ID. It however accepts a micrometer-unit \DCellInstArray object which is translated to database units internally.
This variant has been introduced in version 0.25.
replace_prop_id
method descriptor
replace_prop_id() -> Instance
@brief Replaces (or install) the properties of a cell @return An Instance object representing the new instance This method has been introduced in version 0.16. It can only be used in editable mode. Changes the properties Id of the given instance or install a properties Id on that instance if it does not have one yet. The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id.
set_property
method descriptor
set_property() -> None
@brief Sets the user property with the given key to the given value This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. This method has been introduced in version 0.23.
shapes
method descriptor
shapes(layer: LayerInfo) -> Shapes
shapes(layer: LayerInfo) -> Shapes
shapes(layer_index: int) -> Shapes
shapes(layer_index: int) -> Shapes
shapes()
@brief Returns the shapes list of the given layer (const version)
This version takes a \LayerInfo object and will look up the layer index. An error is raised if no layer with these attributes exists.
@param layer The layer attributes
@return A reference to the shapes list
This variant has been introduced in version 0.29.7.
swap
method descriptor
swap() -> None
@brief Swaps the layers given
This method swaps two layers inside this cell.
transform
method descriptor
transform(instance: Instance, trans: DCplxTrans) -> Instance
transform(instance: Instance, trans: DTrans) -> Instance
transform(instance: Instance, trans: ICplxTrans) -> Instance
transform(instance: Instance, trans: Trans) -> Instance
transform(trans: DCplxTrans) -> None
transform(trans: DTrans) -> None
transform(trans: ICplxTrans) -> None
transform(trans: Trans) -> None
transform()
@brief Transforms the cell by the given, micrometer-unit transformation
This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. The difference is important in the presence of magnifications: "transform" will leave magnified instances while "transform_into" will not do so but expect the magnification to be applied inside the called cells too.
This method has been introduced in version 0.26.7.
transform_into
method descriptor
transform_into(instance: Instance, trans: DCplxTrans) -> Instance
transform_into(instance: Instance, trans: DTrans) -> Instance
transform_into(instance: Instance, trans: ICplxTrans) -> Instance
transform_into(instance: Instance, trans: Trans) -> Instance
transform_into(trans: DCplxTrans) -> None
transform_into(trans: DTrans) -> None
transform_into(trans: ICplxTrans) -> None
transform_into(trans: Trans) -> None
transform_into()
@brief Transforms the cell into a new coordinate system with the given complex integer transformation where the transformation is in micrometer units This method is identical to the corresponding \transform_into method with a \ICplxTrans argument. For this variant however, the transformation is given in micrometer units and is translated to database units internally.
This variant has been introduced in version 0.25.
write
method descriptor
write(file_name: str) -> None
write(file_name: str, options: SaveLayoutOptions) -> None
write()
@brief Writes the cell to a layout file The format of the file will be determined from the file name. Only the cell and its subtree below will be saved. In contrast to the other 'write' method, this version allows one to specify save options, i.e. scaling etc.
This method has been introduced in version 0.23.
CellInstArray
@brief A single or array cell instance This object represents either single or array cell instances. A cell instance array is a regular array, described by two displacement vectors (a, b) and the instance count along that axes (na, nb).
In addition, this object represents either instances with simple transformations or instances with complex transformations. The latter includes magnified instances and instances rotated by an arbitrary angle.
The cell which is instantiated is given by a cell index. The cell index can be converted to a cell pointer by using \Layout#cell. The cell index of a cell can be obtained using \Cell#cell_index.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A single or array cell instance\nThis object represents either single or array cell instances. A cell instance array is a regular array, described by two displacement vectors (a, b) and the instance count along that axes (na, nb). \n\nIn addition, this object represents either instances with simple transformations or instances with complex transformations. The latter includes magnified instances and instances rotated by an arbitrary angle.\n\nThe cell which is instantiated is given by a cell index. The cell index can be converted to a cell pointer by using \\Layout#cell. The cell index of a cell can be obtained using \\Cell#cell_index.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 32
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CellInstArray' objects>
list of weak references to the object
a
class
a: Vector = <attribute 'a' of 'CellInstArray' objects>
@brief Gets the displacement vector for the 'a' axis
Starting with version 0.25 the displacement is of vector type.
@brief Sets the displacement vector for the 'a' axis
If the instance was not regular before this property is set, it will be initialized to a regular instance.
This method was introduced in version 0.22. Starting with version 0.25 the displacement is of vector type.
b
class
b: Vector = <attribute 'b' of 'CellInstArray' objects>
@brief Gets the displacement vector for the 'b' axis
Starting with version 0.25 the displacement is of vector type.
@brief Sets the displacement vector for the 'b' axis
If the instance was not regular before this property is set, it will be initialized to a regular instance.
This method was introduced in version 0.22. Starting with version 0.25 the displacement is of vector type.
cell
class
cell: None = <attribute 'cell' of 'CellInstArray' objects>
@brief Sets the cell this instance refers to This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes.
This convenience method has been introduced in version 0.28.
cell_index
class
cell_index: int = <attribute 'cell_index' of 'CellInstArray' objects>
@brief Gets the cell index of the cell instantiated Use \Layout#cell to get the \Cell object from the cell index.
@brief Sets the index of the cell this instance refers to
cplx_trans
class
cplx_trans: ICplxTrans = <attribute 'cplx_trans' of 'CellInstArray' objects>
@brief Gets the complex transformation of the first instance in the array This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well.
@brief Sets the complex transformation of the instance or the first instance in the array
This method was introduced in version 0.22.
na
class
na: int = <attribute 'na' of 'CellInstArray' objects>
@brief Gets the number of instances in the 'a' axis
@brief Sets the number of instances in the 'a' axis
If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. To make an instance a single instance, set na or nb to 0.
This method was introduced in version 0.22.
nb
class
nb: int = <attribute 'nb' of 'CellInstArray' objects>
@brief Gets the number of instances in the 'b' axis
@brief Sets the number of instances in the 'b' axis
If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. To make an instance a single instance, set na or nb to 0.
This method was introduced in version 0.22.
trans
class
trans: Trans = <attribute 'trans' of 'CellInstArray' objects>
@brief Gets the transformation of the first instance in the array The transformation returned is only valid if the array does not represent a complex transformation array
@brief Sets the transformation of the instance or the first instance in the array
This method was introduced in version 0.22.
__copy__
method descriptor
__copy__() -> CellInstArray
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> CellInstArray
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Compares two arrays for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given cell instance. This method enables cell instances as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(cell: Cell, disp: Vector) -> None
__init__(cell: Cell, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> None
__init__(cell: Cell, trans: ICplxTrans) -> None
__init__(cell: Cell, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> None
__init__(cell: Cell, trans: Trans) -> None
__init__(cell: Cell, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> None
__init__(cell_index: int, disp: Vector) -> None
__init__(cell_index: int, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> None
__init__(cell_index: int, trans: ICplxTrans) -> None
__init__(cell_index: int, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> None
__init__(cell_index: int, trans: Trans) -> None
__init__(cell_index: int, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> None
__init__()
@brief Creates a single cell instance with a complex transformation @param cell The cell to instantiate @param trans The complex transformation by which to instantiate the cell @param a The displacement vector of the array in the 'a' axis @param b The displacement vector of the array in the 'b' axis @param na The number of placements in the 'a' axis @param nb The number of placements in the 'b' axis
This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28.
__len__
method descriptor
__len__() -> int
@brief Gets the number of single instances in the array If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance.
__lt__
method descriptor
__lt__() -> bool
@brief Compares two arrays for 'less' The comparison provides an arbitrary sorting criterion and not specific sorting order. It is guaranteed that if an array a is less than b, b is not less than a. In addition, it a is not less than b and b is not less than a, then a is equal to b.
__ne__
method descriptor
__ne__() -> bool
@brief Compares two arrays for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts the array to a string
This method was introduced in version 0.22.
__str__
method descriptor
__str__() -> str
@brief Converts the array to a string
This method was introduced in version 0.22.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox(layout: Layout) -> Box
bbox(layout: Layout, layer_index: int) -> Box
bbox()
@brief Gets the bounding box of the array The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index.
bbox_per_layer
method descriptor
bbox_per_layer() -> Box
@brief Gets the bounding box of the array with respect to one layer The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index.
'bbox' is the preferred synonym since version 0.28.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> CellInstArray
@brief Creates a copy of self
each_cplx_trans
method descriptor
each_cplx_trans() -> Iterator[ICplxTrans]
@brief Gets the complex transformations represented by this instance For a single instance, this iterator will deliver the single, complex transformation. For array instances, the iterator will deliver each complex transformation of the expanded array. This iterator is a generalization of \each_trans for general complex transformations.
This method has been introduced in version 0.25.
each_trans
method descriptor
each_trans() -> Iterator[Trans]
@brief Gets the simple transformations represented by this instance For a single instance, this iterator will deliver the single, simple transformation. For array instances, the iterator will deliver each simple transformation of the expanded array.
This iterator will only deliver valid transformations if the instance array is not of complex type (see \is_complex?). A more general iterator that delivers the complex transformations is \each_cplx_trans.
This method has been introduced in version 0.25.
hash
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given cell instance. This method enables cell instances as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> None
@brief Inverts the array reference
The inverted array reference describes in which transformations the parent cell is seen from the current cell.
is_complex
method descriptor
is_complex() -> bool
@brief Gets a value indicating whether the array is a complex array
Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles).
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_regular_array
method descriptor
is_regular_array() -> bool
@brief Gets a value indicating whether this instance is a regular array
new
builtin
new() -> CellInstArray
new(cell: Cell, disp: Vector) -> CellInstArray
new(cell: Cell, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray
new(cell: Cell, trans: ICplxTrans) -> CellInstArray
new(cell: Cell, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray
new(cell: Cell, trans: Trans) -> CellInstArray
new(cell: Cell, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray
new(cell_index: int, disp: Vector) -> CellInstArray
new(cell_index: int, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray
new(cell_index: int, trans: ICplxTrans) -> CellInstArray
new(cell_index: int, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray
new(cell_index: int, trans: Trans) -> CellInstArray
new(cell_index: int, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray
new()
@brief Creates a single cell instance with a complex transformation @param cell The cell to instantiate @param trans The complex transformation by which to instantiate the cell @param a The displacement vector of the array in the 'a' axis @param b The displacement vector of the array in the 'b' axis @param na The number of placements in the 'a' axis @param nb The number of placements in the 'b' axis
This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28.
size
method descriptor
size() -> int
@brief Gets the number of single instances in the array If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance.
to_s
method descriptor
to_s() -> str
@brief Converts the array to a string
This method was introduced in version 0.22.
transform
method descriptor
transform(trans: ICplxTrans) -> None
transform(trans: Trans) -> None
transform()
@brief Transforms the cell instance with the given complex transformation
This method has been introduced in version 0.20.
transformed
method descriptor
transformed(trans: ICplxTrans) -> CellInstArray
transformed(trans: Trans) -> CellInstArray
transformed()
@brief Gets the transformed cell instance (complex transformation)
This method has been introduced in version 0.20.
CellMapping
@brief A cell mapping (source to target layout)
A cell mapping is an association of cells in two layouts forming pairs of cells, i.e. one cell corresponds to another cell in the other layout. The CellMapping object describes the mapping of cells of a source layout B to a target layout A. The cell mapping object is basically a table associating a cell in layout B with a cell in layout A.
The cell mapping is of particular interest for providing the cell mapping recipe in \Cell#copy_tree_shapes or \Cell#move_tree_shapes.
The mapping object is used to create and hold that table. There are three basic modes in which a table can be generated:
@ul @li Top-level identity (\for_single_cell and \for_single_cell_full) @/li @li Top-level identify for multiple cells (\for_multi_cells_full and \for_multi_cells_full) @/li @li Geometrical identity (\from_geometry and \from_geometry_full)@/li @li Name identity (\from_names and \from_names_full) @/li @/ul
'full' refers to the way cells are treated which are not mentioned. In the 'full' versions, cells for which no mapping is established explicitly - specifically all child cells in top-level identity modes - are created in the target layout and instantiated according to their source layout hierarchy. Then, these new cells become targets of the respective source cells. In the plain version (without 'full' cells), no additional cells are created. For the case of \Layout#copy_tree_shapes cells not explicitly mapped are flattened. Hence for example, \for_single_cell will flatten all children of the source cell during \Layout#copy_tree_shapes or \Layout#move_tree_shapes.
Top-level identity means that only one cell (the top cell) is regarded identical. All child cells are not considered identical. In full mode (see below), this will create a new, identical cell tree below the top cell in layout A.
Geometrical identity is defined by the exact identity of the set of expanded instances in each starting cell. Therefore, when a cell is mapped to another cell, shapes can be transferred from one cell to another while effectively rendering the same flat geometry (in the context of the given starting cells). Location identity is basically the safest way to map cells from one hierarchy into another, because it preserves the flat shape geometry. However in some cases the algorithm may find multiple mapping candidates. In that case it will make a guess about what mapping to choose.
Name identity means that cells are identified by their names - for a source cell in layer B, a target cell with the same name is looked up in the target layout A and a mapping is created if a cell with the same name is found. However, name identity does not mean that the cells are actually equivalent because they may be placed differently. Hence, cell mapping by name is not a good choice when it is important to preserve the shape geometry of a layer.
A cell might not be mapped to another cell which basically means that there is no corresponding cell. In this case, flattening to the next mapped cell is an option to transfer geometries despite the missing mapping. You can enforce a mapping by using the mapping generator methods in 'full' mode, i.e. \from_names_full or \from_geometry_full. These versions will create new cells and their corresponding instances in the target layout if no suitable target cell is found.
This is a simple example for a cell mapping preserving the hierarchy of the source cell and creating a hierarchy copy in the top cell of the target layout ('hierarchical merge'):
@code cell_names = [ "A", "B", "C" ]
source = RBA::Layout::new source.read("input.gds")
target = RBA::Layout::new target_top = target.create_cell("IMPORTED")
cm = RBA::CellMapping::new
Copies the source layout hierarchy into the target top cell:
cm.for_single_cell_full(target_top, source.top_cell) target.copy_tree_shapes(source, cm) @/code
Without 'full', the effect is move-with-flattening (note we're using 'move' in this example):
@code cell_names = [ "A", "B", "C" ]
source = RBA::Layout::new source.read("input.gds")
target = RBA::Layout::new target_top = target.create_cell("IMPORTED")
cm = RBA::CellMapping::new
Flattens the source layout hierarchy into the target top cell:
cm.for_single_cell(target_top, source.top_cell) target.move_tree_shapes(source, cm) @/code
This is another example for using \CellMapping in multiple top cell identity mode. It extracts cells 'A', 'B' and 'C' from one layout and copies them to another. It will also copy all shapes and all child cells. Child cells which are shared between the three initial cells will be shared in the target layout too.
@code cell_names = [ "A", "B", "C" ]
source = RBA::Layout::new source.read("input.gds")
target = RBA::Layout::new
source_cells = cell_names.collect { |n| source.cell_by_name(n) } target_cells = cell_names.collect { |n| target.create_cell(n) }
cm = RBA::CellMapping::new cm.for_multi_cells_full(target_cells, source_cells) target.copy_tree_shapes(source, cm) @/code
DropCell
class
DropCell: int = 4294967295
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A cell mapping (source to target layout)\n\nA cell mapping is an association of cells in two layouts forming pairs of cells, i.e. one cell corresponds to another cell in the other layout. The CellMapping object describes the mapping of cells of a source layout B to a target layout A. The cell mapping object is basically a table associating a cell in layout B with a cell in layout A.\n\nThe cell mapping is of particular interest for providing the cell mapping recipe in \\Cell#copy_tree_shapes or \\Cell#move_tree_shapes.\n\nThe mapping object is used to create and hold that table. There are three basic modes in which a table can be generated:\n\n@ul\n @li Top-level identity (\\for_single_cell and \\for_single_cell_full) @/li\n @li Top-level identify for multiple cells (\\for_multi_cells_full and \\for_multi_cells_full) @/li\n @li Geometrical identity (\\from_geometry and \\from_geometry_full)@/li\n @li Name identity (\\from_names and \\from_names_full) @/li\n@/ul\n\n\'full\' refers to the way cells are treated which are not mentioned. In the \'full\' versions, cells for which no mapping is established explicitly - specifically all child cells in top-level identity modes - are created in the target layout and instantiated according to their source layout hierarchy. Then, these new cells become targets of the respective source cells. In the plain version (without \'full\' cells), no additional cells are created. For the case of \\Layout#copy_tree_shapes cells not explicitly mapped are flattened. Hence for example, \\for_single_cell will flatten all children of the source cell during \\Layout#copy_tree_shapes or \\Layout#move_tree_shapes.\n\nTop-level identity means that only one cell (the top cell) is regarded identical. All child cells are not considered identical. In full mode (see below), this will create a new, identical cell tree below the top cell in layout A.\n\nGeometrical identity is defined by the exact identity of the set of expanded instances in each starting cell. Therefore, when a cell is mapped to another cell, shapes can be transferred from one cell to another while effectively rendering the same flat geometry (in the context of the given starting cells). Location identity is basically the safest way to map cells from one hierarchy into another, because it preserves the flat shape geometry. However in some cases the algorithm may find multiple mapping candidates. In that case it will make a guess about what mapping to choose.\n\nName identity means that cells are identified by their names - for a source cell in layer B, a target cell with the same name is looked up in the target layout A and a mapping is created if a cell with the same name is found. However, name identity does not mean that the cells are actually equivalent because they may be placed differently. Hence, cell mapping by name is not a good choice when it is important to preserve the shape geometry of a layer.\n\nA cell might not be mapped to another cell which basically means that there is no corresponding cell. In this case, flattening to the next mapped cell is an option to transfer geometries despite the missing mapping. You can enforce a mapping by using the mapping generator methods in \'full\' mode, i.e. \\from_names_full or \\from_geometry_full. These versions will create new cells and their corresponding instances in the target layout if no suitable target cell is found.\n\nThis is a simple example for a cell mapping preserving the hierarchy of the source cell and creating a hierarchy copy in the top cell of the target layout (\'hierarchical merge\'):\n\n@code\ncell_names = [ "A", "B", "C" ]\n\nsource = RBA::Layout::new\nsource.read("input.gds")\n\ntarget = RBA::Layout::new\ntarget_top = target.create_cell("IMPORTED")\n\ncm = RBA::CellMapping::new\n# Copies the source layout hierarchy into the target top cell:\ncm.for_single_cell_full(target_top, source.top_cell)\ntarget.copy_tree_shapes(source, cm)\n@/code\n\nWithout \'full\', the effect is move-with-flattening (note we\'re using \'move\' in this example):\n\n@code\ncell_names = [ "A", "B", "C" ]\n\nsource = RBA::Layout::new\nsource.read("input.gds")\n\ntarget = RBA::Layout::new\ntarget_top = target.create_cell("IMPORTED")\n\ncm = RBA::CellMapping::new\n# Flattens the source layout hierarchy into the target top cell:\ncm.for_single_cell(target_top, source.top_cell)\ntarget.move_tree_shapes(source, cm)\n@/code\n\nThis is another example for using \\CellMapping in multiple top cell identity mode. It extracts cells \'A\', \'B\' and \'C\' from one layout and copies them to another. It will also copy all shapes and all child cells. Child cells which are shared between the three initial cells will be shared in the target layout too.\n\n@code\ncell_names = [ "A", "B", "C" ]\n\nsource = RBA::Layout::new\nsource.read("input.gds")\n\ntarget = RBA::Layout::new\n\nsource_cells = cell_names.collect { |n| source.cell_by_name(n) }\ntarget_cells = cell_names.collect { |n| target.create_cell(n) }\n\ncm = RBA::CellMapping::new\ncm.for_multi_cells_full(target_cells, source_cells)\ntarget.copy_tree_shapes(source, cm)\n@/code\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 34
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CellMapping' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> CellMapping
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> CellMapping
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cell_mapping
method descriptor
cell_mapping() -> int
@brief Determines cell mapping of a layout_b cell to the corresponding layout_a cell.
@param cell_index_b The index of the cell in layout_b whose mapping is requested. @return The cell index in layout_a.
Note that the returned index can be \DropCell to indicate the cell shall be dropped.
clear
method descriptor
clear() -> None
@brief Clears the mapping.
This method has been introduced in version 0.23.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> CellMapping
@brief Creates a copy of self
for_multi_cells
method descriptor
for_multi_cells(cell_a: Sequence[Cell], cell_b: Sequence[Cell]) -> None
for_multi_cells(layout_a: Layout, cell_indexes_a: Sequence[int], layout_b: Layout, cell_indexes_b: Sequence[int]) -> None
for_multi_cells()
@brief Initializes the cell mapping for top-level identity
@param cell_a A list of target cells. @param cell_b A list of source cells. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
for_multi_cells_full
method descriptor
for_multi_cells_full(cell_a: Sequence[Cell], cell_b: Sequence[Cell]) -> List[int]
for_multi_cells_full(layout_a: Layout, cell_indexes_a: Sequence[int], layout_b: Layout, cell_indexes_b: Sequence[int]) -> List[int]
for_multi_cells_full()
@brief Initializes the cell mapping for top-level identity in full mapping mode
@param cell_a A list of target cells. @param cell_b A list of source cells. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
for_single_cell
method descriptor
for_single_cell(cell_a: Cell, cell_b: Cell) -> None
for_single_cell(layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> None
for_single_cell()
@brief Initializes the cell mapping for top-level identity
@param cell_a The target cell. @param cell_b The source cell. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
for_single_cell_full
method descriptor
for_single_cell_full(cell_a: Cell, cell_b: Cell) -> List[int]
for_single_cell_full(layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]
for_single_cell_full()
@brief Initializes the cell mapping for top-level identity in full mapping mode
@param cell_a The target cell. @param cell_b The source cell. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
from_geometry
method descriptor
from_geometry(cell_a: Cell, cell_b: Cell) -> None
from_geometry(layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> None
from_geometry()
@brief Initializes the cell mapping using the geometrical identity
@param cell_a The target cell. @param cell_b The source cell. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
from_geometry_full
method descriptor
from_geometry_full(cell_a: Cell, cell_b: Cell) -> List[int]
from_geometry_full(layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]
from_geometry_full()
@brief Initializes the cell mapping using the geometrical identity in full mapping mode
@param cell_a The target cell. @param cell_b The source cell. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
from_names
method descriptor
from_names(cell_a: Cell, cell_b: Cell) -> None
from_names(layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> None
from_names()
@brief Initializes the cell mapping using the name identity
@param cell_a The target cell. @param cell_b The source cell. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
from_names_full
method descriptor
from_names_full(cell_a: Cell, cell_b: Cell) -> List[int]
from_names_full(layout_a: Layout, cell_index_a: int, layout_b: Layout, cell_index_b: int) -> List[int]
from_names_full()
@brief Initializes the cell mapping using the name identity in full mapping mode
@param cell_a The target cell. @param cell_b The source cell. @return A list of indexes of cells created.
This is a convenience version which uses cell references instead of layout/cell index combinations. It has been introduced in version 0.28.
has_mapping
method descriptor
has_mapping() -> bool
@brief Returns as value indicating whether a cell of layout_b has a mapping to a layout_a cell.
@param cell_index_b The index of the cell in layout_b whose mapping is requested. @return true, if the cell has a mapping
Note that if the cell is supposed to be dropped (see \DropCell), the respective source cell will also be regarded "mapped", so has_mapping? will return true in this case.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
map
method descriptor
map() -> None
@brief Explicitly specifies a mapping.
@param cell_index_b The index of the cell in layout B (the "source") @param cell_index_a The index of the cell in layout A (the "target") - this index can be \DropCell
Beside using the mapping generator algorithms provided through \from_names and \from_geometry, it is possible to explicitly specify cell mappings using this method.
This method has been introduced in version 0.23.
new
builtin
new() -> CellMapping
@brief Creates a new object of this class
table
method descriptor
table() -> Dict[int, int]
@brief Returns the mapping table.
The mapping table is a dictionary where the keys are source layout cell indexes and the values are the target layout cell indexes. Note that the target cell index can be \DropCell to indicate that a cell is supposed to be dropped.
This method has been introduced in version 0.25.
Circuit
Bases: klayout.dbcore.NetlistObject
@brief Circuits are the basic building blocks of the netlist A circuit has pins by which it can connect to the outside. Pins are created using \create_pin and are represented by the \Pin class.
Furthermore, a circuit manages the components of the netlist. Components are devices (class \Device) and subcircuits (class \SubCircuit). Devices are basic devices such as resistors or transistors. Subcircuits are other circuits to which nets from this circuit connect. Devices are created using the \create_device method. Subcircuits are created using the \create_subcircuit method.
Devices are connected through 'terminals', subcircuits are connected through their pins. Terminals and pins are described by integer ID's in the context of most methods.
Finally, the circuit consists of the nets. Nets connect terminals of devices and pins of subcircuits or the circuit itself. Nets are created using \create_net and are represented by objects of the \Net class. See there for more about nets.
The Circuit object is only valid if the netlist object is alive. Circuits must be added to a netlist using \Netlist#add to become part of the netlist.
The Circuit class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief Circuits are the basic building blocks of the netlist\nA circuit has pins by which it can connect to the outside. Pins are created using \\create_pin and are represented by the \\Pin class.\n\nFurthermore, a circuit manages the components of the netlist. Components are devices (class \\Device) and subcircuits (class \\SubCircuit). Devices are basic devices such as resistors or transistors. Subcircuits are other circuits to which nets from this circuit connect. Devices are created using the \\create_device method. Subcircuits are created using the \\create_subcircuit method.\n\nDevices are connected through 'terminals', subcircuits are connected through their pins. Terminals and pins are described by integer ID's in the context of most methods.\n\nFinally, the circuit consists of the nets. Nets connect terminals of devices and pins of subcircuits or the circuit itself. Nets are created using \\create_net and are represented by objects of the \\Net class.\nSee there for more about nets.\n\nThe Circuit object is only valid if the netlist object is alive. Circuits must be added to a netlist using \\Netlist#add to become part of the netlist.\n\nThe Circuit class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 102
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
boundary
class
boundary: DPolygon = <attribute 'boundary' of 'Circuit' objects>
@brief Gets the boundary of the circuit
@brief Sets the boundary of the circuit
cell_index
class
cell_index: int = <attribute 'cell_index' of 'Circuit' objects>
@brief Gets the cell index of the circuit See \cell_index= for details.
@brief Sets the cell index The cell index relates a circuit with a cell from a layout. It's intended to hold a cell index number if the netlist was extracted from a layout.
dont_purge
class
dont_purge: bool = <attribute 'dont_purge' of 'Circuit' objects>
@brief Gets a value indicating whether the circuit can be purged on \Netlist#purge.
@brief Sets a value indicating whether the circuit can be purged on \Netlist#purge. If this attribute is set to true, \Netlist#purge will never delete this circuit. This flag therefore marks this circuit as 'precious'.
name
class
name: str = <attribute 'name' of 'Circuit' objects>
@brief Gets the name of the circuit
@brief Sets the name of the circuit
blank
method descriptor
blank() -> None
@brief Blanks out the circuit This method will remove all the innards of the circuit and just leave the pins. The pins won't be connected to inside nets anymore, but the circuit can still be called by subcircuit references. This method will eventually create a 'circuit abstract' (or black box). It will set the \dont_purge flag to mark this circuit as 'intentionally empty'.
clear
method descriptor
clear() -> None
@brief Clears the circuit This method removes all objects and clears the other attributes.
combine_devices
method descriptor
combine_devices() -> None
@brief Combines devices where possible This method will combine devices that can be combined according to their device classes 'combine_devices' method. For example, serial or parallel resistors can be combined into a single resistor.
connect_pin
method descriptor
connect_pin(pin: Pin, net: Net) -> None
connect_pin(pin_id: int, net: Net) -> None
connect_pin()
@brief Connects the given pin with the given net. The net and the pin must be objects from inside the circuit. Any previous connected is resolved before this connection is made. A pin can only be connected to one net at a time.
create_device
method descriptor
create_device() -> Device
@brief Creates a new bound \Device object inside the circuit This object describes a device of the circuit. The device is already attached to the device class. The name is optional and is used to identify the device in a netlist file.
For more details see the \Device class.
create_net
method descriptor
create_net() -> Net
@brief Creates a new \Net object inside the circuit This object will describe a net of the circuit. The nets are basically connections between the different components of the circuit (subcircuits, devices and pins).
A net needs to be filled with references to connect to specific objects. See the \Net class for more details.
create_pin
method descriptor
create_pin() -> Pin
@brief Creates a new \Pin object inside the circuit This object will describe a pin of the circuit. A circuit connects to the outside through such a pin. The pin is added after all existing pins. For more details see the \Pin class.
Starting with version 0.26.8, this method returns a reference to a \Pin object rather than a copy.
create_subcircuit
method descriptor
create_subcircuit() -> SubCircuit
@brief Creates a new bound \SubCircuit object inside the circuit This object describes an instance of another circuit inside the circuit. The subcircuit is already attached to the other circuit. The name is optional and is used to identify the subcircuit in a netlist file.
For more details see the \SubCircuit class.
device_by_id
method descriptor
device_by_id(id: int) -> Device
device_by_id(id: int) -> Device
device_by_id()
@brief Gets the device object for a given ID (const version). If the ID is not a valid device ID, nil is returned.
This constness variant has been introduced in version 0.26.8
device_by_name
method descriptor
device_by_name(name: str) -> Device
device_by_name(name: str) -> Device
device_by_name()
@brief Gets the device object for a given name (const version). If the ID is not a valid device name, nil is returned.
This constness variant has been introduced in version 0.26.8
disconnect_pin
method descriptor
disconnect_pin(pin: Pin) -> None
disconnect_pin(pin_id: int) -> None
disconnect_pin()
@brief Disconnects the given pin from any net.
each_child
method descriptor
each_child() -> Iterator[Circuit]
each_child() -> Iterator[Circuit]
each_child()
@brief Iterates over the child circuits of this circuit (const version) Child circuits are the ones that are referenced from this circuit via subcircuits.
This constness variant has been introduced in version 0.26.8
each_device
method descriptor
each_device() -> Iterator[Device]
each_device() -> Iterator[Device]
each_device()
@brief Iterates over the devices of the circuit (const version)
This constness variant has been introduced in version 0.26.8
each_net
method descriptor
each_net() -> Iterator[Net]
each_net() -> Iterator[Net]
each_net()
@brief Iterates over the nets of the circuit (const version)
This constness variant has been introduced in version 0.26.8
each_parent
method descriptor
each_parent() -> Iterator[Circuit]
each_parent() -> Iterator[Circuit]
each_parent()
@brief Iterates over the parent circuits of this circuit (const version) Child circuits are the ones that are referencing this circuit via subcircuits.
This constness variant has been introduced in version 0.26.8
each_pin
method descriptor
each_pin() -> Iterator[Pin]
each_pin() -> Iterator[Pin]
each_pin()
@brief Iterates over the pins of the circuit (const version)
This constness variant has been introduced in version 0.26.8
each_ref
method descriptor
each_ref() -> Iterator[SubCircuit]
each_ref() -> Iterator[SubCircuit]
each_ref()
@brief Iterates over the subcircuit objects referencing this circuit (const version)
This constness variant has been introduced in version 0.26.8
each_subcircuit
method descriptor
each_subcircuit() -> Iterator[SubCircuit]
each_subcircuit() -> Iterator[SubCircuit]
each_subcircuit()
@brief Iterates over the subcircuits of the circuit (const version)
This constness variant has been introduced in version 0.26.8
flatten_subcircuit
method descriptor
flatten_subcircuit() -> None
@brief Flattens a subcircuit This method will substitute the given subcircuit by its contents. The subcircuit is removed after this.
has_refs
method descriptor
has_refs() -> bool
@brief Returns a value indicating whether the circuit has references A circuit has references if there is at least one subcircuit referring to it.
join_nets
method descriptor
join_nets() -> None
@brief Joins (connects) two nets into one This method will connect the 'with' net with 'net' and remove 'with'.
This method has been introduced in version 0.26.4. Starting with version 0.28.13, net names will be formed from both input names, combining them with as a comma-separated list.
net_by_cluster_id
method descriptor
net_by_cluster_id() -> Net
@brief Gets the net object corresponding to a specific cluster ID If the ID is not a valid pin cluster ID, nil is returned.
net_by_name
method descriptor
net_by_name(name: str) -> Net
net_by_name(name: str) -> Net
net_by_name()
@brief Gets the net object for a given name (const version). If the ID is not a valid net name, nil is returned.
This constness variant has been introduced in version 0.26.8
net_for_pin
method descriptor
net_for_pin(pin: Pin) -> Net
net_for_pin(pin: Pin) -> Net
net_for_pin(pin_id: int) -> Net
net_for_pin(pin_id: int) -> Net
net_for_pin()
@brief Gets the net object attached to a specific pin (const version). This is the net object inside the circuit which attaches to the given outward-bound pin. This method returns nil if the pin is not connected or the pin object is nil.
This constness variant has been introduced in version 0.26.8
netlist
method descriptor
netlist() -> Netlist
netlist() -> Netlist
netlist()
@brief Gets the netlist object the circuit lives in (const version)
This constness variant has been introduced in version 0.26.8
nets_by_name
method descriptor
nets_by_name(name_pattern: str) -> List[Net]
nets_by_name(name_pattern: str) -> List[Net]
nets_by_name()
@brief Gets the net objects for a given name filter (const version). The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern.
This constness variant has been introduced in version 0.27.3
pin_by_id
method descriptor
pin_by_id(id: int) -> Pin
pin_by_id(id: int) -> Pin
pin_by_id()
@brief Gets the \Pin object corresponding to a specific ID (const version) If the ID is not a valid pin ID, nil is returned.
This constness variant has been introduced in version 0.26.8
pin_by_name
method descriptor
pin_by_name(name: str) -> Pin
pin_by_name(name: str) -> Pin
pin_by_name()
@brief Gets the \Pin object corresponding to a specific name (const version) If the ID is not a valid pin name, nil is returned.
This constness variant has been introduced in version 0.26.8
pin_count
method descriptor
pin_count() -> int
@brief Gets the number of pins in the circuit
purge_devices
method descriptor
purge_devices() -> None
@brief Purges invalid devices. Purges devices which are considered invalid. Such devices are for example those whose terminals are all connected to a single net.
This method has been added in version 0.29.7.
purge_nets
method descriptor
purge_nets() -> None
@brief Purges floating nets. Floating nets are nets with no device or subcircuit attached to. Such floating nets are removed in this step. If these nets are connected outward to a circuit pin, this circuit pin is also removed.
purge_nets_keep_pins
method descriptor
purge_nets_keep_pins() -> None
@brief Purges floating nets but keep pins. This method will remove floating nets like \purge_nets, but if these nets are attached to a pin, the pin will be left disconnected from any net.
This method has been introduced in version 0.26.2.
remove_device
method descriptor
remove_device() -> None
@brief Removes the given device from the circuit
remove_net
method descriptor
remove_net() -> None
@brief Removes the given net from the circuit
remove_pin
method descriptor
remove_pin() -> None
@brief Removes the pin with the given ID from the circuit
This method has been introduced in version 0.26.2.
remove_subcircuit
method descriptor
remove_subcircuit() -> None
@brief Removes the given subcircuit from the circuit
rename_pin
method descriptor
rename_pin() -> None
@brief Renames the pin with the given ID to 'new_name'
This method has been introduced in version 0.26.8.
subcircuit_by_id
method descriptor
subcircuit_by_id(id: int) -> SubCircuit
subcircuit_by_id(id: int) -> SubCircuit
subcircuit_by_id()
@brief Gets the subcircuit object for a given ID (const version). If the ID is not a valid subcircuit ID, nil is returned.
This constness variant has been introduced in version 0.26.8
subcircuit_by_name
method descriptor
subcircuit_by_name(name: str) -> SubCircuit
subcircuit_by_name(name: str) -> SubCircuit
subcircuit_by_name()
@brief Gets the subcircuit object for a given name (const version). If the ID is not a valid subcircuit name, nil is returned.
This constness variant has been introduced in version 0.26.8
CompoundRegionOperationNode
@brief A base class for compound DRC operations
This class is not intended to be used directly but rather provide a factory for various incarnations of compound operation nodes. Compound operations are a way to specify complex DRC operations put together by building a tree of operations. This operation tree then is executed with \Region#complex_op and will act on individual clusters of shapes and their interacting neighbors.
A basic concept to the compound operations is the 'subject' (primary) and 'intruder' (secondary) input. The 'subject' is the Region, 'complex_op' with the operation tree is executed on. 'intruders' are regions inserted into the equation through secondary input nodes created with \new_secondary_node. The algorithm will execute the operation tree for every subject shape considering intruder shapes from the secondary inputs. The algorithm will only act on subject shapes primarily. As a consequence, 'lonely' intruder shapes without a subject shape are not considered at all. Only subject shapes trigger evaluation of the operation tree.
The search distance for intruder shapes is determined by the operation and computed from the operation's requirements.
This class has been introduced in version 0.27. The API is considered internal and will change without notice.
__doc__
class
__doc__ = "@brief A base class for compound DRC operations\n\nThis class is not intended to be used directly but rather provide a factory for various incarnations of compound operation nodes. Compound operations are a way to specify complex DRC operations put together by building a tree of operations. This operation tree then is executed with \\Region#complex_op and will act on individual clusters of shapes and their interacting neighbors.\n\nA basic concept to the compound operations is the 'subject' (primary) and 'intruder' (secondary) input. The 'subject' is the Region, 'complex_op' with the operation tree is executed on. 'intruders' are regions inserted into the equation through secondary input nodes created with \\new_secondary_node. The algorithm will execute the operation tree for every subject shape considering intruder shapes from the secondary inputs. The algorithm will only act on subject shapes primarily. As a consequence, 'lonely' intruder shapes without a subject shape are not considered at all. Only subject shapes trigger evaluation of the operation tree.\n\nThe search distance for intruder shapes is determined by the operation and computed from the operation's requirements.\n\nThis class has been introduced in version 0.27. The API is considered internal and will change without notice."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 35
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CompoundRegionOperationNode' objects>
list of weak references to the object
description
class
description: str = <attribute 'description' of 'CompoundRegionOperationNode' objects>
@brief Gets the description for this node
@brief Sets the description for this node
distance
class
distance: int = <attribute 'distance' of 'CompoundRegionOperationNode' objects>
@brief Gets the distance value for this node
@brief Sets the distance value for this nodeUsually it's not required to provide a distance because the nodes compute a distance based on their operation. If necessary you can supply a distance. The processor will use this distance or the computed one, whichever is larger.
GeometricalOp
@brief This class represents the CompoundRegionOperationNode::GeometricalOp enum
This enum has been introduced in version 0.27.
And
class
And: GeometricalOp = And (0)
@brief This class represents the CompoundRegionOperationNode::GeometricalOp enum
This enum has been introduced in version 0.27.
Not
class
Not: GeometricalOp = Not (1)
@brief This class represents the CompoundRegionOperationNode::GeometricalOp enum
This enum has been introduced in version 0.27.
Or
class
Or: GeometricalOp = Or (2)
@brief This class represents the CompoundRegionOperationNode::GeometricalOp enum
This enum has been introduced in version 0.27.
Xor
class
Xor: GeometricalOp = Xor (3)
@brief This class represents the CompoundRegionOperationNode::GeometricalOp enum
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the CompoundRegionOperationNode::GeometricalOp enum\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 37
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'GeometricalOp' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: CompoundRegionOperationNode.GeometricalOp) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> CompoundRegionOperationNode.GeometricalOp
new(s: str) -> CompoundRegionOperationNode.GeometricalOp
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
LogicalOp
@brief This class represents the CompoundRegionOperationNode::LogicalOp enum
This enum has been introduced in version 0.27.
LogAnd
class
LogAnd: LogicalOp = LogAnd (0)
@brief This class represents the CompoundRegionOperationNode::LogicalOp enum
This enum has been introduced in version 0.27.
LogOr
class
LogOr: LogicalOp = LogOr (1)
@brief This class represents the CompoundRegionOperationNode::LogicalOp enum
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the CompoundRegionOperationNode::LogicalOp enum\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 36
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LogicalOp' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: CompoundRegionOperationNode.LogicalOp) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> CompoundRegionOperationNode.LogicalOp
new(s: str) -> CompoundRegionOperationNode.LogicalOp
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
ParameterType
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_bbox_filter
This enum has been introduced in version 0.27.
BoxAverageDim
class
BoxAverageDim: ParameterType = BoxAverageDim (4)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_bbox_filter
This enum has been introduced in version 0.27.
BoxHeight
class
BoxHeight: ParameterType = BoxHeight (1)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_bbox_filter
This enum has been introduced in version 0.27.
BoxMaxDim
class
BoxMaxDim: ParameterType = BoxMaxDim (2)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_bbox_filter
This enum has been introduced in version 0.27.
BoxMinDim
class
BoxMinDim: ParameterType = BoxMinDim (3)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_bbox_filter
This enum has been introduced in version 0.27.
BoxWidth
class
BoxWidth: ParameterType = BoxWidth (0)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_bbox_filter
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the parameter type enum used in \\CompoundRegionOperationNode#new_bbox_filter\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 39
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ParameterType' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: CompoundRegionOperationNode.ParameterType) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> CompoundRegionOperationNode.ParameterType
new(s: str) -> CompoundRegionOperationNode.ParameterType
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
RatioParameterType
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_ratio_filter
This enum has been introduced in version 0.27.
AreaRatio
class
AreaRatio: RatioParameterType = AreaRatio (0)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_ratio_filter
This enum has been introduced in version 0.27.
AspectRatio
class
AspectRatio: RatioParameterType = AspectRatio (1)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_ratio_filter
This enum has been introduced in version 0.27.
RelativeHeight
class
RelativeHeight: RatioParameterType = RelativeHeight (2)
@brief This class represents the parameter type enum used in \CompoundRegionOperationNode#new_ratio_filter
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the parameter type enum used in \\CompoundRegionOperationNode#new_ratio_filter\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 40
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'RatioParameterType' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: CompoundRegionOperationNode.RatioParameterType) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> CompoundRegionOperationNode.RatioParameterType
new(s: str) -> CompoundRegionOperationNode.RatioParameterType
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
ResultType
@brief This class represents the CompoundRegionOperationNode::ResultType enum
This enum has been introduced in version 0.27.
EdgePairs
class
EdgePairs: ResultType = EdgePairs (2)
@brief This class represents the CompoundRegionOperationNode::ResultType enum
This enum has been introduced in version 0.27.
Edges
class
Edges: ResultType = Edges (1)
@brief This class represents the CompoundRegionOperationNode::ResultType enum
This enum has been introduced in version 0.27.
Region
class
Region: ResultType = Region (0)
@brief This class represents the CompoundRegionOperationNode::ResultType enum
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the CompoundRegionOperationNode::ResultType enum\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 38
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ResultType' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: CompoundRegionOperationNode.ResultType) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> CompoundRegionOperationNode.ResultType
new(s: str) -> CompoundRegionOperationNode.ResultType
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> CompoundRegionOperationNode
@brief Creates a new object of this class
new_area_filter
builtin
new_area_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by area. This node renders the input if the area is between amin and amax (exclusively). If 'inverse' is set to true, the input shape is returned if the area is less than amin (exclusively) or larger than amax (inclusively).
new_area_sum_filter
builtin
new_area_sum_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by area sum. Like \new_area_filter, but applies to the sum of all shapes in the current set.
new_bbox_filter
builtin
new_bbox_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by bounding box parameters. This node renders the input if the specified bounding box parameter of the input shape is between pmin and pmax (exclusively). If 'inverse' is set to true, the input shape is returned if the parameter is less than pmin (exclusively) or larger than pmax (inclusively).
new_case
builtin
new_case() -> CompoundRegionOperationNode
@brief Creates a 'switch ladder' (case statement) compound operation node.
The inputs are treated as a sequence of condition/result pairs: c1,r1,c2,r2 etc. If there is an odd number of inputs, the last element is taken as the default result. The implementation will evaluate c1 and if not empty, will render r1. Otherwise, c2 will be evaluated and r2 rendered if c2 isn't empty etc. If none of the conditions renders a non-empty set and a default result is present, the default will be returned. Otherwise, the result is empty.
new_centers
builtin
new_centers() -> CompoundRegionOperationNode
@brief Creates a node delivering a part at the center of each input edge.
new_convex_decomposition
builtin
new_convex_decomposition() -> CompoundRegionOperationNode
@brief Creates a node providing a composition into convex pieces.
new_corners_as_dots
builtin
new_corners_as_dots() -> CompoundRegionOperationNode
@brief Creates a node turning corners into dots (single-point edges).
'absolute' and 'inverse' arguments have been added in version 0.29.1.
new_corners_as_edge_pairs
builtin
new_corners_as_edge_pairs() -> CompoundRegionOperationNode
@brief Creates a node turning corners into edge pairs containing the two edges adjacent to the corner. The first edge will be the incoming edge and the second one the outgoing edge.
This feature has been introduced in version 0.27.1. 'absolute' and 'inverse' arguments have been added in version 0.29.1.
new_corners_as_rectangles
builtin
new_corners_as_rectangles() -> CompoundRegionOperationNode
@brief Creates a node turning corners into rectangles.
'absolute' and 'inverse' arguments have been added in version 0.29.1.
new_count_filter
builtin
new_count_filter() -> CompoundRegionOperationNode
@brief Creates a node selecting results but their shape count.
new_edge_length_filter
builtin
new_edge_length_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering edges by their length.
new_edge_length_sum_filter
builtin
new_edge_length_sum_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering edges by their length sum (over the local set).
new_edge_orientation_filter
builtin
new_edge_orientation_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering edges by their orientation.
'absolute_angle' has been introduced in version 0.29.1.
new_edge_pair_to_first_edges
builtin
new_edge_pair_to_first_edges() -> CompoundRegionOperationNode
@brief Creates a node delivering the first edge of each edges pair.
new_edge_pair_to_second_edges
builtin
new_edge_pair_to_second_edges() -> CompoundRegionOperationNode
@brief Creates a node delivering the second edge of each edges pair.
new_edges
builtin
new_edges() -> CompoundRegionOperationNode
@brief Creates a node converting polygons into its edges. The 'mode' argument allows selecting specific edges when generating edges from a polygon. See \EdgeMode for the various options. By default, all edges are generated from polygons.
The 'mode' argument has been added in version 0.29.
new_empty
builtin
new_empty() -> CompoundRegionOperationNode
@brief Creates a node delivering an empty result of the given type
new_enclosed_check
builtin
new_enclosed_check() -> CompoundRegionOperationNode
@brief Creates a node providing an enclosed (secondary enclosing primary) check.
This method has been added in version 0.27.5. The zero_distance_mode argument has been inserted in version 0.29.
new_enclosing
builtin
new_enclosing() -> CompoundRegionOperationNode
@brief Creates a node representing an inside selection operation between the inputs.
new_enclosing_check
builtin
new_enclosing_check() -> CompoundRegionOperationNode
@brief Creates a node providing an inside (enclosure) check.
The zero_distance_mode argument has been inserted in version 0.29.
new_end_segments
builtin
new_end_segments() -> CompoundRegionOperationNode
@brief Creates a node delivering a part at the end of each input edge.
new_extended
builtin
new_extended() -> CompoundRegionOperationNode
@brief Creates a node delivering a polygonized version of the edges with the four extension parameters.
new_extended_in
builtin
new_extended_in() -> CompoundRegionOperationNode
@brief Creates a node delivering a polygonized, inside-extended version of the edges.
new_extended_out
builtin
new_extended_out() -> CompoundRegionOperationNode
@brief Creates a node delivering a polygonized, inside-extended version of the edges.
new_extents
builtin
new_extents() -> CompoundRegionOperationNode
@brief Creates a node returning the extents of the objects. The 'e' parameter provides a generic enlargement which is applied to the boxes. This is helpful to cover dot-like edges or edge pairs in the input.
new_foreign
builtin
new_foreign() -> CompoundRegionOperationNode
@brief Creates a node object representing the primary input without the current polygon
new_geometrical_boolean
builtin
new_geometrical_boolean() -> CompoundRegionOperationNode
@brief Creates a node representing a geometrical boolean operation between the inputs.
new_hole_count_filter
builtin
new_hole_count_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by number of holes per polygon. This node renders the input if the hole count is between hmin and hmax (exclusively). If 'inverse' is set to true, the input shape is returned if the hole count is less than hmin (exclusively) or larger than hmax (inclusively).
new_holes
builtin
new_holes() -> CompoundRegionOperationNode
@brief Creates a node extracting the holes from polygons.
new_hulls
builtin
new_hulls() -> CompoundRegionOperationNode
@brief Creates a node extracting the hulls from polygons.
new_inside
builtin
new_inside() -> CompoundRegionOperationNode
@brief Creates a node representing an inside selection operation between the inputs.
new_interacting
builtin
new_interacting() -> CompoundRegionOperationNode
@brief Creates a node representing an interacting selection operation between the inputs.
new_isolated_check
builtin
new_isolated_check() -> CompoundRegionOperationNode
@brief Creates a node providing a isolated polygons (space between different polygons) check.
The zero_distance_mode argument has been inserted in version 0.29.
new_join
builtin
new_join() -> CompoundRegionOperationNode
@brief Creates a node that joins the inputs.
new_logical_boolean
builtin
new_logical_boolean() -> CompoundRegionOperationNode
@brief Creates a node representing a logical boolean operation between the inputs.
A logical AND operation will evaluate the arguments and render the subject shape when all arguments are non-empty. The logical OR operation will evaluate the arguments and render the subject shape when one argument is non-empty. Setting 'inverse' to true will reverse the result and return the subject shape when one argument is empty in the AND case and when all arguments are empty in the OR case.
new_merged
builtin
new_merged() -> CompoundRegionOperationNode
@brief Creates a node providing merged input polygons.
new_minkowski_sum
builtin
new_minkowski_sum(input: CompoundRegionOperationNode, e: Edge) -> CompoundRegionOperationNode
new_minkowski_sum(input: CompoundRegionOperationNode, p: Box) -> CompoundRegionOperationNode
new_minkowski_sum(input: CompoundRegionOperationNode, p: Polygon) -> CompoundRegionOperationNode
new_minkowski_sum(input: CompoundRegionOperationNode, p: Sequence[Point]) -> CompoundRegionOperationNode
new_minkowski_sum()
@brief Creates a node providing a Minkowski sum with a point sequence forming a contour.
new_minkowsky_sum
builtin
new_minkowsky_sum(input: CompoundRegionOperationNode, e: Edge) -> CompoundRegionOperationNode
new_minkowsky_sum(input: CompoundRegionOperationNode, p: Box) -> CompoundRegionOperationNode
new_minkowsky_sum(input: CompoundRegionOperationNode, p: Polygon) -> CompoundRegionOperationNode
new_minkowsky_sum(input: CompoundRegionOperationNode, p: Sequence[Point]) -> CompoundRegionOperationNode
new_minkowsky_sum()
@brief Creates a node providing a Minkowski sum with a point sequence forming a contour.
new_notch_check
builtin
new_notch_check() -> CompoundRegionOperationNode
@brief Creates a node providing a intra-polygon space check.
The zero_distance_mode argument has been inserted in version 0.29.
new_outside
builtin
new_outside() -> CompoundRegionOperationNode
@brief Creates a node representing an outside selection operation between the inputs.
new_overlap_check
builtin
new_overlap_check() -> CompoundRegionOperationNode
@brief Creates a node providing an overlap check.
The zero_distance_mode argument has been inserted in version 0.29.
new_overlapping
builtin
new_overlapping() -> CompoundRegionOperationNode
@brief Creates a node representing an overlapping selection operation between the inputs.
new_perimeter_filter
builtin
new_perimeter_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by perimeter. This node renders the input if the perimeter is between pmin and pmax (exclusively). If 'inverse' is set to true, the input shape is returned if the perimeter is less than pmin (exclusively) or larger than pmax (inclusively).
new_perimeter_sum_filter
builtin
new_perimeter_sum_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by area sum. Like \new_perimeter_filter, but applies to the sum of all shapes in the current set.
new_polygon_breaker
builtin
new_polygon_breaker() -> CompoundRegionOperationNode
@brief Creates a node providing a composition into parts with less than the given number of points and a smaller area ratio.
new_polygons
builtin
new_polygons() -> CompoundRegionOperationNode
@brief Creates a node converting the input to polygons. @param e The enlargement parameter when converting edges or edge pairs to polygons.
new_primary
builtin
new_primary() -> CompoundRegionOperationNode
@brief Creates a node object representing the primary input
new_ratio_filter
builtin
new_ratio_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input by ratio parameters. This node renders the input if the specified ratio parameter of the input shape is between pmin and pmax. If 'pmin_included' is true, the range will include pmin. Same for 'pmax_included' and pmax. If 'inverse' is set to true, the input shape is returned if the parameter is not within the specified range.
new_rectangle_filter
builtin
new_rectangle_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input for rectangular or square shapes. If 'is_square' is true, only squares will be selected. If 'inverse' is true, the non-rectangle/non-square shapes are returned.
new_rectilinear_filter
builtin
new_rectilinear_filter() -> CompoundRegionOperationNode
@brief Creates a node filtering the input for rectilinear shapes (or non-rectilinear ones with 'inverse' set to 'true').
new_relative_extents
builtin
new_relative_extents() -> CompoundRegionOperationNode
@brief Creates a node returning markers at specified locations of the extent (e.g. at the center).
new_relative_extents_as_edges
builtin
new_relative_extents_as_edges() -> CompoundRegionOperationNode
@brief Creates a node returning edges at specified locations of the extent (e.g. at the center).
new_rounded_corners
builtin
new_rounded_corners() -> CompoundRegionOperationNode
@brief Creates a node generating rounded corners. @param rinner The inner corner radius.@param router The outer corner radius.@param n The number if points per full circle.
new_secondary
builtin
new_secondary() -> CompoundRegionOperationNode
@brief Creates a node object representing the secondary input from the given region
new_separation_check
builtin
new_separation_check() -> CompoundRegionOperationNode
@brief Creates a node providing a separation check.
The zero_distance_mode argument has been inserted in version 0.29.
new_sized
builtin
new_sized() -> CompoundRegionOperationNode
@brief Creates a node providing sizing.
new_smoothed
builtin
new_smoothed() -> CompoundRegionOperationNode
@brief Creates a node smoothing the polygons. @param d The tolerance to be applied for the smoothing. @param keep_hv If true, horizontal and vertical edges are maintained.
new_space_check
builtin
new_space_check() -> CompoundRegionOperationNode
@brief Creates a node providing a space check.
The zero_distance_mode argument has been inserted in version 0.29.
new_start_segments
builtin
new_start_segments() -> CompoundRegionOperationNode
@brief Creates a node delivering a part at the beginning of each input edge.
new_strange_polygons_filter
builtin
new_strange_polygons_filter() -> CompoundRegionOperationNode
@brief Creates a node extracting strange polygons. 'strange polygons' are ones which cannot be oriented - e.g. '8' shape polygons.
new_trapezoid_decomposition
builtin
new_trapezoid_decomposition() -> CompoundRegionOperationNode
@brief Creates a node providing a composition into trapezoids.
new_width_check
builtin
new_width_check() -> CompoundRegionOperationNode
@brief Creates a node providing a width check.
The zero_distance_mode argument has been inserted in version 0.29.
result_type
method descriptor
result_type() -> CompoundRegionOperationNode.ResultType
@brief Gets the result type of this node
Connectivity
@brief This class specifies connections between different layers. Connections are build using \connect. There are basically two flavours of connections: intra-layer and inter-layer.
Intra-layer connections make nets begin propagated along different shapes on the same net. Without the intra-layer connections, nets are not propagated over shape boundaries. As this is usually intended, intra-layer connections should always be specified for each layer.
Inter-layer connections connect shapes on different layers. Shapes which touch across layers will be connected if their layers are specified as being connected through inter-layer \connect.
All layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \Layout class).
The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. Starting with version 0.29, soft connections are supported. Soft connections attach to high-ohmic substrate or diffusion layers (the 'lower' layer) are upon netlist extraction it will be checked that no wiring is routed over such connections. See \soft_connect and \soft_global_connect for details.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief This class specifies connections between different layers.\nConnections are build using \\connect. There are basically two flavours of connections: intra-layer and inter-layer.\n\nIntra-layer connections make nets begin propagated along different shapes on the same net. Without the intra-layer connections, nets are not propagated over shape boundaries. As this is usually intended, intra-layer connections should always be specified for each layer.\n\nInter-layer connections connect shapes on different layers. Shapes which touch across layers will be connected if their layers are specified as being connected through inter-layer \\connect.\n\nAll layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \\Layout class).\n\nThe connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \\global_net_name.\nStarting with version 0.29, soft connections are supported. Soft connections attach to high-ohmic substrate or diffusion layers (the 'lower' layer) are upon netlist extraction it will be checked that no wiring is routed over such connections. See \\soft_connect and \\soft_global_connect for details.\n\nThis class has been introduced in version 0.26.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 58
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Connectivity' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Connectivity
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Connectivity
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__repr__
method descriptor
__repr__() -> str
@hide
__str__
method descriptor
__str__() -> str
@hide
assign
method descriptor
assign() -> None
@brief Assigns another object to self
connect
method descriptor
connect(layer: int) -> None
connect(layer_a: int, layer_b: int) -> None
connect()
@brief Specifies inter-layer connectivity. This method specifies a hard connection between shapes on layer_a and layer_b.
connect_global
method descriptor
connect_global() -> int
@brief Connects the given layer to the global net given by name. Returns the ID of the global net.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Connectivity
@brief Creates a copy of self
global_net_id
method descriptor
global_net_id() -> int
@brief Gets the ID for a given global net name.
global_net_name
method descriptor
global_net_name() -> str
@brief Gets the name for a given global net ID.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Connectivity
@brief Creates a new object of this class
soft_connect
method descriptor
soft_connect() -> None
@brief Specifies a soft connection between layer_a and layer_b. @param layer_a The 'upper' layer @param layer_b The 'lower' layer Soft connections are made between a lower and an upper layer. The lower layer conceptually is a high-ohmic (i.e. substrate, diffusion) region that is not intended for signal wiring. The netlist extraction will check that no routing happens over such regions.
Soft connections have in introduced in version 0.29.
soft_connect_global
method descriptor
soft_connect_global() -> int
@brief Soft-connects the given layer to the global net given by name. Returns the ID of the global net. See \soft_connect for a description of the soft connection feature. The global net is always the 'lower' (i.e. high-ohmic, substrate) part of the soft connection.
Soft connections have in introduced in version 0.29.
to_s
method descriptor
to_s() -> str
@hide
CplxTrans
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
M0
class
M0: CplxTrans = m0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
M135
class
M135: CplxTrans = m135 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
M45
class
M45: CplxTrans = m45 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
M90
class
M90: CplxTrans = m90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
R0
class
R0: CplxTrans = r0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
R180
class
R180: CplxTrans = r180 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
R270
class
R270: CplxTrans = r270 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
R90
class
R90: CplxTrans = r90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.
Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A complex transformation\n\nA complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary\nangle and a displacement. This is also the order, the operations are applied.\nThis version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications.\n\nComplex transformations are extensions of the simple transformation classes (\\Trans or \\DTrans in that case) and behave similar.\n\nTransformations can be used to transform points or other objects. Transformations can be combined with the \'*\' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:\n\n@code\n# Create a transformation that applies a magnification of 1.5, a rotation by 90 degree\n# and displacement of 10 in x and 20 units in y direction:\nt = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0)\nt.to_s # r90 *1.5 10,20\n# compute the inverse:\nt.inverted.to_s # r270 *0.666666667 -13,7\n# Combine with another displacement (applied after that):\n(RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25\n# Transform a point:\nt.trans(RBA::DPoint::new(100, 200)).to_s # -290,170\n@/code\n\nThe inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not.\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 189
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CplxTrans' objects>
list of weak references to the object
angle
class
angle: float = <attribute 'angle' of 'CplxTrans' objects>
@brief Gets the angle
Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree.
@return The rotation angle this transformation provides in degree units (0..360 deg).
@brief Sets the angle @param a The new angle See \angle for a description of that attribute.
disp
class
disp: DVector = <attribute 'disp' of 'CplxTrans' objects>
@brief Gets the displacement
@brief Sets the displacement @param u The new displacement
mag
class
mag: float = <attribute 'mag' of 'CplxTrans' objects>
@brief Gets the magnification
@brief Sets the magnification @param m The new magnification
mirror
class
mirror: bool = <attribute 'mirror' of 'CplxTrans' objects>
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
@brief Sets the mirror flag "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag
__copy__
method descriptor
__copy__() -> CplxTrans
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> CplxTrans
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(c: CplxTrans, mag: Optional[float] = ..., u: Optional[DVector] = ...) -> None
__init__(c: CplxTrans, mag: Optional[float] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[DVector] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> None
__init__(t: Trans, mag: Optional[float] = ...) -> None
__init__(trans: DCplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: ICplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: VCplxTrans, dbu: Optional[float] = ...) -> None
__init__(u: DVector) -> None
__init__(x: float, y: float) -> None
__init__()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
__lt__
method descriptor
__lt__() -> bool
@brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions.
__mul__
method descriptor
__mul__(box: Box) -> DBox
__mul__(d: int) -> float
__mul__(edge: Edge) -> DEdge
__mul__(p: Point) -> DPoint
__mul__(p: Vector) -> DVector
__mul__(path: Path) -> DPath
__mul__(polygon: Polygon) -> DPolygon
__mul__(t: CplxTrans) -> CplxTrans
__mul__(t: ICplxTrans) -> CplxTrans
__mul__(t: VCplxTrans) -> DCplxTrans
__mul__(text: Text) -> DText
__mul__()
@brief Returns the concatenated transformation
The * operator returns self*t ("t is applied before this transformation").
@param t The transformation to apply before @return The modified transformation
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality
__repr__
method descriptor
__repr__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: Box) -> DBox
__rmul__(d: int) -> float
__rmul__(edge: Edge) -> DEdge
__rmul__(p: Point) -> DPoint
__rmul__(p: Vector) -> DVector
__rmul__(path: Path) -> DPath
__rmul__(polygon: Polygon) -> DPolygon
__rmul__(text: Text) -> DText
__rmul__()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
ctrans
method descriptor
ctrans() -> float
@brief Transforms a single distance
The "ctrans" method transforms the given distance. This is equivalent to multiplying with the magnification. For the simple transformations, there is no magnification and no modification of the distance.
@param d The distance to transform @return The transformed distance
The product '*' has been added as a synonym in version 0.28. The distance can be signed since version 0.29.3.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> CplxTrans
@brief Creates a copy of self
from_dtrans
builtin
from_dtrans() -> CplxTrans
@brief Creates an integer-to-floating-point coordinate transformation from another coordinate flavour The 'dbu' argument is used to transform the input space from floating-point units to integer units. Formally, the CplxTrans transformation is initialized with 'trans * from_dbu' where 'from_dbu' is the transformation into micrometer space, or more precisely 'CplxTrans(mag=dbu)'.
This constructor has been introduced in version 0.25. The 'dbu' argument has been added in version 0.29.
from_s
builtin
from_s() -> CplxTrans
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> CplxTrans
@brief Inverts the transformation (in place)
Inverts the transformation and replaces this transformation by its inverted one.
@return The inverted transformation
inverted
method descriptor
inverted() -> VCplxTrans
@brief Returns the inverted transformation
Returns the inverted transformation. This method does not modify the transformation.
@return The inverted transformation
is_complex
method descriptor
is_complex() -> bool
@brief Returns true if the transformation is a complex one
If this predicate is false, the transformation can safely be converted to a simple transformation. Otherwise, this conversion will be lossy. The predicate value is equivalent to 'is_mag || !is_ortho'.
This method has been introduced in version 0.27.5.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mag
method descriptor
is_mag() -> bool
@brief Tests, if the transformation is a magnifying one
This is the recommended test for checking if the transformation represents a magnification.
is_mirror
method descriptor
is_mirror() -> bool
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
is_ortho
method descriptor
is_ortho() -> bool
@brief Tests, if the transformation is an orthogonal transformation
If the rotation is by a multiple of 90 degree, this method will return true.
is_unity
method descriptor
is_unity() -> bool
@brief Tests, whether this is a unit transformation
new
builtin
new() -> CplxTrans
new(c: CplxTrans, mag: Optional[float] = ..., u: Optional[DVector] = ...) -> CplxTrans
new(c: CplxTrans, mag: Optional[float] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> CplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[DVector] = ...) -> CplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> CplxTrans
new(t: Trans, mag: Optional[float] = ...) -> CplxTrans
new(trans: DCplxTrans, dbu: Optional[float] = ...) -> CplxTrans
new(trans: ICplxTrans, dbu: Optional[float] = ...) -> CplxTrans
new(trans: VCplxTrans, dbu: Optional[float] = ...) -> CplxTrans
new(u: DVector) -> CplxTrans
new(x: float, y: float) -> CplxTrans
new()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
rot
method descriptor
rot() -> int
@brief Returns the respective simple transformation equivalent rotation code if possible
If this transformation is orthogonal (is_ortho () == true), then this method will return the corresponding fixpoint transformation, not taking into account magnification and displacement. If the transformation is not orthogonal, the result reflects the quadrant the rotation goes into.
s_trans
method descriptor
s_trans() -> Trans
@brief Extracts the simple transformation part
The simple transformation part does not reflect magnification or arbitrary angles. Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0.
to_itrans
method descriptor
to_itrans() -> ICplxTrans
@brief Converts the transformation to another transformation with integer input and output coordinates
This method is redundant with the conversion constructors. Instead of 'to_itrans' use the conversion constructor:
@code itrans = RBA::ICplxTrans::new(trans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
to_s
method descriptor
to_s() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
to_trans
method descriptor
to_trans() -> DCplxTrans
@brief Converts the transformation to another transformation with floating-point input coordinates
This method is redundant with the conversion constructors. Instead of 'to_trans' use the conversion constructor:
@code dtrans = RBA::DCplxTrans::new(trans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
to_vtrans
method descriptor
to_vtrans() -> VCplxTrans
@brief Converts the transformation to another transformation with integer output and floating-point input coordinates
This method is redundant with the conversion constructors. Instead of 'to_vtrans' use the conversion constructor:
@code vtrans = RBA::VCplxTrans::new(trans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
trans
method descriptor
trans(box: Box) -> DBox
trans(edge: Edge) -> DEdge
trans(p: Point) -> DPoint
trans(p: Vector) -> DVector
trans(path: Path) -> DPath
trans(polygon: Polygon) -> DPolygon
trans(text: Text) -> DText
trans()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
DBox
@brief A box class with floating-point coordinates
This object represents a box (a rectangular shape).
The definition of the attributes is: p1 is the lower left point, p2 the upper right one. If a box is constructed from two points (or four coordinates), the coordinates are sorted accordingly.
A box can be empty. An empty box represents no area (not even a point). Empty boxes behave neutral with respect to most operations. Empty boxes return true on \empty?.
A box can be a point or a single line. In this case, the area is zero but the box still can overlap other boxes for example and it is not empty.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A box class with floating-point coordinates\n\nThis object represents a box (a rectangular shape).\n\nThe definition of the attributes is: p1 is the lower left point, p2 the \nupper right one. If a box is constructed from two points (or four coordinates), the \ncoordinates are sorted accordingly.\n\nA box can be empty. An empty box represents no area\n(not even a point). Empty boxes behave neutral with respect to most operations. \nEmpty boxes return true on \\empty?.\n\nA box can be a point or a single\nline. In this case, the area is zero but the box still\ncan overlap other boxes for example and it is not empty.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 28
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DBox' objects>
list of weak references to the object
bottom
class
bottom: float = <attribute 'bottom' of 'DBox' objects>
@brief Gets the bottom coordinate of the box
@brief Sets the bottom coordinate of the box
left
class
left: float = <attribute 'left' of 'DBox' objects>
@brief Gets the left coordinate of the box
@brief Sets the left coordinate of the box
p1
class
p1: DPoint = <attribute 'p1' of 'DBox' objects>
@brief Gets the lower left point of the box
@brief Sets the lower left point of the box
p2
class
p2: DPoint = <attribute 'p2' of 'DBox' objects>
@brief Gets the upper right point of the box
@brief Sets the upper right point of the box
right
class
right: float = <attribute 'right' of 'DBox' objects>
@brief Gets the right coordinate of the box
@brief Sets the right coordinate of the box
top
class
top: float = <attribute 'top' of 'DBox' objects>
@brief Gets the top coordinate of the box
@brief Sets the top coordinate of the box
__add__
method descriptor
__add__(box: DBox) -> DBox
__add__(point: DPoint) -> DBox
__add__()
@brief Joins two boxes
The + operator joins the first box with the one given as the second argument. Joining constructs a box that encloses both boxes given. Empty boxes are neutral: they do not change another box when joining. Overwrites this box with the result.
@param box The box to join with this box.
@return The joined box
__and__
method descriptor
__and__() -> DBox
@brief Returns the intersection of this box with another box
The intersection of two boxes is the largest box common to both boxes. The intersection may be empty if both boxes to not touch. If the boxes do not overlap but touch the result may be a single line or point with an area of zero. Overwrites this box with the result.
@param box The box to take the intersection with
@return The intersection box
__copy__
method descriptor
__copy__() -> DBox
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DBox
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns true if this box is equal to the other box Returns true, if this box and the given box are equal
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given box. This method enables boxes as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(box: Box) -> None
__init__(left: float, bottom: float, right: float, top: float) -> None
__init__(lower_left: DPoint, upper_right: DPoint) -> None
__init__(w: float) -> None
__init__(w: float, h: float) -> None
__init__()
@brief Creates a box from two points
Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped.
__lt__
method descriptor
__lt__() -> bool
@brief Returns true if this box is 'less' than another box Returns true, if this box is 'less' with respect to first and second point (in this order)
__mul__
method descriptor
__mul__(box: DBox) -> DBox
__mul__(scale_factor: float) -> DBox
__mul__()
@brief Returns the scaled box
The * operator scales the box with the given factor and returns the result.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled box
__ne__
method descriptor
__ne__() -> bool
@brief Returns true if this box is not equal to the other box Returns true, if this box and the given box are not equal
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing this box
This string can be turned into a box again by using \from_s . If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: DBox) -> DBox
__rmul__(scale_factor: float) -> DBox
__rmul__()
@brief Returns the scaled box
The * operator scales the box with the given factor and returns the result.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled box
__str__
method descriptor
__str__() -> str
@brief Returns a string representing this box
This string can be turned into a box again by using \from_s . If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__sub__
method descriptor
__sub__() -> DBox
@brief Subtraction of boxes
The - operator subtracts the argument box from self. This will return the bounding box of the are covered by self, but not by argument box. Subtracting a box from itself will render an empty box. Subtracting another box from self will modify the first box only if the argument box covers one side entirely.
@param box The box to subtract from this box.
@return The result box
This feature has been introduced in version 0.29.
area
method descriptor
area() -> float
@brief Computes the box area
Returns the box area or 0 if the box is empty
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> DBox
@brief Returns the bounding box This method is provided for consistency of the shape API is returns the box itself.
This method has been introduced in version 0.27.
center
method descriptor
center() -> DPoint
@brief Gets the center of the box
contains
method descriptor
contains(point: DPoint) -> bool
contains(x: float, y: float) -> bool
contains()
@brief Returns true if the box contains the given point
Tests whether a point is inside the box. It also returns true if the point is exactly on the box contour.
@param p The point to test against.
@return true if the point is inside the box.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DBox
@brief Creates a copy of self
empty
method descriptor
empty() -> bool
@brief Returns a value indicating whether the box is empty
An empty box may be created with the default constructor for example. Such a box is neutral when combining it with other boxes and renders empty boxes if used in box intersections and false in geometrical relationship tests.
enlarge
method descriptor
enlarge(d: float) -> DBox
enlarge(dx: float, dy: float) -> DBox
enlarge(enlargement: DVector) -> DBox
enlarge()
@brief Enlarges the box by a certain amount.
Enlarges the box by x and y value specified in the vector passed. Positive values with grow the box, negative ones will shrink the box. The result may be an empty box if the box disappears. The amount specifies the grow or shrink per edge. The width and height will change by twice the amount. Does not check for coordinate overflows.
@param enlargement The grow or shrink amount in x and y direction
@return A reference to this box.
enlarged
method descriptor
enlarged(d: float) -> DBox
enlarged(dx: float, dy: float) -> DBox
enlarged(enlargement: DVector) -> DBox
enlarged()
@brief Returns the enlarged box.
Enlarges the box by x and y value specified in the vector passed. Positive values with grow the box, negative ones will shrink the box. The result may be an empty box if the box disappears. The amount specifies the grow or shrink per edge. The width and height will change by twice the amount. Does not modify this box. Does not check for coordinate overflows.
@param enlargement The grow or shrink amount in x and y direction
@return The enlarged box.
from_ibox
builtin
from_ibox() -> DBox
@brief Creates a floating-point coordinate box from an integer coordinate box
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'.
from_s
builtin
from_s() -> DBox
@brief Creates a box 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given box. This method enables boxes as hash keys.
This method has been introduced in version 0.25.
height
method descriptor
height() -> float
@brief Gets the height of the box
inside
method descriptor
inside() -> bool
@brief Tests if this box is inside the argument box
Returns true, if this box is inside the given box, i.e. the box intersection renders this box
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_point
method descriptor
is_point() -> bool
@brief Returns true, if the box is a single point
move
method descriptor
move(distance: DVector) -> DBox
move(dx: float, dy: float) -> DBox
move()
@brief Moves the box by a certain distance
Moves the box by a given offset and returns the moved box. Does not check for coordinate overflows.
@param distance The offset to move the box.
@return A reference to this box.
moved
method descriptor
moved(distance: DVector) -> DBox
moved(dx: float, dy: float) -> DBox
moved()
@brief Returns the box moved by a certain distance
Moves the box by a given offset and returns the moved box. Does not modify this box. Does not check for coordinate overflows.
@param distance The offset to move the box.
@return The moved box.
new
builtin
new() -> DBox
new(box: Box) -> DBox
new(left: float, bottom: float, right: float, top: float) -> DBox
new(lower_left: DPoint, upper_right: DPoint) -> DBox
new(w: float) -> DBox
new(w: float, h: float) -> DBox
new()
@brief Creates a box from two points
Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped.
overlaps
method descriptor
overlaps() -> bool
@brief Tests if this box overlaps the argument box
Returns true, if the intersection box of this box with the argument box exists and has a non-vanishing area
perimeter
method descriptor
perimeter() -> float
@brief Returns the perimeter of the box
This method is equivalent to 2*(width+height). For empty boxes, this method returns 0.
This method has been introduced in version 0.23.
to_itype
method descriptor
to_itype() -> Box
@brief Converts the box to an integer coordinate box
The database unit can be specified to translate the floating-point coordinate box in micron units to an integer-coordinate box in database units. The boxes coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing this box
This string can be turned into a box again by using \from_s . If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
touches
method descriptor
touches() -> bool
@brief Tests if this box touches the argument box
Two boxes touch if they overlap or their boundaries share at least one common point. Touching is equivalent to a non-empty intersection ('!(b1 & b2).empty?').
transformed
method descriptor
transformed(t: DCplxTrans) -> DBox
transformed(t: DTrans) -> DBox
transformed(t: VCplxTrans) -> Box
transformed()
@brief Returns the box transformed with the given complex transformation
@param t The magnifying transformation to apply @return The transformed box (a DBox now)
width
method descriptor
width() -> float
@brief Gets the width of the box
world
builtin
world() -> DBox
@brief Gets the 'world' box The world box is the biggest box that can be represented. So it is basically 'all'. The world box behaves neutral on intersections for example. In other operations such as displacement or transformations, the world box may render unexpected results because of coordinate overflow.
The world box can be used @ul @li for comparison ('==', '!=', '<') @/li @li in union and intersection ('+' and '&') @/li @li in relations (\contains?, \overlaps?, \touches?) @/li @li as 'all' argument in region queries @/li @/ul
This method has been introduced in version 0.28.
DCellInstArray
@brief A single or array cell instance in micrometer units This object is identical to \CellInstArray, except that it holds coordinates in micron units instead of database units.
This class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief A single or array cell instance in micrometer units\nThis object is identical to \\CellInstArray, except that it holds coordinates in micron units instead of database units.\n\nThis class has been introduced in version 0.25.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 33
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DCellInstArray' objects>
list of weak references to the object
a
class
a: DVector = <attribute 'a' of 'DCellInstArray' objects>
@brief Gets the displacement vector for the 'a' axis
@brief Sets the displacement vector for the 'a' axis
If the instance was not regular before this property is set, it will be initialized to a regular instance.
b
class
b: DVector = <attribute 'b' of 'DCellInstArray' objects>
@brief Gets the displacement vector for the 'b' axis
@brief Sets the displacement vector for the 'b' axis
If the instance was not regular before this property is set, it will be initialized to a regular instance.
cell
class
cell: None = <attribute 'cell' of 'DCellInstArray' objects>
@brief Sets the cell this instance refers to This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes.
This convenience method has been introduced in version 0.28.
cell_index
class
cell_index: int = <attribute 'cell_index' of 'DCellInstArray' objects>
@brief Gets the cell index of the cell instantiated Use \Layout#cell to get the \Cell object from the cell index.
@brief Sets the index of the cell this instance refers to
cplx_trans
class
cplx_trans: DCplxTrans = <attribute 'cplx_trans' of 'DCellInstArray' objects>
@brief Gets the complex transformation of the first instance in the array This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well.
@brief Sets the complex transformation of the instance or the first instance in the array
na
class
na: int = <attribute 'na' of 'DCellInstArray' objects>
@brief Gets the number of instances in the 'a' axis
@brief Sets the number of instances in the 'a' axis
If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. To make an instance a single instance, set na or nb to 0.
nb
class
nb: int = <attribute 'nb' of 'DCellInstArray' objects>
@brief Gets the number of instances in the 'b' axis
@brief Sets the number of instances in the 'b' axis
If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. To make an instance a single instance, set na or nb to 0.
trans
class
trans: DTrans = <attribute 'trans' of 'DCellInstArray' objects>
@brief Gets the transformation of the first instance in the array The transformation returned is only valid if the array does not represent a complex transformation array
@brief Sets the transformation of the instance or the first instance in the array
__copy__
method descriptor
__copy__() -> DCellInstArray
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DCellInstArray
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Compares two arrays for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given cell instance. This method enables cell instances as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(cell: Cell, disp: DVector) -> None
__init__(cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None
__init__(cell: Cell, trans: DCplxTrans) -> None
__init__(cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None
__init__(cell: Cell, trans: DTrans) -> None
__init__(cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None
__init__(cell_index: int, disp: DVector) -> None
__init__(cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None
__init__(cell_index: int, trans: DCplxTrans) -> None
__init__(cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None
__init__(cell_index: int, trans: DTrans) -> None
__init__(cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None
__init__()
@brief Creates a single cell instance with a complex transformation @param cell The cell to instantiate @param trans The complex transformation by which to instantiate the cell @param a The displacement vector of the array in the 'a' axis @param b The displacement vector of the array in the 'b' axis @param na The number of placements in the 'a' axis @param nb The number of placements in the 'b' axis
This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28.
__len__
method descriptor
__len__() -> int
@brief Gets the number of single instances in the array If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance.
__lt__
method descriptor
__lt__() -> bool
@brief Compares two arrays for 'less' The comparison provides an arbitrary sorting criterion and not specific sorting order. It is guaranteed that if an array a is less than b, b is not less than a. In addition, it a is not less than b and b is not less than a, then a is equal to b.
__ne__
method descriptor
__ne__() -> bool
@brief Compares two arrays for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts the array to a string
__str__
method descriptor
__str__() -> str
@brief Converts the array to a string
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox(layout: Layout) -> DBox
bbox(layout: Layout, layer_index: int) -> DBox
bbox()
@brief Gets the bounding box of the array The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index.
bbox_per_layer
method descriptor
bbox_per_layer() -> DBox
@brief Gets the bounding box of the array with respect to one layer The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index.
'bbox' is the preferred synonym since version 0.28.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DCellInstArray
@brief Creates a copy of self
each_cplx_trans
method descriptor
each_cplx_trans() -> Iterator[DCplxTrans]
@brief Gets the complex transformations represented by this instance For a single instance, this iterator will deliver the single, complex transformation. For array instances, the iterator will deliver each complex transformation of the expanded array. This iterator is a generalization of \each_trans for general complex transformations.
each_trans
method descriptor
each_trans() -> Iterator[DTrans]
@brief Gets the simple transformations represented by this instance For a single instance, this iterator will deliver the single, simple transformation. For array instances, the iterator will deliver each simple transformation of the expanded array.
This iterator will only deliver valid transformations if the instance array is not of complex type (see \is_complex?). A more general iterator that delivers the complex transformations is \each_cplx_trans.
hash
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given cell instance. This method enables cell instances as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> None
@brief Inverts the array reference
The inverted array reference describes in which transformations the parent cell is seen from the current cell.
is_complex
method descriptor
is_complex() -> bool
@brief Gets a value indicating whether the array is a complex array
Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles).
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_regular_array
method descriptor
is_regular_array() -> bool
@brief Gets a value indicating whether this instance is a regular array
new
builtin
new() -> DCellInstArray
new(cell: Cell, disp: DVector) -> DCellInstArray
new(cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray
new(cell: Cell, trans: DCplxTrans) -> DCellInstArray
new(cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray
new(cell: Cell, trans: DTrans) -> DCellInstArray
new(cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray
new(cell_index: int, disp: DVector) -> DCellInstArray
new(cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray
new(cell_index: int, trans: DCplxTrans) -> DCellInstArray
new(cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray
new(cell_index: int, trans: DTrans) -> DCellInstArray
new(cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray
new()
@brief Creates a single cell instance with a complex transformation @param cell The cell to instantiate @param trans The complex transformation by which to instantiate the cell @param a The displacement vector of the array in the 'a' axis @param b The displacement vector of the array in the 'b' axis @param na The number of placements in the 'a' axis @param nb The number of placements in the 'b' axis
This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28.
size
method descriptor
size() -> int
@brief Gets the number of single instances in the array If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance.
to_s
method descriptor
to_s() -> str
@brief Converts the array to a string
transform
method descriptor
transform(trans: DCplxTrans) -> None
transform(trans: DTrans) -> None
transform()
@brief Transforms the cell instance with the given complex transformation
transformed
method descriptor
transformed(trans: DCplxTrans) -> DCellInstArray
transformed(trans: DTrans) -> DCellInstArray
transformed()
@brief Gets the transformed cell instance (complex transformation)
DCplxTrans
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
M0
class
M0: DCplxTrans = m0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
M135
class
M135: DCplxTrans = m135 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
M45
class
M45: DCplxTrans = m45 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
M90
class
M90: DCplxTrans = m90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
R0
class
R0: DCplxTrans = r0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
R180
class
R180: DCplxTrans = r180 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
R270
class
R270: DCplxTrans = r270 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
R90
class
R90: DCplxTrans = r90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied.
A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A complex transformation\n\nA complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary\nangle and a displacement. This is also the order, the operations are applied.\n\nA complex transformation provides a superset of the simple transformation.\nIn many applications, a complex transformation computes floating-point coordinates to minimize rounding effects.\nThis version can transform floating-point coordinate objects.\n\nComplex transformations are extensions of the simple transformation classes (\\DTrans in that case) and behave similar.\n\nTransformations can be used to transform points or other objects. Transformations can be combined with the \'*\' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:\n\n@code\n# Create a transformation that applies a magnification of 1.5, a rotation by 90 degree\n# and displacement of 10 in x and 20 units in y direction:\nt = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0)\nt.to_s # r90 *1.5 10,20\n# compute the inverse:\nt.inverted.to_s # r270 *0.666666667 -13,7\n# Combine with another displacement (applied after that):\n(RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25\n# Transform a point:\nt.trans(RBA::Point::new(100, 200)).to_s # -290,170\n@/code\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 188
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DCplxTrans' objects>
list of weak references to the object
angle
class
angle: float = <attribute 'angle' of 'DCplxTrans' objects>
@brief Gets the angle
Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree.
@return The rotation angle this transformation provides in degree units (0..360 deg).
@brief Sets the angle @param a The new angle See \angle for a description of that attribute.
disp
class
disp: DVector = <attribute 'disp' of 'DCplxTrans' objects>
@brief Gets the displacement
@brief Sets the displacement @param u The new displacement
mag
class
mag: float = <attribute 'mag' of 'DCplxTrans' objects>
@brief Gets the magnification
@brief Sets the magnification @param m The new magnification
mirror
class
mirror: bool = <attribute 'mirror' of 'DCplxTrans' objects>
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
@brief Sets the mirror flag "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag
__copy__
method descriptor
__copy__() -> DCplxTrans
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DCplxTrans
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(c: DCplxTrans, mag: Optional[float] = ..., u: Optional[DVector] = ...) -> None
__init__(c: DCplxTrans, mag: Optional[float] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[DVector] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> None
__init__(t: DTrans, mag: Optional[float] = ...) -> None
__init__(trans: CplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: ICplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: VCplxTrans, dbu: Optional[float] = ...) -> None
__init__(u: DVector) -> None
__init__(x: float, y: float) -> None
__init__()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
__lt__
method descriptor
__lt__() -> bool
@brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions.
__mul__
method descriptor
__mul__(box: DBox) -> DBox
__mul__(d: float) -> float
__mul__(edge: DEdge) -> DEdge
__mul__(p: DPoint) -> DPoint
__mul__(p: DVector) -> DVector
__mul__(path: DPath) -> DPath
__mul__(polygon: DPolygon) -> DPolygon
__mul__(t: CplxTrans) -> CplxTrans
__mul__(t: DCplxTrans) -> DCplxTrans
__mul__(text: DText) -> DText
__mul__()
@brief Returns the concatenated transformation
The * operator returns self*t ("t is applied before this transformation").
@param t The transformation to apply before @return The modified transformation
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality
__repr__
method descriptor
__repr__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: DBox) -> DBox
__rmul__(d: float) -> float
__rmul__(edge: DEdge) -> DEdge
__rmul__(p: DPoint) -> DPoint
__rmul__(p: DVector) -> DVector
__rmul__(path: DPath) -> DPath
__rmul__(polygon: DPolygon) -> DPolygon
__rmul__(text: DText) -> DText
__rmul__()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
ctrans
method descriptor
ctrans() -> float
@brief Transforms a single distance
The "ctrans" method transforms the given distance. This is equivalent to multiplying with the magnification. For the simple transformations, there is no magnification and no modification of the distance.
@param d The distance to transform @return The transformed distance
The product '*' has been added as a synonym in version 0.28. The distance can be signed since version 0.29.3.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DCplxTrans
@brief Creates a copy of self
from_itrans
builtin
from_itrans() -> DCplxTrans
@brief Creates a floating-point coordinate transformation from another coordinate flavour The 'dbu' argument is used to transform the input space from integer units to floating-point units. Formally, the DCplxTrans transformation is initialized with 'trans * to_dbu' where 'to_dbu' is the transformation into DBU space, or more precisely 'VCplxTrans(mag=1/dbu)'.
This constructor has been introduced in version 0.25. The 'dbu' argument has been added in version 0.29.
from_s
builtin
from_s() -> DCplxTrans
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> DCplxTrans
@brief Inverts the transformation (in place)
Inverts the transformation and replaces this transformation by its inverted one.
@return The inverted transformation
inverted
method descriptor
inverted() -> DCplxTrans
@brief Returns the inverted transformation
Returns the inverted transformation. This method does not modify the transformation.
@return The inverted transformation
is_complex
method descriptor
is_complex() -> bool
@brief Returns true if the transformation is a complex one
If this predicate is false, the transformation can safely be converted to a simple transformation. Otherwise, this conversion will be lossy. The predicate value is equivalent to 'is_mag || !is_ortho'.
This method has been introduced in version 0.27.5.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mag
method descriptor
is_mag() -> bool
@brief Tests, if the transformation is a magnifying one
This is the recommended test for checking if the transformation represents a magnification.
is_mirror
method descriptor
is_mirror() -> bool
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
is_ortho
method descriptor
is_ortho() -> bool
@brief Tests, if the transformation is an orthogonal transformation
If the rotation is by a multiple of 90 degree, this method will return true.
is_unity
method descriptor
is_unity() -> bool
@brief Tests, whether this is a unit transformation
new
builtin
new() -> DCplxTrans
new(c: DCplxTrans, mag: Optional[float] = ..., u: Optional[DVector] = ...) -> DCplxTrans
new(c: DCplxTrans, mag: Optional[float] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> DCplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[DVector] = ...) -> DCplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> DCplxTrans
new(t: DTrans, mag: Optional[float] = ...) -> DCplxTrans
new(trans: CplxTrans, dbu: Optional[float] = ...) -> DCplxTrans
new(trans: ICplxTrans, dbu: Optional[float] = ...) -> DCplxTrans
new(trans: VCplxTrans, dbu: Optional[float] = ...) -> DCplxTrans
new(u: DVector) -> DCplxTrans
new(x: float, y: float) -> DCplxTrans
new()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
rot
method descriptor
rot() -> int
@brief Returns the respective simple transformation equivalent rotation code if possible
If this transformation is orthogonal (is_ortho () == true), then this method will return the corresponding fixpoint transformation, not taking into account magnification and displacement. If the transformation is not orthogonal, the result reflects the quadrant the rotation goes into.
s_trans
method descriptor
s_trans() -> DTrans
@brief Extracts the simple transformation part
The simple transformation part does not reflect magnification or arbitrary angles. Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0.
to_itrans
method descriptor
to_itrans() -> ICplxTrans
@brief Converts the transformation to another transformation with integer input and output coordinates
The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit.
This method is redundant with the conversion constructors. Instead of 'to_itrans' use the conversion constructor:
@code itrans = RBA::ICplxTrans::new(dtrans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
to_s
method descriptor
to_s() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
to_trans
method descriptor
to_trans() -> CplxTrans
@brief Converts the transformation to another transformation with integer input coordinates
This method is redundant with the conversion constructors. Instead of 'to_trans' use the conversion constructor:
@code trans = RBA::CplxTrans::new(dtrans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
to_vtrans
method descriptor
to_vtrans() -> VCplxTrans
@brief Converts the transformation to another transformation with integer output coordinates
The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit.
This method is redundant with the conversion constructors. Instead of 'to_vtrans' use the conversion constructor:
@code vtrans = RBA::VCplxTrans::new(dtrans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
trans
method descriptor
trans(box: DBox) -> DBox
trans(edge: DEdge) -> DEdge
trans(p: DPoint) -> DPoint
trans(p: DVector) -> DVector
trans(path: DPath) -> DPath
trans(polygon: DPolygon) -> DPolygon
trans(text: DText) -> DText
trans()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
DEdge
@brief An edge class
An edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2). Edges play a role in the database as parts of polygons and to describe a line through both points. The \Edge object is also used inside the boolean processor (\EdgeProcessor). Although supported, edges are rarely used as individual database objects.
See @The Database API@ for more details about the database objects like the Edge class.
__doc__
class
__doc__ = '@brief An edge class\n\nAn edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2). Edges play a role in the database as parts of polygons and to describe a line through both points.\nThe \\Edge object is also used inside the boolean processor (\\EdgeProcessor).\nAlthough supported, edges are rarely used as individual database objects.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects like the Edge class.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 45
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DEdge' objects>
list of weak references to the object
p1
class
p1: DPoint = <attribute 'p1' of 'DEdge' objects>
@brief The first point.
@brief Sets the first point. This method has been added in version 0.23.
p2
class
p2: DPoint = <attribute 'p2' of 'DEdge' objects>
@brief The second point.
@brief Sets the second point. This method has been added in version 0.23.
x1
class
x1: float = <attribute 'x1' of 'DEdge' objects>
@brief Shortcut for p1.x
@brief Sets p1.x This method has been added in version 0.23.
x2
class
x2: float = <attribute 'x2' of 'DEdge' objects>
@brief Shortcut for p2.x
@brief Sets p2.x This method has been added in version 0.23.
y1
class
y1: float = <attribute 'y1' of 'DEdge' objects>
@brief Shortcut for p1.y
@brief Sets p1.y This method has been added in version 0.23.
y2
class
y2: float = <attribute 'y2' of 'DEdge' objects>
@brief Shortcut for p2.y
@brief Sets p2.y This method has been added in version 0.23.
__copy__
method descriptor
__copy__() -> DEdge
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DEdge
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test @param e The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given edge. This method enables edges as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(edge: Edge) -> None
__init__(p1: DPoint, p2: DPoint) -> None
__init__(x1: float, y1: float, x2: float, y2: float) -> None
__init__()
@brief Constructor with two points
Two points are given to create a new edge.
__lt__
method descriptor
__lt__() -> bool
@brief Less operator @param e The object to compare against @return True, if the edge is 'less' as the other edge with respect to first and second point
__mul__
method descriptor
__mul__() -> DEdge
@brief Scale edge
The * operator scales self with the given factor.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled edge
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test @param e The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the edge If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__() -> DEdge
@brief Scale edge
The * operator scales self with the given factor.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled edge
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the edge If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> DBox
@brief Return the bounding box of the edge.
clipped
method descriptor
clipped() -> Any
@brief Returns the edge clipped at the given box
@param box The clip box. @return The clipped edge or nil if the edge does not intersect with the box.
This method has been introduced in version 0.26.2.
clipped_line
method descriptor
clipped_line() -> Any
@brief Returns the line through the edge clipped at the given box
@param box The clip box. @return The part of the line through the box or nil if the line does not intersect with the box.
In contrast to \clipped, this method will consider the edge extended infinitely (a "line"). The returned edge will be the part of this line going through the box.
This method has been introduced in version 0.26.2.
coincident
method descriptor
coincident() -> bool
@brief Coincidence check.
Checks whether a edge is coincident with another edge. Coincidence is defined by being parallel and that at least one point of one edge is on the other edge.
@param e the edge to test with
@return True if the edges are coincident.
contains
method descriptor
contains() -> bool
@brief Tests whether a point is on an edge.
A point is on a edge if it is on (or at least closer than a grid point to) the edge.
@param p The point to test with the edge.
@return True if the point is on the edge.
contains_excl
method descriptor
contains_excl() -> bool
@brief Tests whether a point is on an edge excluding the endpoints.
A point is on a edge if it is on (or at least closer than a grid point to) the edge.
@param p The point to test with the edge.
@return True if the point is on the edge but not equal p1 or p2.
create
method descriptor
create() -> None
@brief 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.
crossed_by
method descriptor
crossed_by() -> bool
@brief Checks, if the line given by self is crossed by the edge e
self if considered an infinite line. This predicate renders true if the edge e is cut by this line. In other words: this method returns true if e.p1 is in one semispace of self while e.p2 is in the other or one of them is exactly on self.
@param e The edge representing the line that the edge must be crossing.
crossing_point
method descriptor
crossing_point() -> DPoint
@brief Returns the crossing point on two edges.
This method delivers the point where the given line (self) crosses the edge given by the argument "e". self is considered infinitely long and is required to cut through the edge "e". If self does not cut this line, the result is undefined. See \crossed_by? for a description of the crossing predicate.
@param e The edge representing the line that self must be crossing. @return The point where self crosses the line given by "e".
This method has been introduced in version 0.19.
cut_point
method descriptor
cut_point() -> Any
@brief Returns the intersection point of the lines through the two edges.
This method delivers the intersection point between the lines through the two edges. If the lines are parallel and do not intersect, the result will be nil. In contrast to \intersection_point, this method will regard the edges as infinitely extended and intersection is not confined to the edge span.
@param e The edge to test. @return The point where the lines intersect.
This method has been introduced in version 0.27.1.
d
method descriptor
d() -> DVector
@brief Gets the edge extension as a vector. This method is equivalent to p2 - p1. This method has been introduced in version 0.26.2.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
distance
method descriptor
distance() -> float
@brief Gets the distance of the point from the line through the edge.
Returns the distance between the edge and the point. The distance is signed which is negative if the point is to the "right" of the edge and positive if the point is to the "left". The distance is measured by projecting the point onto the line through the edge. If the edge is degenerated, the distance is not defined.
This method considers the edge to define an infinite line running through it. \distance returns the distance of 'p' to this line. A similar method is \euclidian_distance, but the latter regards the edge a finite set of points between the endpoints.
@param p The point to test.
@return The distance
distance_abs
method descriptor
distance_abs() -> float
@brief Absolute distance between the edge and a point.
Returns the distance between the edge and the point.
@param p The point to test.
@return The distance
dup
method descriptor
dup() -> DEdge
@brief Creates a copy of self
dx
method descriptor
dx() -> float
@brief The horizontal extend of the edge.
dx_abs
method descriptor
dx_abs() -> float
@brief The absolute value of the horizontal extend of the edge.
dy
method descriptor
dy() -> float
@brief The vertical extend of the edge.
dy_abs
method descriptor
dy_abs() -> float
@brief The absolute value of the vertical extend of the edge.
enlarge
method descriptor
enlarge() -> DEdge
@brief Enlarges the edge.
Enlarges the edge by the given distance and returns the enlarged edge. The edge is overwritten. Enlargement means that the first point is shifted by -p, the second by p.
@param p The distance to move the edge points.
@return The enlarged edge.
enlarged
method descriptor
enlarged() -> DEdge
@brief Returns the enlarged edge (does not modify self)
Enlarges the edge by the given offset and returns the enlarged edge. The edge is not modified. Enlargement means that the first point is shifted by -p, the second by p.
@param p The distance to move the edge points.
@return The enlarged edge.
euclidian_distance
method descriptor
euclidian_distance() -> float
@brief Gets the distance of the point from the the edge.
Returns the minimum distance of the point to any point on the edge. Unlike \distance, the edge is considered a finite set of points between the endpoints. The result is also not signed like it is the case for \distance.
This method has been introduced in version 0.28.14.
@param p The point to test.
@return The distance
extend
method descriptor
extend() -> DEdge
@brief Extends the edge (modifies self)
Extends the edge by the given distance and returns the extended edge. The edge is not modified. Extending means that the first point is shifted by -d along the edge, the second by d. The length of the edge will increase by 2*d.
\extended is a version that does not modify self but returns the extended edges.
This method has been introduced in version 0.23.
@param d The distance by which to shift the end points.
@return The extended edge (self).
extended
method descriptor
extended() -> DEdge
@brief Returns the extended edge (does not modify self)
Extends the edge by the given distance and returns the extended edge. The edge is not modified. Extending means that the first point is shifted by -d along the edge, the second by d. The length of the edge will increase by 2*d.
\extend is a version that modifies self (in-place).
This method has been introduced in version 0.23.
@param d The distance by which to shift the end points.
@return The extended edge.
from_iedge
builtin
from_iedge() -> DEdge
@brief Creates a floating-point coordinate edge from an integer coordinate edge
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_iedge'.
from_s
builtin
from_s() -> DEdge
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given edge. This method enables edges as hash keys.
This method has been introduced in version 0.25.
intersect
method descriptor
intersect() -> bool
@brief Intersection test.
Returns true if the edges intersect. Two edges intersect if they share at least one point. If the edges coincide, they also intersect. If one of the edges is degenerate (both points are identical), that point is required to sit exaclty on the other edge. If both edges are degenerate, their points are required to be identical.
@param e The edge to test.
The 'intersects' (with an 's') synonym has been introduced in version 0.28.12.
intersection_point
method descriptor
intersection_point() -> Any
@brief Returns the intersection point of two edges.
This method delivers the intersection point. If the edges do not intersect, the result will be nil.
@param e The edge to test. @return The point where the edges intersect.
This method has been introduced in version 0.19. From version 0.26.2, this method will return nil in case of non-intersection.
intersects
method descriptor
intersects() -> bool
@brief Intersection test.
Returns true if the edges intersect. Two edges intersect if they share at least one point. If the edges coincide, they also intersect. If one of the edges is degenerate (both points are identical), that point is required to sit exaclty on the other edge. If both edges are degenerate, their points are required to be identical.
@param e The edge to test.
The 'intersects' (with an 's') synonym has been introduced in version 0.28.12.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_degenerate
method descriptor
is_degenerate() -> bool
@brief Test for degenerated edge
An edge is degenerate, if both end and start point are identical.
is_parallel
method descriptor
is_parallel() -> bool
@brief Test for being parallel
@param e The edge to test against
@return True if both edges are parallel
length
method descriptor
length() -> float
@brief The length of the edge
move
method descriptor
move(dx: float, dy: float) -> DEdge
move(p: DVector) -> DEdge
move()
@brief Moves the edge.
Moves the edge by the given offset and returns the moved edge. The edge is overwritten.
@param dx The x distance to move the edge. @param dy The y distance to move the edge.
@return The moved edge.
This version has been added in version 0.23.
moved
method descriptor
moved(dx: float, dy: float) -> DEdge
moved(p: DVector) -> DEdge
moved()
@brief Returns the moved edge (does not modify self)
Moves the edge by the given offset and returns the moved edge. The edge is not modified.
@param dx The x distance to move the edge. @param dy The y distance to move the edge.
@return The moved edge.
This version has been added in version 0.23.
new
builtin
new() -> DEdge
new(edge: Edge) -> DEdge
new(p1: DPoint, p2: DPoint) -> DEdge
new(x1: float, y1: float, x2: float, y2: float) -> DEdge
new()
@brief Constructor with two points
Two points are given to create a new edge.
new_pp
builtin
new_pp() -> DEdge
@brief Constructor with two points
Two points are given to create a new edge.
new_xyxy
builtin
new_xyxy() -> DEdge
@brief Constructor with two coordinates given as single values
Two points are given to create a new edge.
ortho_length
method descriptor
ortho_length() -> float
@brief The orthogonal length of the edge ("manhattan-length")
@return The orthogonal length (abs(dx)+abs(dy))
shift
method descriptor
shift() -> DEdge
@brief Shifts the edge (modifies self)
Shifts the edge by the given distance and returns the shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right.
\shifted is a version that does not modify self but returns the extended edges.
This method has been introduced in version 0.23.
@param d The distance by which to shift the edge.
@return The shifted edge (self).
shifted
method descriptor
shifted() -> DEdge
@brief Returns the shifted edge (does not modify self)
Shifts the edge by the given distance and returns the shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right.
\shift is a version that modifies self (in-place).
This method has been introduced in version 0.23.
@param d The distance by which to shift the edge.
@return The shifted edge.
side_of
method descriptor
side_of() -> int
@brief Indicates at which side the point is located relative to the edge.
Returns 1 if the point is "left" of the edge, 0 if on and -1 if the point is "right" of the edge.
@param p The point to test.
@return The side value
sq_length
method descriptor
sq_length() -> float
@brief The square of the length of the edge
swap_points
method descriptor
swap_points() -> DEdge
@brief Swap the points of the edge
This version modifies self. A version that does not modify self is \swapped_points. Swapping the points basically reverses the direction of the edge.
This method has been introduced in version 0.23.
swapped_points
method descriptor
swapped_points() -> DEdge
@brief Returns an edge in which both points are swapped
Swapping the points basically reverses the direction of the edge.
This method has been introduced in version 0.23.
to_itype
method descriptor
to_itype() -> Edge
@brief Converts the edge to an integer coordinate edge
The database unit can be specified to translate the floating-point coordinate edge in micron units to an integer-coordinate edge in database units. The edges coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the edge If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
transformed
method descriptor
transformed(t: DCplxTrans) -> DEdge
transformed(t: DTrans) -> DEdge
transformed(t: VCplxTrans) -> Edge
transformed()
@brief Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge.
@param t The transformation to apply.
@return The transformed edge.
transformed_cplx
method descriptor
transformed_cplx() -> DEdge
@brief Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge.
@param t The transformation to apply.
@return The transformed edge.
DEdgePair
@brief 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 with integer coordinates (\EdgePair type) 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.
__doc__
class
__doc__ = '@brief An edge pair (a pair of two edges)\nEdge 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 with integer coordinates (\\EdgePair type) are used in the form of edge pair collections (\\EdgePairs).\n\nEdge 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.\n\nThis class has been introduced in version 0.23.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 47
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DEdgePair' objects>
list of weak references to the object
first
class
first: DEdge = <attribute 'first' of 'DEdgePair' objects>
@brief Gets the first edge
@brief Sets the first edge
second
class
second: DEdge = <attribute 'second' of 'DEdgePair' objects>
@brief Gets the second edge
@brief Sets the second edge
symmetric
class
symmetric: bool = <attribute 'symmetric' of 'DEdgePair' objects>
@brief Returns a value indicating whether the edge pair is symmetric For symmetric edge pairs, the edges are commutable. Specifically, a symmetric edge pair with (e1,e2) is identical to (e2,e1). Symmetric edge pairs are generated by some checks for which there is no directed error marker (width, space, notch, isolated).
Symmetric edge pairs have been introduced in version 0.27.
@brief Sets a value indicating whether the edge pair is symmetric See \symmetric? for a description of this attribute.
Symmetric edge pairs have been introduced in version 0.27.
__copy__
method descriptor
__copy__() -> DEdgePair
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DEdgePair
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality Returns true, if this edge pair and the given one are equal
This method has been introduced in version 0.25.
__hash__
method descriptor
__hash__() -> int
@brief 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.
__init__
method descriptor
__init__() -> None
__init__(edge_pair: EdgePair) -> None
__init__(first: DEdge, second: DEdge, symmetric: Optional[bool] = ...) -> None
__init__()
@brief Constructor from two edges
This constructor creates an edge pair from the two edges given. See \symmetric? for a description of this attribute.
__lt__
method descriptor
__lt__() -> bool
@brief 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.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality Returns true, if this edge pair and the given one are not equal
This method has been introduced in version 0.25.
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the edge pair If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the edge pair If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
area
method descriptor
area() -> float
@brief Gets the area between the edges of the edge pair
This attribute has been introduced in version 0.28.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> DBox
@brief Gets the bounding box of the edge pair
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
distance
method descriptor
distance() -> float
@brief Gets the distance of the edges in the edge pair
The distance between the two edges is defined as the minimum distance between any two points on the two edges.
This attribute has been introduced in version 0.28.14.
dup
method descriptor
dup() -> DEdgePair
@brief Creates a copy of self
from_s
builtin
from_s() -> DEdgePair
@brief 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.
greater
method descriptor
greater() -> DEdge
@brief Gets the 'greater' edge for symmetric edge pairs As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'second' edge in a way independent on the actual assignment.
This read-only attribute has been introduced in version 0.27.
hash
method descriptor
hash() -> int
@brief 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.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
lesser
method descriptor
lesser() -> DEdge
@brief Gets the 'lesser' edge for symmetric edge pairs As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'first' edge in a way independent on the actual assignment.
This read-only attribute has been introduced in version 0.27.
new
builtin
new() -> DEdgePair
new(edge_pair: EdgePair) -> DEdgePair
new(first: DEdge, second: DEdge, symmetric: Optional[bool] = ...) -> DEdgePair
new()
@brief Constructor from two edges
This constructor creates an edge pair from the two edges given. See \symmetric? for a description of this attribute.
normalized
method descriptor
normalized() -> DEdgePair
@brief 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.
perimeter
method descriptor
perimeter() -> float
@brief Gets the perimeter of the edge pair
The perimeter is defined as the sum of the lengths of both edges ('active perimeter').
This attribute has been introduced in version 0.28.
polygon
method descriptor
polygon() -> DPolygon
@brief 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 applies 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. @param e The enlargement (set to zero for exact representation)
simple_polygon
method descriptor
simple_polygon() -> DSimplePolygon
@brief 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 applies 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. @param e The enlargement (set to zero for exact representation)
to_itype
method descriptor
to_itype() -> EdgePair
@brief Converts the edge pair to an integer coordinate edge pair
The database unit can be specified to translate the floating-point coordinate edge pair in micron units to an integer-coordinate edge pair in database units. The edge pair's' coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the edge pair If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
transformed
method descriptor
transformed(t: DCplxTrans) -> DEdgePair
transformed(t: DTrans) -> DEdgePair
transformed(t: VCplxTrans) -> EdgePair
transformed()
@brief 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.
@param t The transformation to apply.
@return The transformed edge pair
DPath
@brief A path class
A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension').
A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A path class\n\nA path consists of an sequence of line segments forming the \'spine\' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the \'begin extension\') and the end point can be pulled forward somewhat (by the \'end extension\').\n\nA path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 149
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DPath' objects>
list of weak references to the object
bgn_ext
class
bgn_ext: float = <attribute 'bgn_ext' of 'DPath' objects>
@brief Get the begin extension
@brief Set the begin extension
end_ext
class
end_ext: float = <attribute 'end_ext' of 'DPath' objects>
@brief Get the end extension
@brief Set the end extension
points
class
points: int = <attribute 'points' of 'DPath' objects>
@brief Get the number of points
@brief Set the points of the path @param p An array of points to assign to the path's spine
round
class
round: bool = <attribute 'round' of 'DPath' objects>
@brief Returns true, if the path has round ends
@brief Set the 'round ends' flag A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise.
width
class
width: float = <attribute 'width' of 'DPath' objects>
@brief Get the width
@brief Set the width
__copy__
method descriptor
__copy__() -> DPath
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DPath
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test @param p The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(path: Path) -> None
__init__(pts: Sequence[DPoint], width: float) -> None
__init__(pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> None
__init__(pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> None
__init__()
@brief Constructor given the points of the path's spine, the width, the extensions and the round end flag
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path @param round If this flag is true, the path will get rounded ends
__lt__
method descriptor
__lt__() -> bool
@brief Less operator @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
__mul__
method descriptor
__mul__() -> DPath
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test @param p The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Convert to a string
__rmul__
method descriptor
__rmul__() -> DPath
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief Convert to a string
area
method descriptor
area() -> float
@brief Returns the approximate area of the path This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. This method was added in version 0.22.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> DBox
@brief Returns the bounding box of the path
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DPath
@brief Creates a copy of self
each_point
method descriptor
each_point() -> Iterator[DPoint]
@brief Get the points that make up the path's spine
from_ipath
builtin
from_ipath() -> DPath
@brief Creates a floating-point coordinate path from an integer coordinate path
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipath'.
from_s
builtin
from_s() -> DPath
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_round
method descriptor
is_round() -> bool
@brief Returns true, if the path has round ends
length
method descriptor
length() -> float
@brief Returns the length of the path the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends.
This method was added in version 0.23.
move
method descriptor
move(dx: float, dy: float) -> DPath
move(p: DVector) -> DPath
move()
@brief Moves the path.
Moves the path by the given offset and returns the moved path. The path is overwritten.
@param dx The x distance to move the path. @param dy The y distance to move the path.
@return The moved path.
This version has been added in version 0.23.
moved
method descriptor
moved(dx: float, dy: float) -> DPath
moved(p: DVector) -> DPath
moved()
@brief Returns the moved path (does not change self)
Moves the path by the given offset and returns the moved path. The path is not modified.
@param dx The x distance to move the path. @param dy The y distance to move the path.
@return The moved path.
This version has been added in version 0.23.
new
builtin
new() -> DPath
new(path: Path) -> DPath
new(pts: Sequence[DPoint], width: float) -> DPath
new(pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float) -> DPath
new(pts: Sequence[DPoint], width: float, bgn_ext: float, end_ext: float, round: bool) -> DPath
new()
@brief Constructor given the points of the path's spine, the width, the extensions and the round end flag
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path @param round If this flag is true, the path will get rounded ends
new_pw
builtin
new_pw() -> DPath
@brief Constructor given the points of the path's spine and the width
@param pts The points forming the spine of the path @param width The width of the path
new_pwx
builtin
new_pwx() -> DPath
@brief Constructor given the points of the path's spine, the width and the extensions
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path
new_pwxr
builtin
new_pwxr() -> DPath
@brief Constructor given the points of the path's spine, the width, the extensions and the round end flag
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path @param round If this flag is true, the path will get rounded ends
num_points
method descriptor
num_points() -> int
@brief Get the number of points
perimeter
method descriptor
perimeter() -> float
@brief Returns the approximate perimeter of the path This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. This method was added in version 0.24.4.
polygon
method descriptor
polygon() -> DPolygon
@brief Convert the path to a polygon The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments.
round_corners
method descriptor
round_corners() -> DPath
@brief Creates a new path whose corners are interpolated with circular bends
@param radius The radius of the bends @param npoints The number of points (per full circle) used for interpolating the bends @param accuracy The numerical accuracy of the computation
The accuracy parameter controls the numerical resolution of the approximation process and should be in the order of half the database unit. This accuracy is used for suppressing redundant points and simplification of the resulting path.
This method has been introduced in version 0.25.
simple_polygon
method descriptor
simple_polygon() -> DSimplePolygon
@brief Convert the path to a simple polygon The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments.
to_itype
method descriptor
to_itype() -> Path
@brief Converts the path to an integer coordinate path
The database unit can be specified to translate the floating-point coordinate path in micron units to an integer-coordinate path in database units. The path's' coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Convert to a string
transformed
method descriptor
transformed(t: DCplxTrans) -> DPath
transformed(t: DTrans) -> DPath
transformed(t: VCplxTrans) -> Path
transformed()
@brief Transform the path.
Transforms the path with the given complex transformation. Does not modify the path but returns the transformed path.
@param t The transformation to apply.
@return The transformed path.
transformed_cplx
method descriptor
transformed_cplx() -> DPath
@brief Transform the path.
Transforms the path with the given complex transformation. Does not modify the path but returns the transformed path.
@param t The transformation to apply.
@return The transformed path.
DPoint
@brief A point class with double (floating-point) coordinates Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Point), points with floating-point coordinates can represent fractions of a database unit.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A point class with double (floating-point) coordinates\nPoints represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\\Point), points with floating-point coordinates can represent fractions of a database unit.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 150
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DPoint' objects>
list of weak references to the object
x
class
x: float = <attribute 'x' of 'DPoint' objects>
@brief Accessor to the x coordinate
@brief Write accessor to the x coordinate
y
class
y: float = <attribute 'y' of 'DPoint' objects>
@brief Accessor to the y coordinate
@brief Write accessor to the y coordinate
__add__
method descriptor
__add__() -> DPoint
@brief Adds a vector to a point
Adds vector v to self by adding the coordinates.
Starting with version 0.25, this method expects a vector argument.
__copy__
method descriptor
__copy__() -> DPoint
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DPoint
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test operator
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given point. This method enables points as hash keys.
This method has been introduced in version 0.25.
__imul__
method descriptor
__imul__() -> DPoint
@brief Scaling by some factor
Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded.
__init__
method descriptor
__init__() -> None
__init__(point: Point) -> None
__init__(v: DVector) -> None
__init__(x: float, y: float) -> None
__init__()
@brief Constructor for a point from two coordinate values
__itruediv__
method descriptor
__itruediv__() -> DPoint
@brief Division by some divisor
Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded.
__lt__
method descriptor
__lt__() -> bool
@brief "less" comparison operator
This operator is provided to establish a sorting order
__mul__
method descriptor
__mul__() -> DPoint
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test operator
__neg__
method descriptor
__neg__() -> DPoint
@brief Compute the negative of a point
Returns a new point with -x, -y.
This method has been added in version 0.23.
__repr__
method descriptor
__repr__() -> str
@brief String conversion. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__() -> DPoint
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief String conversion. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__sub__
method descriptor
__sub__(p: DPoint) -> DVector
__sub__(v: DVector) -> DPoint
__sub__()
@brief Subtract one vector from a point
Subtract vector v from from self by subtracting the coordinates. This renders a point.
This method has been added in version 0.27.
__truediv__
method descriptor
__truediv__() -> DPoint
@brief Division by some divisor
Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded.
abs
method descriptor
abs() -> float
@brief The absolute value of the point (Euclidian distance to 0,0)
The returned value is 'sqrt(xx+yy)'.
This method has been introduced in version 0.23.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
distance
method descriptor
distance() -> float
@brief The Euclidian distance to another point
@param d The other point to compute the distance to.
dup
method descriptor
dup() -> DPoint
@brief Creates a copy of self
from_ipoint
builtin
from_ipoint() -> DPoint
@brief Creates a floating-point coordinate point from an integer coordinate point
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoint'.
from_s
builtin
from_s() -> DPoint
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given point. This method enables points as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DPoint
new(point: Point) -> DPoint
new(v: DVector) -> DPoint
new(x: float, y: float) -> DPoint
new()
@brief Constructor for a point from two coordinate values
sq_abs
method descriptor
sq_abs() -> float
@brief The square of the absolute value of the point (Euclidian distance to 0,0)
The returned value is 'xx+yy'.
This method has been introduced in version 0.23.
sq_distance
method descriptor
sq_distance() -> float
@brief The square Euclidian distance to another point
@param d The other point to compute the distance to.
to_itype
method descriptor
to_itype() -> Point
@brief Converts the point to an integer coordinate point
The database unit can be specified to translate the floating-point coordinate point in micron units to an integer-coordinate point in database units. The point's' coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief String conversion. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
to_v
method descriptor
to_v() -> DVector
@brief Turns the point into a vector This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25.
DPolygon
@brief A polygon class
A polygon consists of an outer hull and zero to many holes. Each contour consists of several points. The point list is normalized such that the leftmost, lowest point is the first one. The orientation is normalized such that the orientation of the hull contour is clockwise, while the orientation of the holes is counterclockwise.
It is in no way checked that the contours are not overlapping. This must be ensured by the user of the object when filling the contours.
A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon.
Here's an example of how to create a polygon:
@code hull = [ RBA::DPoint::new(0, 0), RBA::DPoint::new(6000, 0), RBA::DPoint::new(6000, 3000), RBA::DPoint::new(0, 3000) ] hole1 = [ RBA::DPoint::new(1000, 1000), RBA::DPoint::new(2000, 1000), RBA::DPoint::new(2000, 2000), RBA::DPoint::new(1000, 2000) ] hole2 = [ RBA::DPoint::new(3000, 1000), RBA::DPoint::new(4000, 1000), RBA::DPoint::new(4000, 2000), RBA::DPoint::new(3000, 2000) ] poly = RBA::DPolygon::new(hull) poly.insert_hole(hole1) poly.insert_hole(hole2)
ask the polygon for some properties
poly.holes # -> 2 poly.area # -> 16000000.0 poly.perimeter # -> 26000.0 poly.bbox # -> (0,0;6000,3000) @/code
The \DPolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \Polygon.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A polygon class\n\nA polygon consists of an outer hull and zero to many\nholes. Each contour consists of several points. The point\nlist is normalized such that the leftmost, lowest point is \nthe first one. The orientation is normalized such that\nthe orientation of the hull contour is clockwise, while\nthe orientation of the holes is counterclockwise.\n\nIt is in no way checked that the contours are not overlapping.\nThis must be ensured by the user of the object\nwhen filling the contours.\n\nA polygon can be asked for the number of holes using the \\holes method. \\each_point_hull delivers the points of the hull contour. \\each_point_hole delivers the points of a specific hole. \\each_edge delivers the edges (point-to-point connections) of both hull and holes. \\bbox delivers the bounding box, \\area the area and \\perimeter the perimeter of the polygon.\n\nHere\'s an example of how to create a polygon:\n\n@code\nhull = [ RBA::DPoint::new(0, 0), RBA::DPoint::new(6000, 0), \n RBA::DPoint::new(6000, 3000), RBA::DPoint::new(0, 3000) ]\nhole1 = [ RBA::DPoint::new(1000, 1000), RBA::DPoint::new(2000, 1000), \n RBA::DPoint::new(2000, 2000), RBA::DPoint::new(1000, 2000) ]\nhole2 = [ RBA::DPoint::new(3000, 1000), RBA::DPoint::new(4000, 1000), \n RBA::DPoint::new(4000, 2000), RBA::DPoint::new(3000, 2000) ]\npoly = RBA::DPolygon::new(hull)\npoly.insert_hole(hole1)\npoly.insert_hole(hole2)\n\n# ask the polygon for some properties\npoly.holes # -> 2\npoly.area # -> 16000000.0\npoly.perimeter # -> 26000.0\npoly.bbox # -> (0,0;6000,3000)\n@/code\n\nThe \\DPolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \\Polygon.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 155
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DPolygon' objects>
list of weak references to the object
hull
class
hull: None = <attribute 'hull' of 'DPolygon' objects>
@brief Sets the points of the hull of polygon @param p An array of points to assign to the polygon's hull The 'assign_hull' variant is provided in analogy to 'assign_hole'.
__copy__
method descriptor
__copy__() -> DPolygon
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DPolygon
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns a value indicating whether the polygons are equal @param p The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(box: DBox) -> None
__init__(polygon: Polygon) -> None
__init__(pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None
__init__(sp: DSimplePolygon) -> None
__init__()
@brief Creates a polygon from a box
@param box The box to convert to a polygon
__lt__
method descriptor
__lt__() -> bool
@brief Returns a value indicating whether self is less than p @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
__mul__
method descriptor
__mul__() -> DPolygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Returns a value indicating whether the polygons are not equal @param p The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the polygon
__rmul__
method descriptor
__rmul__() -> DPolygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the polygon
area
method descriptor
area() -> float
@brief Gets the area of the polygon The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases.
area2
method descriptor
area2() -> float
@brief Gets the double area of the polygon This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types.
This method has been introduced in version 0.26.1
area_upper_manhattan_bound
method descriptor
area_upper_manhattan_bound() -> float
@hide
area_upper_manhattan_bound2
method descriptor
area_upper_manhattan_bound2() -> float
@hide
assign
method descriptor
assign() -> None
@brief Assigns another object to self
assign_hole
method descriptor
assign_hole(n: int, b: DBox) -> None
assign_hole(n: int, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None
assign_hole()
@brief Sets the box as the given hole of the polygon @param n The index of the hole to which the points should be assigned @param b The box to assign to the polygon's hole If the hole index is not valid, this method does nothing. This method was introduced in version 0.23.
assign_hull
method descriptor
assign_hull() -> None
@brief Sets the points of the hull of polygon @param p An array of points to assign to the polygon's hull @param raw If true, the points won't be compressed
If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications.
Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always.
The 'assign_hull' variant is provided in analogy to 'assign_hole'.
The 'raw' argument was added in version 0.24.
bbox
method descriptor
bbox() -> DBox
@brief Returns the bounding box of the polygon The bounding box is the box enclosing all points of the polygon.
break_
method descriptor
break_() -> List[DPolygon]
@brief Splits the polygon into parts with a maximum vertex count and area ratio The area ratio is the ratio between the bounding box area and the polygon area. Higher values mean more 'skinny' polygons.
This method will split the input polygon into pieces having a maximum of 'max_vertex_count' vertices and an area ratio less than 'max_area_ratio'. 'max_vertex_count' can be zero. In this case the limit is ignored. Also 'max_area_ratio' can be zero, in which case it is ignored as well.
The method of splitting is unspecified. The algorithm will apply 'split' recursively until the parts satisfy the limits.
This method has been introduced in version 0.29.
compress
method descriptor
compress() -> None
@brief Compresses the polygon.
This method removes redundant points from the polygon, such as points being on a line formed by two other points. If remove_reflected is true, points are also removed if the two adjacent edges form a spike.
@param remove_reflected See description of the functionality.
This method was introduced in version 0.18.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DPolygon
@brief Creates a copy of self
each_edge
method descriptor
each_edge() -> Iterator[DEdge]
each_edge(contour: int) -> Iterator[DEdge]
each_edge()
@brief Iterates over the edges of one contour of the polygon
@param contour The contour number (0 for hull, 1 for first hole ...)
This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. Hole edges are oriented counterclockwise while hull edges are oriented clockwise.
This method was introduced in version 0.24.
each_point_hole
method descriptor
each_point_hole() -> Iterator[DPoint]
@brief Iterates over the points that make up the nth hole The hole number must be less than the number of holes (see \holes)
each_point_hull
method descriptor
each_point_hull() -> Iterator[DPoint]
@brief Iterates over the points that make up the hull
ellipse
builtin
ellipse() -> DPolygon
@brief Creates a simple polygon approximating an ellipse
@param box The bounding box of the ellipse @param n The number of points that will be used to approximate the ellipse
This method has been introduced in version 0.23.
extract_rad
method descriptor
extract_rad() -> List[Any]
@brief Extracts the corner radii from a rounded polygon
Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul @li The polygon with the rounded corners replaced by edgy ones @/li @li The radius of the inner corners @/li @li The radius of the outer corners @/li @li The number of points per full circle @/li @/ul
This method is based on some assumptions and may fail. In this case, an empty array is returned.
If successful, the following code will more or less render the original polygon and parameters
@code p = ... # some polygon p.round_corners(ri, ro, n) (p2, ri2, ro2, n2) = p.extract_rad
-> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits)
@/code
This method was introduced in version 0.25.
from_ipoly
builtin
from_ipoly() -> DPolygon
@brief Creates a floating-point coordinate polygon from an integer coordinate polygon
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'.
from_s
builtin
from_s() -> DPolygon
@brief Creates a polygon 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
holes
method descriptor
holes() -> int
@brief Returns the number of holes
insert_hole
method descriptor
insert_hole(b: DBox) -> None
insert_hole(p: Sequence[DPoint], raw: Optional[bool] = ...) -> None
insert_hole()
@brief Inserts a hole from the given box @param b The box to insert as a new hole This method was introduced in version 0.23.
inside
method descriptor
inside() -> bool
@brief Tests, if the given point is inside the polygon If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise.
is_box
method descriptor
is_box() -> bool
@brief Returns true, if the polygon is a simple box.
A polygon is a box if it is identical to its bounding box.
@return True if the polygon is a box.
This method was introduced in version 0.23.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_empty
method descriptor
is_empty() -> bool
@brief Returns a value indicating whether the polygon is empty
is_halfmanhattan
method descriptor
is_halfmanhattan() -> bool
@brief Returns a value indicating whether the polygon is half-manhattan Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping.
This predicate was introduced in version 0.27.
is_rectilinear
method descriptor
is_rectilinear() -> bool
@brief Returns a value indicating whether the polygon is rectilinear
move
method descriptor
move(p: DVector) -> DPolygon
move(x: float, y: float) -> DPolygon
move()
@brief Moves the polygon.
Moves the polygon by the given offset and returns the moved polygon. The polygon is overwritten.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon (self).
moved
method descriptor
moved(p: DVector) -> DPolygon
moved(x: float, y: float) -> DPolygon
moved()
@brief Returns the moved polygon (does not modify self)
Moves the polygon by the given offset and returns the moved polygon. The polygon is not modified.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon.
This method has been introduced in version 0.23.
new
builtin
new() -> DPolygon
new(box: DBox) -> DPolygon
new(polygon: Polygon) -> DPolygon
new(pts: Sequence[DPoint], raw: Optional[bool] = ...) -> DPolygon
new(sp: DSimplePolygon) -> DPolygon
new()
@brief Creates a polygon from a box
@param box The box to convert to a polygon
num_points
method descriptor
num_points() -> int
@brief Gets the total number of points (hull plus holes) This method was introduced in version 0.18.
num_points_hole
method descriptor
num_points_hole() -> int
@brief Gets the number of points of the given hole The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes).
num_points_hull
method descriptor
num_points_hull() -> int
@brief Gets the number of points of the hull
perimeter
method descriptor
perimeter() -> float
@brief Gets the perimeter of the polygon The perimeter is sum of the lengths of all edges making up the polygon.
This method has been introduce in version 0.23.
point_hole
method descriptor
point_hole() -> DPoint
@brief Gets a specific point of a hole @param n The index of the hole to which the points should be assigned @param p The index of the point to get If the index of the point or of the hole is not valid, a default value is returned. This method was introduced in version 0.18.
point_hull
method descriptor
point_hull() -> DPoint
@brief Gets a specific point of the hull @param p The index of the point to get If the index of the point is not a valid index, a default value is returned. This method was introduced in version 0.18.
round_corners
method descriptor
round_corners() -> DPolygon
@brief Rounds the corners of the polygon
Replaces the corners of the polygon with circle segments.
@param rinner The circle radius of inner corners (in database units). @param router The circle radius of outer corners (in database units). @param n The number of points per full circle.
@return The new polygon.
This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types.
size
method descriptor
size(d: float, mode: Optional[int] = ...) -> None
size(dv: Vector, mode: Optional[int] = ...) -> None
size(dx: float, dy: float, mode: int) -> None
size()
@brief Sizes the polygon (biasing)
Shifts the contour outwards (d>0) or inwards (d<0). This method is equivalent to @code size(d, d, mode) @/code
See \size for a detailed description.
This method has been introduced in version 0.23.
sized
method descriptor
sized(d: float, mode: Optional[int] = ...) -> DPolygon
sized(dv: Vector, mode: Optional[int] = ...) -> DPolygon
sized(dx: float, dy: float, mode: int) -> DPolygon
sized()
@brief Sizes the polygon (biasing) without modifying self
Shifts the contour outwards (d>0) or inwards (d<0). This method is equivalent to @code sized(d, d, mode) @/code
See \size and \sized for a detailed description.
sort_holes
method descriptor
sort_holes() -> None
@brief Brings the holes in a specific order This function is normalize the hole order so the comparison of two polygons does not depend on the order the holes were inserted. Polygons generated by KLayout's alorithms have their holes sorted.
This method has been introduced in version 0.28.8.
split
method descriptor
split() -> List[DPolygon]
@brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes.
The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit.
This method has been introduced in version 0.25.3.
to_itype
method descriptor
to_itype() -> Polygon
@brief Converts the polygon to an integer coordinate polygon
The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygons coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the polygon
touches
method descriptor
touches(box: DBox) -> bool
touches(edge: DEdge) -> bool
touches(polygon: DPolygon) -> bool
touches(simple_polygon: DSimplePolygon) -> bool
touches()
@brief Returns true, if the polygon touches the other polygon. The polygons touch if they overlap or their contours share at least one point.
This method was introduced in version 0.25.1.
transform
method descriptor
transform(t: DCplxTrans) -> DPolygon
transform(t: DTrans) -> DPolygon
transform()
@brief Transforms the polygon (in-place)
Transforms the polygon with the given transformation. Modifies self and returns self. An out-of-place version which does not modify self is \transformed.
@param t The transformation to apply.
This method has been introduced in version 0.24.
transformed
method descriptor
transformed(t: DCplxTrans) -> DPolygon
transformed(t: DTrans) -> DPolygon
transformed(t: VCplxTrans) -> Polygon
transformed()
@brief Transforms the polygon with a complex transformation
Transforms the polygon with the given complex transformation. Does not modify the polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
transformed_cplx
method descriptor
transformed_cplx() -> DPolygon
@brief Transforms the polygon with a complex transformation
Transforms the polygon with the given complex transformation. Does not modify the polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
DSimplePolygon
@brief A simple polygon class
A simple polygon consists of an outer hull only. To support polygons with holes, use \DPolygon. The contour consists of several points. The point list is normalized such that the leftmost, lowest point is the first one. The orientation is normalized such that the orientation of the hull contour is clockwise.
It is in no way checked that the contours are not over- lapping. This must be ensured by the user of the object when filling the contours.
The \DSimplePolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \SimplePolygon.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A simple polygon class\n\nA simple polygon consists of an outer hull only. To support polygons with holes, use \\DPolygon.\nThe contour consists of several points. The point\nlist is normalized such that the leftmost, lowest point is \nthe first one. The orientation is normalized such that\nthe orientation of the hull contour is clockwise.\n\nIt is in no way checked that the contours are not over-\nlapping. This must be ensured by the user of the object\nwhen filling the contours.\n\nThe \\DSimplePolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \\SimplePolygon.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 153
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DSimplePolygon' objects>
list of weak references to the object
points
class
points: None = <attribute 'points' of 'DSimplePolygon' objects>
@brief Sets the points of the simple polygon
@param pts An array of points to assign to the simple polygon
See the constructor description for details about raw mode.
__copy__
method descriptor
__copy__() -> DSimplePolygon
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DSimplePolygon
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns a value indicating whether self is equal to p @param p The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(box: DBox) -> None
__init__(polygon: SimplePolygon) -> None
__init__(pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None
__init__()
@brief Constructor converting a box to a polygon
@param box The box to convert to a polygon
__lt__
method descriptor
__lt__() -> bool
@brief Returns a value indicating whether self is less than p @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
This method has been introduced in version 0.25.
__mul__
method descriptor
__mul__() -> DSimplePolygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Returns a value indicating whether self is not equal to p @param p The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the polygon
__rmul__
method descriptor
__rmul__() -> DSimplePolygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the polygon
area
method descriptor
area() -> float
@brief Gets the area of the polygon The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.
area2
method descriptor
area2() -> float
@brief Gets the double area of the polygon This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types.
This method has been introduced in version 0.26.1
area_upper_manhattan_bound
method descriptor
area_upper_manhattan_bound() -> float
@hide
area_upper_manhattan_bound2
method descriptor
area_upper_manhattan_bound2() -> float
@hide
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> DBox
@brief Returns the bounding box of the simple polygon
break_
method descriptor
break_() -> List[DSimplePolygon]
@brief Splits the polygon into parts with a maximum vertex count and area ratio The area ratio is the ratio between the bounding box area and the polygon area. Higher values mean more 'skinny' polygons.
This method will split the input polygon into pieces having a maximum of 'max_vertex_count' vertices and an area ratio less than 'max_area_ratio'. 'max_vertex_count' can be zero. In this case the limit is ignored. Also 'max_area_ratio' can be zero, in which case it is ignored as well.
The method of splitting is unspecified. The algorithm will apply 'split' recursively until the parts satisfy the limits.
This method has been introduced in version 0.29.
compress
method descriptor
compress() -> None
@brief Compressed the simple polygon.
This method removes redundant points from the polygon, such as points being on a line formed by two other points. If remove_reflected is true, points are also removed if the two adjacent edges form a spike.
@param remove_reflected See description of the functionality.
This method was introduced in version 0.18.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DSimplePolygon
@brief Creates a copy of self
each_edge
method descriptor
each_edge() -> Iterator[DEdge]
@brief Iterates over the edges that make up the simple polygon
each_point
method descriptor
each_point() -> Iterator[DPoint]
@brief Iterates over the points that make up the simple polygon
ellipse
builtin
ellipse() -> DSimplePolygon
@brief Creates a simple polygon approximating an ellipse
@param box The bounding box of the ellipse @param n The number of points that will be used to approximate the ellipse
This method has been introduced in version 0.23.
extract_rad
method descriptor
extract_rad() -> List[Any]
@brief Extracts the corner radii from a rounded polygon
Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul @li The polygon with the rounded corners replaced by edgy ones @/li @li The radius of the inner corners @/li @li The radius of the outer corners @/li @li The number of points per full circle @/li @/ul
This method is based on some assumptions and may fail. In this case, an empty array is returned.
If successful, the following code will more or less render the original polygon and parameters
@code p = ... # some polygon p.round_corners(ri, ro, n) (p2, ri2, ro2, n2) = p.extract_rad
-> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits)
@/code
This method was introduced in version 0.25.
from_ipoly
builtin
from_ipoly() -> DSimplePolygon
@brief Creates a floating-point coordinate polygon from an integer coordinate polygon This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipoly'.
from_s
builtin
from_s() -> DSimplePolygon
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
inside
method descriptor
inside() -> bool
@brief Gets a value indicating whether the given point is inside the polygon If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise.
is_box
method descriptor
is_box() -> bool
@brief Returns a value indicating whether the polygon is a simple box.
A polygon is a box if it is identical to its bounding box.
@return True if the polygon is a box.
This method was introduced in version 0.23.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_empty
method descriptor
is_empty() -> bool
@brief Returns a value indicating whether the polygon is empty
is_halfmanhattan
method descriptor
is_halfmanhattan() -> bool
@brief Returns a value indicating whether the polygon is half-manhattan Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping.
This predicate was introduced in version 0.27.
is_rectilinear
method descriptor
is_rectilinear() -> bool
@brief Returns a value indicating whether the polygon is rectilinear
move
method descriptor
move(p: DVector) -> DSimplePolygon
move(x: float, y: float) -> DSimplePolygon
move()
@brief Moves the polygon.
Moves the polygon by the given offset and returns the moved polygon. The polygon is overwritten.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon (self).
moved
method descriptor
moved(p: DVector) -> DSimplePolygon
moved(x: float, y: float) -> DSimplePolygon
moved()
@brief Returns the moved polygon (does not modify self)
Moves the polygon by the given offset and returns the moved polygon. The polygon is not modified.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon.
This method has been introduced in version 0.23.
new
builtin
new() -> DSimplePolygon
new(box: DBox) -> DSimplePolygon
new(polygon: SimplePolygon) -> DSimplePolygon
new(pts: Sequence[DPoint], raw: Optional[bool] = ...) -> DSimplePolygon
new()
@brief Constructor converting a box to a polygon
@param box The box to convert to a polygon
num_points
method descriptor
num_points() -> int
@brief Gets the number of points
perimeter
method descriptor
perimeter() -> float
@brief Gets the perimeter of the polygon The perimeter is sum of the lengths of all edges making up the polygon.
point
method descriptor
point() -> DPoint
@brief Gets a specific point of the contour@param p The index of the point to get If the index of the point is not a valid index, a default value is returned. This method was introduced in version 0.18.
round_corners
method descriptor
round_corners() -> DSimplePolygon
@brief Rounds the corners of the polygon
Replaces the corners of the polygon with circle segments.
@param rinner The circle radius of inner corners (in database units). @param router The circle radius of outer corners (in database units). @param n The number of points per full circle.
@return The new polygon.
This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types.
set_points
method descriptor
set_points() -> None
@brief Sets the points of the simple polygon
@param pts An array of points to assign to the simple polygon @param raw If true, the points are taken as they are
See the constructor description for details about raw mode.
This method has been added in version 0.24.
split
method descriptor
split() -> List[DSimplePolygon]
@brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes.
The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit.
This method has been introduced in version 0.25.3.
to_itype
method descriptor
to_itype() -> SimplePolygon
@brief Converts the polygon to an integer coordinate polygon The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygon's' coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the polygon
touches
method descriptor
touches(box: DBox) -> bool
touches(edge: DEdge) -> bool
touches(polygon: DPolygon) -> bool
touches(simple_polygon: DSimplePolygon) -> bool
touches()
@brief Returns true, if the polygon touches the other polygon. The polygons touch if they overlap or their contours share at least one point.
This method was introduced in version 0.25.1.
transform
method descriptor
transform(t: DCplxTrans) -> DSimplePolygon
transform(t: DTrans) -> DSimplePolygon
transform()
@brief Transforms the simple polygon (in-place)
Transforms the simple polygon with the given transformation. Modifies self and returns self. An out-of-place version which does not modify self is \transformed.
@param t The transformation to apply.
This method has been introduced in version 0.24.
transformed
method descriptor
transformed(t: DCplxTrans) -> DSimplePolygon
transformed(t: DTrans) -> DSimplePolygon
transformed(t: VCplxTrans) -> SimplePolygon
transformed()
@brief Transforms the simple polygon.
Transforms the simple polygon with the given complex transformation. Does not modify the simple polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed simple polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
transformed_cplx
method descriptor
transformed_cplx() -> DSimplePolygon
@brief Transforms the simple polygon.
Transforms the simple polygon with the given complex transformation. Does not modify the simple polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed simple polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
DText
@brief A text object
A text object has a point (location), a text, a text transformation, a text size and a font id. Text size and font id are provided to be be able to render the text correctly. Text objects are used as labels (i.e. for pins) or to indicate a particular position.
The \DText class uses floating-point coordinates. A class that operates with integer coordinates is \Text.
See @The Database API@ for more details about the database objects.
HAlignCenter
class
HAlignCenter: HAlign = HAlignCenter (1)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignLeft
class
HAlignLeft: HAlign = HAlignLeft (0)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignRight
class
HAlignRight: HAlign = HAlignRight (2)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
NoHAlign
class
NoHAlign: HAlign = NoHAlign (-1)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
NoVAlign
class
NoVAlign: VAlign = NoVAlign (-1)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignBottom
class
VAlignBottom: VAlign = VAlignBottom (2)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignCenter
class
VAlignCenter: VAlign = VAlignCenter (1)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignTop
class
VAlignTop: VAlign = VAlignTop (0)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief A text object\n\nA text object has a point (location), a text, a text transformation,\na text size and a font id. Text size and font id are provided to be\nbe able to render the text correctly.\nText objects are used as labels (i.e. for pins) or to indicate a particular position.\n\nThe \\DText class uses floating-point coordinates. A class that operates with integer coordinates is \\Text.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 176
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DText' objects>
list of weak references to the object
font
class
font: int = <attribute 'font' of 'DText' objects>
@brief Gets the font number See \font= for a description of this property.
@brief Sets the font number The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects.
halign
class
halign: HAlign = <attribute 'halign' of 'DText' objects>
@brief Gets the horizontal alignment
See \halign= for a description of this property.
@brief Sets the horizontal alignment
This is the version accepting integer values. It's provided for backward compatibility.
@brief Sets the horizontal alignment
This property specifies how the text is aligned relative to the anchor point. This property has been introduced in version 0.22 and extended to enums in 0.28.
size
class
size: float = <attribute 'size' of 'DText' objects>
@brief Gets the text height
@brief Sets the text height of this object
string
class
string: str = <attribute 'string' of 'DText' objects>
@brief Get the text string
@brief Assign a text string to this object
trans
class
trans: DTrans = <attribute 'trans' of 'DText' objects>
@brief Gets the transformation
@brief Assign a transformation (text position and orientation) to this object
valign
class
valign: VAlign = <attribute 'valign' of 'DText' objects>
@brief Gets the vertical alignment
See \valign= for a description of this property.
@brief Sets the vertical alignment
This is the version accepting integer values. It's provided for backward compatibility.
@brief Sets the vertical alignment
This property specifies how the text is aligned relative to the anchor point. This property has been introduced in version 0.22 and extended to enums in 0.28.
x
class
x: float = <attribute 'x' of 'DText' objects>
@brief Gets the x location of the text
This method has been introduced in version 0.23.
@brief Sets the x location of the text
This method has been introduced in version 0.23.
y
class
y: float = <attribute 'y' of 'DText' objects>
@brief Gets the y location of the text
This method has been introduced in version 0.23.
@brief Sets the y location of the text
This method has been introduced in version 0.23.
__copy__
method descriptor
__copy__() -> DText
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DText
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality
Return true, if this text object and the given text are equal
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given text object. This method enables texts as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(Text: Text) -> None
__init__(string: str, trans: DTrans) -> None
__init__(string: str, trans: DTrans, height: float, font: int) -> None
__init__(string: str, x: float, y: float) -> None
__init__()
@brief Constructor with string, transformation, text height and font
A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified.
__lt__
method descriptor
__lt__() -> bool
@brief Less operator @param t The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
__ne__
method descriptor
__ne__() -> bool
@brief Inequality
Return true, if this text object and the given text are not equal
__repr__
method descriptor
__repr__() -> str
@brief Converts the object to a string. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__str__
method descriptor
__str__() -> str
@brief Converts the object to a string. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> DBox
@brief Gets the bounding box of the text The bounding box of the text is a single point - the location of the text. Both points of the box are identical.
This method has been added in version 0.28.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DText
@brief Creates a copy of self
from_s
builtin
from_s() -> DText
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given text object. This method enables texts as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
move
method descriptor
move(distance: DVector) -> DText
move(dx: float, dy: float) -> DText
move()
@brief Moves the text by a certain distance (modifies self)
Moves the text by a given distance in x and y direction and returns the moved text. Does not check for coordinate overflows.
@param dx The x distance to move the text. @param dy The y distance to move the text.
@return A reference to this text object
This method was introduced in version 0.23.
moved
method descriptor
moved(distance: DVector) -> DText
moved(dx: float, dy: float) -> DText
moved()
@brief Returns the text moved by a certain distance (does not modify self)
Moves the text by a given offset and returns the moved text. Does not modify *this. Does not check for coordinate overflows.
@param dx The x distance to move the text. @param dy The y distance to move the text.
@return The moved text.
This method was introduced in version 0.23.
new
builtin
new() -> DText
new(Text: Text) -> DText
new(string: str, trans: DTrans) -> DText
new(string: str, trans: DTrans, height: float, font: int) -> DText
new(string: str, x: float, y: float) -> DText
new()
@brief Constructor with string, transformation, text height and font
A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified.
position
method descriptor
position() -> DPoint
@brief Gets the position of the text
This convenience method has been added in version 0.28.
to_itype
method descriptor
to_itype() -> Text
@brief Converts the text to an integer coordinate text
The database unit can be specified to translate the floating-point coordinate Text in micron units to an integer-coordinate text in database units. The text's coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Converts the object to a string. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
transformed
method descriptor
transformed(t: DCplxTrans) -> DText
transformed(t: DTrans) -> DText
transformed(t: VCplxTrans) -> Text
transformed()
@brief Transforms the text with the given complex transformation
@param t The magnifying transformation to apply @return The transformed text (a DText now)
DTrans
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M0
class
M0: DTrans = m0 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M135
class
M135: DTrans = m135 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M45
class
M45: DTrans = m45 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M90
class
M90: DTrans = m90 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R0
class
R0: DTrans = r0 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R180
class
R180: DTrans = r180 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R270
class
R270: DTrans = r270 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R90
class
R90: DTrans = r90 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on floating-point coordinates. A version for integer coordinates is \Trans.
Here are some examples for using the DTrans class:
@code t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s
apply to a point: -> "0,100"
RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A simple transformation\n\nSimple transformations only provide rotations about angles which a multiples of 90 degree.\nTogether with the mirror options, this results in 8 distinct orientations (fixpoint transformations).\nThese can be combined with a displacement which is applied after the rotation/mirror.\nThis version acts on floating-point coordinates. A version for integer coordinates is \\Trans.\n\nHere are some examples for using the DTrans class:\n\n@code\nt = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction\n# the inverse: -> "r0 0,-100"\nt.inverted.to_s\n# concatenation: -> "r90 -100,0"\n(RBA::DTrans::new(RBA::DTrans::R90) * t).to_s\n# apply to a point: -> "0,100"\nRBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0))\n@/code\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 187
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DTrans' objects>
list of weak references to the object
angle
class
angle: int = <attribute 'angle' of 'DTrans' objects>
@brief Gets the angle in units of 90 degree
This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true.
@brief Sets the angle in units of 90 degree @param a The new angle
This method was introduced in version 0.20.
disp
class
disp: DVector = <attribute 'disp' of 'DTrans' objects>
@brief Gets to the displacement vector
Staring with version 0.25 the displacement type is a vector.
@brief Sets the displacement @param u The new displacement
This method was introduced in version 0.20. Staring with version 0.25 the displacement type is a vector.
mirror
class
mirror: bool = <attribute 'mirror' of 'DTrans' objects>
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
@brief Sets the mirror flag "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag
This method was introduced in version 0.20.
rot
class
rot: int = <attribute 'rot' of 'DTrans' objects>
@brief Gets the angle/mirror code
The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis).
@brief Sets the angle/mirror code @param r The new angle/rotation code (see \rot property)
This method was introduced in version 0.20.
__copy__
method descriptor
__copy__() -> DTrans
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DTrans
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(c: DTrans, u: Optional[DVector] = ...) -> None
__init__(c: DTrans, x: Optional[float] = ..., y: Optional[float] = ...) -> None
__init__(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., u: Optional[DVector] = ...) -> None
__init__(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> None
__init__(trans: Trans) -> None
__init__(u: DVector) -> None
__init__(x: float, y: float) -> None
__init__()
@brief Creates a transformation using a displacement given as two coordinates
@param x The horizontal displacement @param y The vertical displacement
__lt__
method descriptor
__lt__() -> bool
@brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions.
__mul__
method descriptor
__mul__(box: DBox) -> DBox
__mul__(d: float) -> float
__mul__(edge: DEdge) -> DEdge
__mul__(p: DPoint) -> DPoint
__mul__(path: DPath) -> DPath
__mul__(polygon: DPolygon) -> DPolygon
__mul__(t: DTrans) -> DTrans
__mul__(text: DText) -> DText
__mul__(v: DVector) -> DVector
__mul__()
@brief Returns the concatenated transformation
The * operator returns self*t ("t is applied before this transformation").
@param t The transformation to apply before @return The modified transformation
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality
__repr__
method descriptor
__repr__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: DBox) -> DBox
__rmul__(d: float) -> float
__rmul__(edge: DEdge) -> DEdge
__rmul__(p: DPoint) -> DPoint
__rmul__(path: DPath) -> DPath
__rmul__(polygon: DPolygon) -> DPolygon
__rmul__(text: DText) -> DText
__rmul__(v: DVector) -> DVector
__rmul__()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
ctrans
method descriptor
ctrans() -> float
@brief Transforms a single distance
The "ctrans" method transforms the given distance. This is equivalent to multiplying with the magnification. For the simple transformations, there is no magnification and no modification of the distance.
@param d The distance to transform @return The transformed distance
The product '*' has been added as a synonym in version 0.28. The distance can be signed since version 0.29.3.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DTrans
@brief Creates a copy of self
from_itrans
builtin
from_itrans() -> DTrans
@brief Creates a floating-point coordinate transformation from an integer coordinate transformation
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'.
from_s
builtin
from_s() -> DTrans
@brief Creates a transformation 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> DTrans
@brief Inverts the transformation (in place)
Inverts the transformation and replaces this object by the inverted one.
@return The inverted transformation
inverted
method descriptor
inverted() -> DTrans
@brief Returns the inverted transformation Returns the inverted transformation
@return The inverted transformation
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mirror
method descriptor
is_mirror() -> bool
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
new
builtin
new() -> DTrans
new(c: DTrans, u: Optional[DVector] = ...) -> DTrans
new(c: DTrans, x: Optional[float] = ..., y: Optional[float] = ...) -> DTrans
new(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., u: Optional[DVector] = ...) -> DTrans
new(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., x: Optional[float] = ..., y: Optional[float] = ...) -> DTrans
new(trans: Trans) -> DTrans
new(u: DVector) -> DTrans
new(x: float, y: float) -> DTrans
new()
@brief Creates a transformation using a displacement given as two coordinates
@param x The horizontal displacement @param y The vertical displacement
to_itype
method descriptor
to_itype() -> Trans
@brief Converts the transformation to an integer coordinate transformation
The database unit can be specified to translate the floating-point coordinate transformation in micron units to an integer-coordinate transformation in database units. The transformation's' coordinates will be divided by the database unit.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
trans
method descriptor
trans(box: DBox) -> DBox
trans(edge: DEdge) -> DEdge
trans(p: DPoint) -> DPoint
trans(path: DPath) -> DPath
trans(polygon: DPolygon) -> DPolygon
trans(text: DText) -> DText
trans(v: DVector) -> DVector
trans()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
DVector
@brief A vector class with double (floating-point) coordinates A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Vector), points with floating-point coordinates can represent fractions of a database unit or vectors in physical (micron) units.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A vector class with double (floating-point) coordinates\nA vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. \nVectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\\Vector), points with floating-point coordinates can represent fractions of a database unit or vectors in physical (micron) units.\n\nThis class has been introduced in version 0.25.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 193
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DVector' objects>
list of weak references to the object
x
class
x: float = <attribute 'x' of 'DVector' objects>
@brief Accessor to the x coordinate
@brief Write accessor to the x coordinate
y
class
y: float = <attribute 'y' of 'DVector' objects>
@brief Accessor to the y coordinate
@brief Write accessor to the y coordinate
__add__
method descriptor
__add__(p: DPoint) -> DPoint
__add__(v: DVector) -> DVector
__add__()
@brief Adds a vector and a point
Returns the point p shifted by the vector.
__copy__
method descriptor
__copy__() -> DVector
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DVector
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test operator
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given vector. This method enables vectors as hash keys.
This method has been introduced in version 0.25.
__imul__
method descriptor
__imul__() -> DVector
@brief Scaling by some factor
Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded.
__init__
method descriptor
__init__() -> None
__init__(p: DPoint) -> None
__init__(vector: Vector) -> None
__init__(x: float, y: float) -> None
__init__()
@brief Constructor for a vector from two coordinate values
__itruediv__
method descriptor
__itruediv__() -> DVector
@brief Division by some divisor
Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded.
__lt__
method descriptor
__lt__() -> bool
@brief "less" comparison operator
This operator is provided to establish a sorting order
__mul__
method descriptor
__mul__(f: float) -> DVector
__mul__(v: DVector) -> float
__mul__()
@brief Computes the scalar product between self and the given vector
The scalar product of a and b is defined as: vp = axbx+ayby.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test operator
__neg__
method descriptor
__neg__() -> DVector
@brief Compute the negative of a vector
Returns a new vector with -x,-y.
__repr__
method descriptor
__repr__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(f: float) -> DVector
__rmul__(v: DVector) -> float
__rmul__()
@brief Computes the scalar product between self and the given vector
The scalar product of a and b is defined as: vp = axbx+ayby.
__str__
method descriptor
__str__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__sub__
method descriptor
__sub__() -> DVector
@brief Subtract two vectors
Subtract vector v from self by subtracting the coordinates.
__truediv__
method descriptor
__truediv__() -> DVector
@brief Division by some divisor
Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded.
abs
method descriptor
abs() -> float
@brief Returns the length of the vector 'abs' is an alias provided for compatibility with the former point type.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DVector
@brief Creates a copy of self
from_s
builtin
from_s() -> DVector
@brief Creates an object from a string Creates the object from a string representation (as returned by \to_s)
hash
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given vector. This method enables vectors as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
length
method descriptor
length() -> float
@brief Returns the length of the vector 'abs' is an alias provided for compatibility with the former point type.
new
builtin
new() -> DVector
new(p: DPoint) -> DVector
new(vector: Vector) -> DVector
new(x: float, y: float) -> DVector
new()
@brief Constructor for a vector from two coordinate values
sprod
method descriptor
sprod() -> float
@brief Computes the scalar product between self and the given vector
The scalar product of a and b is defined as: vp = axbx+ayby.
sprod_sign
method descriptor
sprod_sign() -> int
@brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product
@return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative.
sq_abs
method descriptor
sq_abs() -> float
@brief The square length of the vector 'sq_abs' is an alias provided for compatibility with the former point type.
sq_length
method descriptor
sq_length() -> float
@brief The square length of the vector 'sq_abs' is an alias provided for compatibility with the former point type.
to_itype
method descriptor
to_itype() -> Vector
@brief Converts the point to an integer coordinate point
The database unit can be specified to translate the floating-point coordinate vector in micron units to an integer-coordinate vector in database units. The vector's' coordinates will be divided by the database unit.
to_p
method descriptor
to_p() -> DPoint
@brief Turns the vector into a point This method returns the point resulting from adding the vector to (0,0). This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
vprod
method descriptor
vprod() -> float
@brief Computes the vector product between self and the given vector
The vector product of a and b is defined as: vp = axby-aybx.
vprod_sign
method descriptor
vprod_sign() -> int
@brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product
@return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative.
DeepShapeStore
@brief An opaque layout heap for the deep region processor
This class is used for keeping intermediate, hierarchical data for the deep region processor. It is used in conjunction with the region constructor to create a deep (hierarchical) region. @code layout = ... # a layout layer = ... # a layer cell = ... # a cell (initial cell for the deep region) dss = RBA::DeepShapeStore::new region = RBA::Region::new(cell.begin(layer), dss) @/code
The DeepShapeStore object also supplies some configuration options for the operations acting on the deep regions. See for example \threads=.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief An opaque layout heap for the deep region processor\n\nThis class is used for keeping intermediate, hierarchical data for the deep region processor. It is used in conjunction with the region constructor to create a deep (hierarchical) region.\n@code\nlayout = ... # a layout\nlayer = ... # a layer\ncell = ... # a cell (initial cell for the deep region)\ndss = RBA::DeepShapeStore::new\nregion = RBA::Region::new(cell.begin(layer), dss)\n@/code\n\nThe DeepShapeStore object also supplies some configuration options for the operations acting on the deep regions. See for example \\threads=.\n\nThis class has been introduced in version 0.26.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 43
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeepShapeStore' objects>
list of weak references to the object
max_area_ratio
class
max_area_ratio: float = <attribute 'max_area_ratio' of 'DeepShapeStore' objects>
@brief Gets the max. area ratio.
@brief Sets the max. area ratio for bounding box vs. polygon area
This parameter is used to simplify complex polygons. It is used by create_polygon_layer with the default parameters. It's also used by boolean operations when they deliver their output.
max_vertex_count
class
max_vertex_count: int = <attribute 'max_vertex_count' of 'DeepShapeStore' objects>
@brief Gets the maximum vertex count.
@brief Sets the maximum vertex count default value
This parameter is used to simplify complex polygons. It is used by create_polygon_layer with the default parameters. It's also used by boolean operations when they deliver their output.
reject_odd_polygons
class
reject_odd_polygons: bool = <attribute 'reject_odd_polygons' of 'DeepShapeStore' objects>
@brief Gets a flag indicating whether to reject odd polygons. This attribute has been introduced in version 0.27.
@brief Sets a flag indicating whether to reject odd polygons
Some kind of 'odd' (e.g. non-orientable) polygons may spoil the functionality because they cannot be handled properly. By using this flag, the shape store we reject these kind of polygons. The default is 'accept' (without warning).
This attribute has been introduced in version 0.27.
subcircuit_hierarchy_for_nets
class
subcircuit_hierarchy_for_nets: bool = <attribute 'subcircuit_hierarchy_for_nets' of 'DeepShapeStore' objects>
@brief Gets a value indicating whether to build a subcircuit hierarchy per net See \subcircuit_hierarchy_for_nets= for details.
This attribute has been introduced in version 0.28.4
@brief Sets a value indicating whether to build a subcircuit hierarchy per net
This flag is used to determine the way, net subcircuit hierarchies are built: when true, subcells are created for subcircuits on a net. Otherwise the net shapes are produced flat inside the cell they appear on.
This attribute has been introduced in version 0.28.4
text_enlargement
class
text_enlargement: int = <attribute 'text_enlargement' of 'DeepShapeStore' objects>
@brief Gets the text enlargement value.
@brief Sets the text enlargement value
If set to a non-negative value, text objects are converted to boxes with the given enlargement (width = 2 * enlargement). The box centers are identical to the original location of the text. If this value is negative (the default), texts are ignored.
text_property_name
class
text_property_name: Any = <attribute 'text_property_name' of 'DeepShapeStore' objects>
@brief Gets the text property name.
@brief Sets the text property name.
If set to a non-null variant, text strings are attached to the generated boxes as properties with this particular name. This option has an effect only if the text_enlargement property is not negative. By default, the name is empty.
threads
class
threads: int = <attribute 'threads' of 'DeepShapeStore' objects>
@brief Gets the number of threads.
@brief Sets the number of threads to allocate for the hierarchical processor
wants_all_cells
class
wants_all_cells: bool = <attribute 'wants_all_cells' of 'DeepShapeStore' objects>
@brief Gets a flag wether to copy the full hierarchy for the working layouts This attribute has been introduced in version 0.28.10.
@brief Sets a flag wether to copy the full hierarchy for the working layouts
The DeepShapeStore object keeps a copy of the original hierarchy internally for the working layouts. By default, this hierarchy is mapping only non-empty cells. While the operations proceed, more cells may need to be added. This conservative approach saves some memory, but the update operations may reduce overall performance. Setting this flag to 'true' switches to a mode where the full hierarchy is copied always. This will take more memory but may save CPU time.
This attribute has been introduced in version 0.28.10.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
add_breakout_cell
method descriptor
add_breakout_cell() -> None
@brief Adds a cell indexe to the breakout cell list for the given layout inside the store See \clear_breakout_cells for an explanation of breakout cells.
This method has been added in version 0.26.1
add_breakout_cells
method descriptor
add_breakout_cells(layout_index: int, cells: Sequence[int]) -> None
add_breakout_cells(layout_index: int, pattern: str) -> None
add_breakout_cells(pattern: str) -> None
add_breakout_cells()
@brief Adds cells (given by a cell name pattern) to the breakout cell list to all layouts inside the store See \clear_breakout_cells for an explanation of breakout cells.
This method has been added in version 0.26.1
clear_breakout_cells
method descriptor
clear_breakout_cells() -> None
clear_breakout_cells(layout_index: int) -> None
clear_breakout_cells()
@brief Clears the breakout cells See the other variant of \clear_breakout_cells for details.
This method has been added in version 0.26.1
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
instance_count
builtin
instance_count() -> int
@hide
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_singular
method descriptor
is_singular() -> bool
@brief Gets a value indicating whether there is a single layout variant
Specifically for network extraction, singular DSS objects are required. Multiple layouts may be present if different sources of layouts have been used. Such DSS objects are not usable for network extraction.
new
builtin
new() -> DeepShapeStore
@brief Creates a new object of this class
pop_state
method descriptor
pop_state() -> None
@brief Restores the store's state on the state state This will restore the state pushed by \push_state.
This method has been added in version 0.26.1
push_state
method descriptor
push_state() -> None
@brief Pushes the store's state on the state state This will save the stores state (\threads, \max_vertex_count, \max_area_ratio, breakout cells ...) on the state stack. \pop_state can be used to restore the state.
This method has been added in version 0.26.1
set_breakout_cells
method descriptor
set_breakout_cells(layout_index: int, cells: Sequence[int]) -> None
set_breakout_cells(layout_index: int, pattern: str) -> None
set_breakout_cells(pattern: str) -> None
set_breakout_cells()
@brief Sets the breakout cell list (as cell name pattern) for the all layouts inside the store See \clear_breakout_cells for an explanation of breakout cells.
This method has been added in version 0.26.1
Device
Bases: klayout.dbcore.NetlistObject
@brief A device inside a circuit. Device object represent atomic devices such as resistors, diodes or transistors. The \Device class represents a particular device with specific parameters. The type of device is represented by a \DeviceClass object. Device objects live in \Circuit objects, the device class objects live in the \Netlist object.
Devices connect to nets through terminals. Terminals are described by a terminal ID which is essentially the zero-based index of the terminal. Terminal definitions can be obtained from the device class using the \DeviceClass#terminal_definitions method.
Devices connect to nets through the \Device#connect_terminal method. Device terminals can be disconnected using \Device#disconnect_terminal.
Device objects are created inside a circuit with \Circuit#create_device.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A device inside a circuit.\nDevice object represent atomic devices such as resistors, diodes or transistors. The \\Device class represents a particular device with specific parameters. The type of device is represented by a \\DeviceClass object. Device objects live in \\Circuit objects, the device class objects live in the \\Netlist object.\n\nDevices connect to nets through terminals. Terminals are described by a terminal ID which is essentially the zero-based index of the terminal. Terminal definitions can be obtained from the device class using the \\DeviceClass#terminal_definitions method.\n\nDevices connect to nets through the \\Device#connect_terminal method. Device terminals can be disconnected using \\Device#disconnect_terminal.\n\nDevice objects are created inside a circuit with \\Circuit#create_device.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 89
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
device_abstract
class
device_abstract: DeviceAbstract = <attribute 'device_abstract' of 'Device' objects>
@brief Gets the device abstract for this device instance. See \DeviceAbstract for more details.
@hide Provided for test purposes mainly. Be careful with pointers!
name
class
name: str = <attribute 'name' of 'Device' objects>
@brief Gets the name of the device.
@brief Sets the name of the device. Device names are used to name a device inside a netlist file. Device names should be unique within a circuit.
trans
class
trans: DCplxTrans = <attribute 'trans' of 'Device' objects>
@brief Gets the location of the device. See \trans= for details about this method.
@brief Sets the location of the device. The device location is essentially describing the position of the device. The position is typically the center of some recognition shape. In this case the transformation is a plain displacement to the center of this shape.
add_combined_abstract
method descriptor
add_combined_abstract() -> None
@hide Provided for test purposes mainly.
add_reconnected_terminal_for
method descriptor
add_reconnected_terminal_for() -> None
@hide Provided for test purposes mainly.
circuit
method descriptor
circuit() -> Circuit
circuit() -> Circuit
circuit()
@brief Gets the circuit the device lives in (non-const version).
This constness variant has been introduced in version 0.26.8
clear_combined_abstracts
method descriptor
clear_combined_abstracts() -> None
@hide Provided for test purposes mainly.
clear_reconnected_terminals
method descriptor
clear_reconnected_terminals() -> None
@hide Provided for test purposes mainly.
connect_terminal
method descriptor
connect_terminal(terminal_id: int, net: Net) -> None
connect_terminal(terminal_name: str, net: Net) -> None
connect_terminal()
@brief Connects the given terminal to the specified net. This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised. If the terminal has been connected to a global net, it will be disconnected from there.
device_class
method descriptor
device_class() -> DeviceClass
@brief Gets the device class the device belongs to.
disconnect_terminal
method descriptor
disconnect_terminal(terminal_id: int) -> None
disconnect_terminal(terminal_name: str) -> None
disconnect_terminal()
@brief Disconnects the given terminal from any net. This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised.
each_combined_abstract
method descriptor
each_combined_abstract() -> Iterator[DeviceAbstractRef]
@brief Iterates over the combined device specifications. This feature applies to combined devices. This iterator will deliver all device abstracts present in addition to the default device abstract.
each_reconnected_terminal_for
method descriptor
each_reconnected_terminal_for() -> Iterator[DeviceReconnectedTerminal]
@brief Iterates over the reconnected terminal specifications for a given outer terminal. This feature applies to combined devices. This iterator will deliver all device-to-abstract terminal reroutings.
expanded_name
method descriptor
expanded_name() -> str
@brief Gets the expanded name of the device. The expanded name takes the name of the device. If the name is empty, the numeric ID will be used to build a name.
id
method descriptor
id() -> int
@brief Gets the device ID. The ID is a unique integer which identifies the device. It can be used to retrieve the device from the circuit using \Circuit#device_by_id. When assigned, the device ID is not 0.
is_combined_device
method descriptor
is_combined_device() -> bool
@brief Returns true, if the device is a combined device. Combined devices feature multiple device abstracts and device-to-abstract terminal connections. See \each_reconnected_terminal and \each_combined_abstract for more details.
net_for_terminal
method descriptor
net_for_terminal(terminal_id: int) -> Net
net_for_terminal(terminal_id: int) -> Net
net_for_terminal(terminal_name: str) -> Net
net_for_terminal(terminal_name: str) -> Net
net_for_terminal()
@brief Gets the net connected to the specified terminal (non-const version). If the terminal is not connected, nil is returned for the net.
This convenience method has been introduced in version 0.27.3.
parameter
method descriptor
parameter(param_id: int) -> float
parameter(param_name: str) -> float
parameter()
@brief Gets the parameter value for the given parameter name. If the parameter name is not valid, an exception is thrown.
set_parameter
method descriptor
set_parameter(param_id: int, value: float) -> None
set_parameter(param_name: str, value: float) -> None
set_parameter()
@brief Sets the parameter value for the given parameter name. If the parameter name is not valid, an exception is thrown.
DeviceAbstract
@brief A geometrical device abstract This class represents the geometrical model for the device. It links into the extracted layout to a cell which holds the terminal shapes for the device.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A geometrical device abstract\nThis class represents the geometrical model for the device. It links into the extracted layout to a cell which holds the terminal shapes for the device.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 90
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceAbstract' objects>
list of weak references to the object
name
class
name: str = <attribute 'name' of 'DeviceAbstract' objects>
@brief Gets the name of the device abstract.
@brief Sets the name of the device abstract. Device names are used to name a device abstract inside a netlist file. Device names should be unique within a netlist.
__copy__
method descriptor
__copy__() -> DeviceAbstract
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceAbstract
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cell_index
method descriptor
cell_index() -> int
@brief Gets the cell index of the device abstract. This is the cell that represents the device.
cluster_id_for_terminal
method descriptor
cluster_id_for_terminal() -> int
@brief Gets the cluster ID for the given terminal. The cluster ID links the terminal to geometrical shapes within the clusters of the cell (see \cell_index)
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
device_class
method descriptor
device_class() -> DeviceClass
@brief Gets the device class of the device.
dup
method descriptor
dup() -> DeviceAbstract
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
netlist
method descriptor
netlist() -> Netlist
netlist() -> Netlist
netlist()
@brief Gets the netlist the device abstract lives in (non-const version).
This constness variant has been introduced in version 0.26.8
new
builtin
new() -> DeviceAbstract
@brief Creates a new object of this class
DeviceAbstractRef
@brief Describes an additional device abstract reference for combined devices. Combined devices are implemented as a generalization of the device abstract concept in \Device. For combined devices, multiple \DeviceAbstract references are present. This class describes such an additional reference. A reference is a pointer to an abstract plus a transformation by which the abstract is transformed geometrically as compared to the first (initial) abstract.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Describes an additional device abstract reference for combined devices.\nCombined devices are implemented as a generalization of the device abstract concept in \\Device. For combined devices, multiple \\DeviceAbstract references are present. This class describes such an additional reference. A reference is a pointer to an abstract plus a transformation by which the abstract is transformed geometrically as compared to the first (initial) abstract.\n\nThis class has been introduced in version 0.26.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 88
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceAbstractRef' objects>
list of weak references to the object
device_abstract
class
device_abstract: DeviceAbstract = <attribute 'device_abstract' of 'DeviceAbstractRef' objects>
@brief The getter for the device abstract reference. See the class description for details.
@brief The setter for the device abstract reference. See the class description for details.
trans
class
trans: DCplxTrans = <attribute 'trans' of 'DeviceAbstractRef' objects>
@brief The getter for the relative transformation of the instance. See the class description for details.
@brief The setter for the relative transformation of the instance. See the class description for details.
__copy__
method descriptor
__copy__() -> DeviceAbstractRef
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceAbstractRef
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DeviceAbstractRef
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DeviceAbstractRef
@brief Creates a new object of this class
DeviceClass
@brief A class describing a specific type of device. Device class objects live in the context of a \Netlist object. After a device class is created, it must be added to the netlist using \Netlist#add. The netlist will own the device class object. When the netlist is destroyed, the device class object will become invalid.
The \DeviceClass class is the base class for other device classes.
This class has been added in version 0.26. In version 0.27.3, the 'GenericDeviceClass' has been integrated with \DeviceClass and the device class was made writeable in most respects. This enables manipulating built-in device classes.
__doc__
class
__doc__ = "@brief A class describing a specific type of device.\nDevice class objects live in the context of a \\Netlist object. After a device class is created, it must be added to the netlist using \\Netlist#add. The netlist will own the device class object. When the netlist is destroyed, the device class object will become invalid.\n\nThe \\DeviceClass class is the base class for other device classes.\n\nThis class has been added in version 0.26. In version 0.27.3, the 'GenericDeviceClass' has been integrated with \\DeviceClass and the device class was made writeable in most respects. This enables manipulating built-in device classes."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 101
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceClass' objects>
list of weak references to the object
combiner
class
combiner: GenericDeviceCombiner = <attribute 'combiner' of 'DeviceClass' objects>
@brief Gets a device combiner or nil if none is registered.
This method has been added in version 0.27.3.
@brief Specifies a device combiner (parallel or serial device combination).
You can assign nil for the combiner to remove it.
In special cases, you can even implement a custom combiner by deriving your own comparer from the \GenericDeviceCombiner class.
This method has been added in version 0.27.3.
description
class
description: str = <attribute 'description' of 'DeviceClass' objects>
@brief Gets the description text of the device class.
@brief Sets the description of the device class.
equal_parameters
class
equal_parameters: EqualDeviceParameters = <attribute 'equal_parameters' of 'DeviceClass' objects>
@brief Gets the device parameter comparer for netlist verification or nil if no comparer is registered. See \equal_parameters= for the setter.
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
@brief Specifies a device parameter comparer for netlist verification. By default, all devices are compared with all parameters. If you want to select only certain parameters for comparison or use a fuzzy compare criterion, use an \EqualDeviceParameters object and assign it to the device class of one netlist. You can also chain multiple \EqualDeviceParameters objects with the '+' operator for specifying multiple parameters in the equality check.
You can assign nil for the parameter comparer to remove it.
In special cases, you can even implement a custom compare scheme by deriving your own comparer from the \GenericDeviceParameterCompare class.
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
name
class
name: str = <attribute 'name' of 'DeviceClass' objects>
@brief Gets the name of the device class.
@brief Sets the name of the device class.
strict
class
strict: bool = <attribute 'strict' of 'DeviceClass' objects>
@brief Gets a value indicating whether this class performs strict terminal mapping See \strict= for details about this attribute.
@brief Sets a value indicating whether this class performs strict terminal mapping
Classes with this flag set never allow terminal swapping, even if the device symmetry supports that. If two classes are involved in a netlist compare, terminal swapping will be disabled if one of the classes is in strict mode.
By default, device classes are not strict and terminal swapping is allowed as far as the device symmetry supports that.
supports_parallel_combination
class
supports_parallel_combination: None = <attribute 'supports_parallel_combination' of 'DeviceClass' objects>
@brief Specifies whether the device supports parallel device combination. Parallel device combination means that all terminals of two combination candidates are connected to the same nets. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in parallel mode and improve performance somewhat.
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
supports_serial_combination
class
supports_serial_combination: None = <attribute 'supports_serial_combination' of 'DeviceClass' objects>
@brief Specifies whether the device supports serial device combination. Serial device combination means that the devices are connected by internal nodes. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in serial mode and improve performance somewhat.
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
__copy__
method descriptor
__copy__() -> DeviceClass
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceClass
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
add_parameter
method descriptor
add_parameter() -> None
@brief Adds the given parameter definition to the device class This method will define a new parameter. The new parameter is added at the end of existing parameters. The parameter definition object passed as the argument is modified to contain the new ID of the parameter. The parameter is copied into the device class. Modifying the parameter object later does not have the effect of changing the parameter definition.
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
add_terminal
method descriptor
add_terminal() -> None
@brief Adds the given terminal definition to the device class This method will define a new terminal. The new terminal is added at the end of existing terminals. The terminal definition object passed as the argument is modified to contain the new ID of the terminal.
The terminal is copied into the device class. Modifying the terminal object later does not have the effect of changing the terminal definition.
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear_equivalent_terminal_ids
method descriptor
clear_equivalent_terminal_ids() -> None
@brief Clears all equivalent terminal ids
This method has been added in version 0.27.3.
clear_parameters
method descriptor
clear_parameters() -> None
@brief Clears the list of parameters
This method has been added in version 0.27.3.
clear_terminals
method descriptor
clear_terminals() -> None
@brief Clears the list of terminals
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DeviceClass
@brief Creates a copy of self
enable_parameter
method descriptor
enable_parameter(parameter_id: int, enable: bool) -> None
enable_parameter(parameter_name: str, enable: bool) -> None
enable_parameter()
@brief Enables or disables a parameter. Some parameters are 'secondary' parameters which are extracted but not handled in device compare and are not shown in the netlist browser. For example, the 'W' parameter of the resistor is such a secondary parameter. This method allows turning a parameter in a primary one ('enable') or into a secondary one ('disable').
This version accepts a parameter name.
This method has been introduced in version 0.27.3.
equivalent_terminal_id
method descriptor
equivalent_terminal_id() -> None
@brief Specifies a terminal to be equivalent to another. Use this method to specify two terminals to be exchangeable. For example to make S and D of a MOS transistor equivalent, call this method with S and D terminal IDs. In netlist matching, S will be translated to D and thus made equivalent to D.
Note that terminal equivalence is not effective if the device class operates in strict mode (see \DeviceClass#strict=).
This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3.
has_parameter
method descriptor
has_parameter() -> bool
@brief Returns true, if the device class has a parameter with the given name.
has_terminal
method descriptor
has_terminal() -> bool
@brief Returns true, if the device class has a terminal with the given name.
id
method descriptor
id() -> int
@brief Gets the unique ID of the device class The ID is a unique integer that identifies the device class. Use the ID to check for object identity - i.e. to determine whether two devices share the same device class.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
netlist
method descriptor
netlist() -> Netlist
@brief Gets the netlist the device class lives in.
new
builtin
new() -> DeviceClass
@brief Creates a new object of this class
parameter_definition
method descriptor
parameter_definition(parameter_id: int) -> DeviceParameterDefinition
parameter_definition(parameter_name: str) -> DeviceParameterDefinition
parameter_definition()
@brief Gets the parameter definition object for a given ID. Parameter definition IDs are used in some places to reference a specific parameter of a device. This method obtains the corresponding definition object. This version accepts a parameter name.
This method has been introduced in version 0.27.3.
parameter_definitions
method descriptor
parameter_definitions() -> List[DeviceParameterDefinition]
@brief Gets the list of parameter definitions of the device. See the \DeviceParameterDefinition class description for details.
parameter_id
method descriptor
parameter_id() -> int
@brief Returns the parameter ID of the parameter with the given name. An exception is thrown if there is no parameter with the given name. Use \has_parameter to check whether the name is a valid parameter name.
terminal_definition
method descriptor
terminal_definition() -> DeviceTerminalDefinition
@brief Gets the terminal definition object for a given ID. Terminal definition IDs are used in some places to reference a specific terminal of a device. This method obtains the corresponding definition object.
terminal_definitions
method descriptor
terminal_definitions() -> List[DeviceTerminalDefinition]
@brief Gets the list of terminal definitions of the device. See the \DeviceTerminalDefinition class description for details.
terminal_id
method descriptor
terminal_id() -> int
@brief Returns the terminal ID of the terminal with the given name. An exception is thrown if there is no terminal with the given name. Use \has_terminal to check whether the name is a valid terminal name.
DeviceClassBJT3Transistor
Bases: klayout.dbcore.DeviceClass
@brief A device class for a bipolar transistor. This class describes a bipolar transistor. Bipolar transistors have tree terminals: the collector (C), the base (B) and the emitter (E). Multi-emitter transistors are resolved in individual devices. The parameters are AE, AB and AC for the emitter, base and collector areas in square micrometers and PE, PB and PC for the emitter, base and collector perimeters in micrometers. In addition, the emitter count (NE) is given. The emitter count is 1 always for a transistor extracted initially. Upon combination of devices, the emitter counts are added, thus forming multi-emitter devices.
This class has been introduced in version 0.26.
PARAM_AB
class
PARAM_AB: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_AC
class
PARAM_AC: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_AE
class
PARAM_AE: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_NE
class
PARAM_NE: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_PB
class
PARAM_PB: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_PC
class
PARAM_PC: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_PE
class
PARAM_PE: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_B
class
TERMINAL_B: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_C
class
TERMINAL_C: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_E
class
TERMINAL_E: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A device class for a bipolar transistor.\nThis class describes a bipolar transistor. Bipolar transistors have tree terminals: the collector (C), the base (B) and the emitter (E).\nMulti-emitter transistors are resolved in individual devices.\nThe parameters are AE, AB and AC for the emitter, base and collector areas in square micrometers and PE, PB and PC for the emitter, base and collector perimeters in micrometers.\nIn addition, the emitter count (NE) is given. The emitter count is 1 always for a transistor extracted initially. Upon combination of devices, the emitter counts are added, thus forming multi-emitter devices.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 131
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassBJT4Transistor
Bases: klayout.dbcore.DeviceClassBJT3Transistor
@brief A device class for a 4-terminal bipolar transistor. This class describes a bipolar transistor with a substrate terminal. A device class for a bipolar transistor without a substrate terminal is \DeviceClassBJT3Transistor. The additional terminal is 'S' for the substrate terminal. BJT4 transistors combine in parallel if both substrate terminals are connected to the same net.
This class has been introduced in version 0.26.
TERMINAL_S
class
TERMINAL_S: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for a 4-terminal bipolar transistor.\nThis class describes a bipolar transistor with a substrate terminal. A device class for a bipolar transistor without a substrate terminal is \\DeviceClassBJT3Transistor. \nThe additional terminal is 'S' for the substrate terminal.\nBJT4 transistors combine in parallel if both substrate terminals are connected to the same net.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 132
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassCapacitor
Bases: klayout.dbcore.DeviceClass
@brief A device class for a capacitor. This describes a capacitor. Capacitors are defined by their combination behavior and the basic parameter 'C' which is the capacitance in Farad.
A capacitor has two terminals, A and B. The parameters of a capacitor are C (the value in Farad) and A and P (area and perimeter in square micrometers and micrometers respectively).
This class has been introduced in version 0.26.
PARAM_A
class
PARAM_A: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_C
class
PARAM_C: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_P
class
PARAM_P: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_A
class
TERMINAL_A: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_B
class
TERMINAL_B: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for a capacitor.\nThis describes a capacitor. Capacitors are defined by their combination behavior and the basic parameter 'C' which is the capacitance in Farad.\n\nA capacitor has two terminals, A and B.\nThe parameters of a capacitor are C (the value in Farad) and A and P (area and perimeter in square micrometers and micrometers respectively).\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 127
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassCapacitorWithBulk
Bases: klayout.dbcore.DeviceClassCapacitor
@brief A device class for a capacitor with a bulk terminal (substrate, well). This class is similar to \DeviceClassCapacitor, but provides an additional terminal (BULK) for the well or substrate the capacitor is embedded in.
The additional terminal is 'W' for the well/substrate terminal.
This class has been introduced in version 0.26.
TERMINAL_W
class
TERMINAL_W: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for a capacitor with a bulk terminal (substrate, well).\nThis class is similar to \\DeviceClassCapacitor, but provides an additional terminal (BULK) for the well or substrate the capacitor is embedded in.\n\nThe additional terminal is 'W' for the well/substrate terminal.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 128
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassDiode
Bases: klayout.dbcore.DeviceClass
@brief A device class for a diode. This class describes a diode. A diode has two terminals, A (anode) and C (cathode). It has two parameters: The diode area in square micrometers (A) and the diode area perimeter in micrometers (P).
Diodes only combine when parallel and in the same direction. In this case, their areas and perimeters are added. This class has been introduced in version 0.26.
PARAM_A
class
PARAM_A: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_P
class
PARAM_P: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_A
class
TERMINAL_A: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_C
class
TERMINAL_C: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A device class for a diode.\nThis class describes a diode.\nA diode has two terminals, A (anode) and C (cathode).\nIt has two parameters: The diode area in square micrometers (A) and the diode area perimeter in micrometers (P).\n\nDiodes only combine when parallel and in the same direction. In this case, their areas and perimeters are added.\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 130
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassFactory
@brief A factory for creating specific device classes for the standard device extractors Use a reimplementation of this class to provide a device class generator for built-in device extractors such as \DeviceExtractorMOS3Transistor. The constructor of this extractor has a 'factory' parameter which takes an object of \DeviceClassFactory type.
If such an object is provided, this factory is used to create the actual device class. The following code shows an example:
@code class MyClass < RBA::DeviceClassMOS3Transistor ... overrides some methods ... end
class MyFactory < RBA::DeviceClassFactory def create_class MyClass.new end end
extractor = RBA::DeviceExtractorMOS3Transistor::new("NMOS", false, MyFactory.new) @/code
When using a factory with a device extractor, make sure it creates a corresponding device class, e.g. for the \DeviceExtractorMOS3Transistor extractor create a device class derived from \DeviceClassMOS3Transistor.
This class has been introduced in version 0.27.3.
__doc__
class
__doc__ = '@brief A factory for creating specific device classes for the standard device extractors\nUse a reimplementation of this class to provide a device class generator for built-in device extractors such as \\DeviceExtractorMOS3Transistor. The constructor of this extractor has a \'factory\' parameter which takes an object of \\DeviceClassFactory type.\n\nIf such an object is provided, this factory is used to create the actual device class. The following code shows an example:\n\n@code\nclass MyClass < RBA::DeviceClassMOS3Transistor\n ... overrides some methods ...\nend\n\nclass MyFactory < RBA::DeviceClassFactory\n def create_class\n MyClass.new\n end\nend\n\nextractor = RBA::DeviceExtractorMOS3Transistor::new("NMOS", false, MyFactory.new)\n@/code\n\nWhen using a factory with a device extractor, make sure it creates a corresponding device class, e.g. for the \\DeviceExtractorMOS3Transistor extractor create a device class derived from \\DeviceClassMOS3Transistor.\n\nThis class has been introduced in version 0.27.3.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 135
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceClassFactory' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> DeviceClassFactory
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceClassFactory
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DeviceClassFactory
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DeviceClassFactory
@brief Creates a new object of this class
DeviceClassInductor
Bases: klayout.dbcore.DeviceClass
@brief A device class for an inductor. This class describes an inductor. Inductors are defined by their combination behavior and the basic parameter 'L' which is the inductance in Henry.
An inductor has two terminals, A and B.
This class has been introduced in version 0.26.
PARAM_L
class
PARAM_L: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_A
class
TERMINAL_A: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_B
class
TERMINAL_B: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for an inductor.\nThis class describes an inductor. Inductors are defined by their combination behavior and the basic parameter 'L' which is the inductance in Henry.\n\nAn inductor has two terminals, A and B.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 129
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassMOS3Transistor
Bases: klayout.dbcore.DeviceClass
@brief A device class for a 3-terminal MOS transistor. This class describes a MOS transistor without a bulk terminal. A device class for a MOS transistor with a bulk terminal is \DeviceClassMOS4Transistor. MOS transistors are defined by their combination behavior and the basic parameters.
The parameters are L, W, AS, AD, PS and PD for the gate length and width in micrometers, source and drain area in square micrometers and the source and drain perimeter in micrometers.
The terminals are S, G and D for source, gate and drain.
MOS transistors combine in parallel mode, when both gate lengths are identical and their gates are connected (source and drain can be swapped). In this case, their widths and source and drain areas are added.
This class has been introduced in version 0.26.
PARAM_AD
class
PARAM_AD: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_AS
class
PARAM_AS: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_L
class
PARAM_L: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_PD
class
PARAM_PD: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_PS
class
PARAM_PS: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_W
class
PARAM_W: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_D
class
TERMINAL_D: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_G
class
TERMINAL_G: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_S
class
TERMINAL_S: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A device class for a 3-terminal MOS transistor.\nThis class describes a MOS transistor without a bulk terminal. A device class for a MOS transistor with a bulk terminal is \\DeviceClassMOS4Transistor. MOS transistors are defined by their combination behavior and the basic parameters.\n\nThe parameters are L, W, AS, AD, PS and PD for the gate length and width in micrometers, source and drain area in square micrometers and the source and drain perimeter in micrometers.\n\nThe terminals are S, G and D for source, gate and drain.\n\nMOS transistors combine in parallel mode, when both gate lengths are identical and their gates are connected (source and drain can be swapped). In this case, their widths and source and drain areas are added.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 133
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
join_split_gates
method descriptor
join_split_gates() -> None
@brief Joins source/drain nets from 'split gate' transistor strings on the given circuit This method has been introduced in version 0.27.9
DeviceClassMOS4Transistor
Bases: klayout.dbcore.DeviceClassMOS3Transistor
@brief A device class for a 4-terminal MOS transistor. This class describes a MOS transistor with a bulk terminal. A device class for a MOS transistor without a bulk terminal is \DeviceClassMOS3Transistor. MOS transistors are defined by their combination behavior and the basic parameters.
The additional terminal is 'B' for the bulk terminal. MOS4 transistors combine in parallel if both bulk terminals are connected to the same net.
This class has been introduced in version 0.26.
TERMINAL_B
class
TERMINAL_B: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for a 4-terminal MOS transistor.\nThis class describes a MOS transistor with a bulk terminal. A device class for a MOS transistor without a bulk terminal is \\DeviceClassMOS3Transistor. MOS transistors are defined by their combination behavior and the basic parameters.\n\nThe additional terminal is 'B' for the bulk terminal.\nMOS4 transistors combine in parallel if both bulk terminals are connected to the same net.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 134
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassResistor
Bases: klayout.dbcore.DeviceClass
@brief A device class for a resistor. This class describes a resistor. Resistors are defined by their combination behavior and the basic parameter 'R' which is the resistance in Ohm.
A resistor has two terminals, A and B. The parameters of a resistor are R (the value in Ohms), L and W (length and width in micrometers) and A and P (area and perimeter in square micrometers and micrometers respectively).
This class has been introduced in version 0.26.
PARAM_A
class
PARAM_A: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_L
class
PARAM_L: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_P
class
PARAM_P: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_R
class
PARAM_R: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PARAM_W
class
PARAM_W: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_A
class
TERMINAL_A: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TERMINAL_B
class
TERMINAL_B: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for a resistor.\nThis class describes a resistor. Resistors are defined by their combination behavior and the basic parameter 'R' which is the resistance in Ohm.\n\nA resistor has two terminals, A and B.\nThe parameters of a resistor are R (the value in Ohms), L and W (length and width in micrometers) and A and P (area and perimeter in square micrometers and micrometers respectively).\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 125
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceClassResistorWithBulk
Bases: klayout.dbcore.DeviceClassResistor
@brief A device class for a resistor with a bulk terminal (substrate, well). This class is similar to \DeviceClassResistor, but provides an additional terminal (BULK) for the well or substrate the resistor is embedded in.
The additional terminal is 'W' for the well/substrate terminal.
This class has been introduced in version 0.26.
TERMINAL_W
class
TERMINAL_W: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief A device class for a resistor with a bulk terminal (substrate, well).\nThis class is similar to \\DeviceClassResistor, but provides an additional terminal (BULK) for the well or substrate the resistor is embedded in.\n\nThe additional terminal is 'W' for the well/substrate terminal.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 126
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
DeviceExtractorBJT3Transistor
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a bipolar transistor (BJT)
This class supplies the generic extractor for a bipolar transistor device.
Extraction of vertical and lateral transistors is supported through a generic geometry model: The basic area is the base area. A marker shape must be provided for this area. The emitter of the transistor is defined by emitter layer shapes inside the base area. Multiple emitter shapes can be present. In this case, multiple transistor devices sharing the same base and collector are generated. Finally, a collector layer can be given. If non-empty, the parts inside the base region will define the collector terminals. If empty, the collector is formed by the substrate. In this case, the base region will be output to the 'tC' terminal output layer. This layer then needs to be connected to a global net to form the net connection.
The device class produced by this extractor is \DeviceClassBJT3Transistor. The extractor delivers these parameters:
@ul @li 'AE', 'AB' and 'AC' - the emitter, base and collector areas in square micrometer units @/li @li 'PE', 'PB' and 'PC' - the emitter, base and collector perimeters in micrometer units @/li @li 'NE' - emitter count (initially 1 but increases when devices are combined) @/li @/ul
The device layer names are:
@ul @li 'E' - emitter. @/li @li 'B' - base. @/li @li 'C' - collector. @/li @/ul
The terminals are output on these layers: @ul @li 'tE' - emitter. Default output is 'E'. @/li @li 'tB' - base. Default output is 'B'. @/li @li 'tC' - collector. Default output is 'C'. @/li @/ul
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a bipolar transistor (BJT)\n\nThis class supplies the generic extractor for a bipolar transistor device.\n\nExtraction of vertical and lateral transistors is supported through a generic geometry model: The basic area is the base area. A marker shape must be provided for this area. The emitter of the transistor is defined by emitter layer shapes inside the base area. Multiple emitter shapes can be present. In this case, multiple transistor devices sharing the same base and collector are generated.\nFinally, a collector layer can be given. If non-empty, the parts inside the base region will define the collector terminals. If empty, the collector is formed by the substrate. In this case, the base region will be output to the 'tC' terminal output layer. This layer then needs to be connected to a global net to form the net connection.\n\nThe device class produced by this extractor is \\DeviceClassBJT3Transistor.\nThe extractor delivers these parameters:\n\n@ul\n@li 'AE', 'AB' and 'AC' - the emitter, base and collector areas in square micrometer units @/li\n@li 'PE', 'PB' and 'PC' - the emitter, base and collector perimeters in micrometer units @/li\n@li 'NE' - emitter count (initially 1 but increases when devices are combined) @/li\n@/ul\n\nThe device layer names are:\n\n@ul\n@li 'E' - emitter. @/li\n@li 'B' - base. @/li\n@li 'C' - collector. @/li\n@/ul\n\nThe terminals are output on these layers:\n@ul\n@li 'tE' - emitter. Default output is 'E'. @/li\n@li 'tB' - base. Default output is 'B'. @/li\n@li 'tC' - collector. Default output is 'C'. @/li\n@/ul\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 145
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorBJT3Transistor
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorBJT4Transistor
Bases: klayout.dbcore.DeviceExtractorBJT3Transistor
@brief A device extractor for a four-terminal bipolar transistor (BJT)
This class supplies the generic extractor for a bipolar transistor device. It is based on the \DeviceExtractorBJT3Transistor class with the extension of a substrate terminal and corresponding substrate terminal output (annotation) layer.
Two new layers are introduced:
@ul @li 'S' - the bulk (substrate) layer. Currently this layer is ignored and can be empty. @/li@li 'tS' - the bulk terminal output layer (defaults to 'S'). @/li@/ul
The bulk terminal layer ('tS') can be an empty layer representing the wafer substrate. In this use mode the substrate terminal shapes will be produced on the 'tS' layer. This layer then needs to be connected to a global net to establish the net connection.
The device class produced by this extractor is \DeviceClassBJT4Transistor. The This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a four-terminal bipolar transistor (BJT)\n\nThis class supplies the generic extractor for a bipolar transistor device.\nIt is based on the \\DeviceExtractorBJT3Transistor class with the extension of a substrate terminal and corresponding substrate terminal output (annotation) layer.\n\nTwo new layers are introduced:\n\n@ul\n@li 'S' - the bulk (substrate) layer. Currently this layer is ignored and can be empty. @/li@li 'tS' - the bulk terminal output layer (defaults to 'S'). @/li@/ul\n\nThe bulk terminal layer ('tS') can be an empty layer representing the wafer substrate.\nIn this use mode the substrate terminal shapes will be produced on the 'tS' layer. This\nlayer then needs to be connected to a global net to establish the net connection.\n\nThe device class produced by this extractor is \\DeviceClassBJT4Transistor.\nThe This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 146
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorBJT4Transistor
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorBase
@brief The base class for all device extractors. This is an abstract base class for device extractors. See \GenericDeviceExtractor for a generic class which you can reimplement to supply your own customized device extractor. In many cases using one of the preconfigured specific device extractors may be useful already and it's not required to implement a custom one. For an example about a preconfigured device extractor see \DeviceExtractorMOS3Transistor.
This class cannot and should not be instantiated explicitly. Use one of the subclasses instead.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief The base class for all device extractors.\nThis is an abstract base class for device extractors. See \\GenericDeviceExtractor for a generic class which you can reimplement to supply your own customized device extractor. In many cases using one of the preconfigured specific device extractors may be useful already and it's not required to implement a custom one. For an example about a preconfigured device extractor see \\DeviceExtractorMOS3Transistor.\n\nThis class cannot and should not be instantiated explicitly. Use one of the subclasses instead.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 137
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceExtractorBase' objects>
list of weak references to the object
name
class
name: str = <attribute 'name' of 'DeviceExtractorBase' objects>
@brief Gets the name of the device extractor and the device class.
@brief Sets the name of the device extractor and the device class.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
device_class
method descriptor
device_class() -> DeviceClass
@brief Gets the device class used during extraction The attribute will hold the actual device class used in the device extraction. It is valid only after 'extract_devices'.
This method has been added in version 0.27.3.
each_error
method descriptor
each_error() -> Iterator[LogEntryData]
@brief Iterates over all log entries collected in the device extractor.Starting with version 0.28.13, the preferred name of the method is 'each_log_entry' as log entries have been generalized to become warnings too.
each_layer_definition
method descriptor
each_layer_definition() -> Iterator[NetlistDeviceExtractorLayerDefinition]
@brief Iterates over all layer definitions.
each_log_entry
method descriptor
each_log_entry() -> Iterator[LogEntryData]
@brief Iterates over all log entries collected in the device extractor.Starting with version 0.28.13, the preferred name of the method is 'each_log_entry' as log entries have been generalized to become warnings too.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DeviceExtractorBase
@brief Creates a new object of this class
test_initialize
method descriptor
test_initialize() -> None
@hide
DeviceExtractorCapacitor
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a two-terminal capacitor
This class supplies the generic extractor for a capacitor device. The device is defined by two geometry layers forming the 'plates' of the capacitor. The capacitance is computed from the overlapping area of the plates using 'C = A * area_cap' (area_cap is the capacitance per square micrometer area).
Although 'area_cap' can be given in any unit, Farad should be preferred as this is the convention used for output into a netlist.
The device class produced by this extractor is \DeviceClassCapacitor. The extractor produces three parameters:
@ul @li 'C' - the capacitance @/li @li 'A' - the capacitor's area in square micrometer units @/li @li 'P' - the capacitor's perimeter in micrometer units @/li @/ul
The device layer names are:
@ul @li 'P1', 'P2' - the two plates. @/li @/ul
The terminals are output on these layers: @ul @li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li @/ul
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a two-terminal capacitor\n\nThis class supplies the generic extractor for a capacitor device.\nThe device is defined by two geometry layers forming the 'plates' of the capacitor.\nThe capacitance is computed from the overlapping area of the plates using 'C = A * area_cap' (area_cap is the capacitance per square micrometer area).\n\nAlthough 'area_cap' can be given in any unit, Farad should be preferred as this is the convention used for output into a netlist.\n\nThe device class produced by this extractor is \\DeviceClassCapacitor.\nThe extractor produces three parameters:\n\n@ul\n@li 'C' - the capacitance @/li\n@li 'A' - the capacitor's area in square micrometer units @/li\n@li 'P' - the capacitor's perimeter in micrometer units @/li\n@/ul\n\nThe device layer names are:\n\n@ul\n@li 'P1', 'P2' - the two plates. @/li\n@/ul\n\nThe terminals are output on these layers:\n@ul\n@li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li\n@/ul\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 143
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorCapacitor
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorCapacitorWithBulk
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a capacitor with a bulk terminal
This class supplies the generic extractor for a capacitor device including a bulk terminal. The device is defined the same way than devices are defined for \DeviceExtractorCapacitor.
The device class produced by this extractor is \DeviceClassCapacitorWithBulk. The extractor produces three parameters:
@ul @li 'C' - the capacitance @/li @li 'A' - the capacitor's area in square micrometer units @/li @li 'P' - the capacitor's perimeter in micrometer units @/li @/ul
The device layer names are:
@ul @li 'P1', 'P2' - the two plates. @/li @li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li @/ul
The terminals are output on these layers: @ul @li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li @li 'tW' - the bulk terminal (copy of the resistor area). @/li @/ul
The bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally.
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a capacitor with a bulk terminal\n\nThis class supplies the generic extractor for a capacitor device including a bulk terminal.\nThe device is defined the same way than devices are defined for \\DeviceExtractorCapacitor.\n\nThe device class produced by this extractor is \\DeviceClassCapacitorWithBulk.\nThe extractor produces three parameters:\n\n@ul\n@li 'C' - the capacitance @/li\n@li 'A' - the capacitor's area in square micrometer units @/li\n@li 'P' - the capacitor's perimeter in micrometer units @/li\n@/ul\n\nThe device layer names are:\n\n@ul\n@li 'P1', 'P2' - the two plates. @/li\n@li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li\n@/ul\n\nThe terminals are output on these layers:\n@ul\n@li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li\n@li 'tW' - the bulk terminal (copy of the resistor area). @/li\n@/ul\n\nThe bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally.\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 144
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorCapacitorWithBulk
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorDiode
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a planar diode
This class supplies the generic extractor for a planar diode. The diode is defined by two layers whose overlap area forms the diode. The p-type layer forms the anode, the n-type layer the cathode.
The device class produced by this extractor is \DeviceClassDiode. The extractor extracts the two parameters of this class:
@ul @li 'A' - the diode area in square micrometer units. @/li @li 'P' - the diode perimeter in micrometer units. @/li @/ul
The device layers are:
@ul @li 'P' - the p doped area. @/li @li 'N' - the n doped area. @/li @/ul
The diode region is defined by the overlap of p and n regions.
The terminal output layers are:
@ul @li 'tA' - anode. Defaults to 'P'. @/li @li 'tC' - cathode. Defaults to 'N'. @/li @/ul
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a planar diode\n\nThis class supplies the generic extractor for a planar diode.\nThe diode is defined by two layers whose overlap area forms\nthe diode. The p-type layer forms the anode, the n-type layer\nthe cathode.\n\nThe device class produced by this extractor is \\DeviceClassDiode.\nThe extractor extracts the two parameters of this class:\n\n@ul\n@li 'A' - the diode area in square micrometer units. @/li\n@li 'P' - the diode perimeter in micrometer units. @/li\n@/ul\n\nThe device layers are:\n\n@ul\n@li 'P' - the p doped area. @/li\n@li 'N' - the n doped area. @/li\n@/ul\n\nThe diode region is defined by the overlap of p and n regions.\n\nThe terminal output layers are:\n\n@ul\n@li 'tA' - anode. Defaults to 'P'. @/li\n@li 'tC' - cathode. Defaults to 'N'. @/li\n@/ul\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 147
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorDiode
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorMOS3Transistor
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a three-terminal MOS transistor
This class supplies the generic extractor for a MOS device. The device is defined by two basic input layers: the diffusion area (source and drain) and the gate area. It requires a third layer (poly) to put the gate terminals on. The separation between poly and allows separating the device recognition layer (gate) from the conductive layer.
The device class produced by this extractor is \DeviceClassMOS3Transistor.
The extractor delivers six parameters:
@ul @li 'L' - the gate length in micrometer units @/li @li 'W' - the gate width in micrometer units @/li @li 'AS' and 'AD' - the source and drain region areas in square micrometers @/li @li 'PS' and 'PD' - the source and drain region perimeters in micrometer units @/li @/ul
The device layer names are:
@ul @li In strict mode: 'S' (source), 'D' (drain) and 'G' (gate). @/li @li In non-strict mode: 'SD' (source and drain) and 'G' (gate). @/li @/ul
The terminals are output on these layers: @ul @li 'tS' - source. Default output is 'S' (strict mode) or 'SD' (otherwise). @/li @li 'tD' - drain. Default output is 'D' (strict mode) or 'SD' (otherwise). @/li @li 'tG' - gate. Default output is 'G'. @/li @/ul
The source/drain (diffusion) area is distributed on the number of gates connecting to the particular source or drain area.
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a three-terminal MOS transistor\n\nThis class supplies the generic extractor for a MOS device.\nThe device is defined by two basic input layers: the diffusion area\n(source and drain) and the gate area. It requires a third layer\n(poly) to put the gate terminals on. The separation between poly\nand allows separating the device recognition layer (gate) from the\nconductive layer.\n\nThe device class produced by this extractor is \\DeviceClassMOS3Transistor.\n\nThe extractor delivers six parameters:\n\n@ul\n@li 'L' - the gate length in micrometer units @/li\n@li 'W' - the gate width in micrometer units @/li\n@li 'AS' and 'AD' - the source and drain region areas in square micrometers @/li\n@li 'PS' and 'PD' - the source and drain region perimeters in micrometer units @/li\n@/ul\n\nThe device layer names are:\n\n@ul\n@li In strict mode: 'S' (source), 'D' (drain) and 'G' (gate). @/li\n@li In non-strict mode: 'SD' (source and drain) and 'G' (gate). @/li\n@/ul\n\nThe terminals are output on these layers:\n@ul\n@li 'tS' - source. Default output is 'S' (strict mode) or 'SD' (otherwise). @/li\n@li 'tD' - drain. Default output is 'D' (strict mode) or 'SD' (otherwise). @/li\n@li 'tG' - gate. Default output is 'G'. @/li\n@/ul\n\nThe source/drain (diffusion) area is distributed on the number of gates connecting to\nthe particular source or drain area.\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 139
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name. If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable.
For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorMOS3Transistor
@brief Creates a new device extractor with the given name. If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable.
For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
strict
method descriptor
strict() -> bool
@brief Returns a value indicating whether extraction happens in strict mode.
DeviceExtractorMOS4Transistor
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a four-terminal MOS transistor
This class supplies the generic extractor for a MOS device. It is based on the \DeviceExtractorMOS3Transistor class with the extension of a bulk terminal and corresponding bulk terminal output (annotation) layer.
The parameters of a MOS4 device are the same than for MOS3 devices. For the device layers the bulk layer is added.
@ul @li 'B' (bulk) - currently this layer is not used and can be empty. @/li @/ul
The bulk terminals are output on this layer: @ul @li 'tB' - bulk terminal (a copy of the gate shape). Default output is 'B'. @/li @/ul
The bulk terminal layer can be empty. In this case, it needs to be connected to a global net to establish the net connection.
The device class produced by this extractor is \DeviceClassMOS4Transistor.
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a four-terminal MOS transistor\n\nThis class supplies the generic extractor for a MOS device.\nIt is based on the \\DeviceExtractorMOS3Transistor class with the extension of a bulk terminal and corresponding bulk terminal output (annotation) layer.\n\nThe parameters of a MOS4 device are the same than for MOS3 devices. For the device layers the bulk layer is added.\n\n@ul\n@li 'B' (bulk) - currently this layer is not used and can be empty. @/li\n@/ul\n\nThe bulk terminals are output on this layer:\n@ul\n@li 'tB' - bulk terminal (a copy of the gate shape). Default output is 'B'. @/li\n@/ul\n\nThe bulk terminal layer can be empty. In this case, it needs \nto be connected to a global net to establish the net connection.\n\nThe device class produced by this extractor is \\DeviceClassMOS4Transistor.\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 140
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorMOS4Transistor
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorResistor
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a two-terminal resistor
This class supplies the generic extractor for a resistor device. The device is defined by two geometry layers: the resistor 'wire' and two contacts per wire. The contacts should be attached to the ends of the wire. The wire length and width is computed from the edge lengths between the contacts and along the contacts respectively.
This simple computation is precise only when the resistor shape is a rectangle.
Using the given sheet resistance, the resistance value is computed by 'R = L / W * sheet_rho'.
The device class produced by this extractor is \DeviceClassResistor. The extractor produces three parameters:
@ul @li 'R' - the resistance in Ohm @/li @li 'A' - the resistor's area in square micrometer units @/li @li 'P' - the resistor's perimeter in micrometer units @/li @/ul
The device layer names are:
@ul @li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li @li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li @/ul
The terminals are output on these layers: @ul @li 'tA', 'tB' - the two terminals of the resistor. @/li @/ul
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a two-terminal resistor\n\nThis class supplies the generic extractor for a resistor device.\nThe device is defined by two geometry layers: the resistor 'wire' and two contacts per wire. The contacts should be attached to the ends of the wire. The wire length and width is computed from the edge lengths between the contacts and along the contacts respectively.\n\nThis simple computation is precise only when the resistor shape is a rectangle.\n\nUsing the given sheet resistance, the resistance value is computed by 'R = L / W * sheet_rho'.\n\nThe device class produced by this extractor is \\DeviceClassResistor.\nThe extractor produces three parameters:\n\n@ul\n@li 'R' - the resistance in Ohm @/li\n@li 'A' - the resistor's area in square micrometer units @/li\n@li 'P' - the resistor's perimeter in micrometer units @/li\n@/ul\n\nThe device layer names are:\n\n@ul\n@li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li\n@li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li\n@/ul\n\nThe terminals are output on these layers:\n@ul\n@li 'tA', 'tB' - the two terminals of the resistor. @/li\n@/ul\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 141
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorResistor
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceExtractorResistorWithBulk
Bases: klayout.dbcore.DeviceExtractorBase
@brief A device extractor for a resistor with a bulk terminal
This class supplies the generic extractor for a resistor device including a bulk terminal. The device is defined the same way than devices are defined for \DeviceExtractorResistor.
The device class produced by this extractor is \DeviceClassResistorWithBulk. The extractor produces three parameters:
@ul @li 'R' - the resistance in Ohm @/li @li 'A' - the resistor's area in square micrometer units @/li @li 'P' - the resistor's perimeter in micrometer units @/li @/ul
The device layer names are:
@ul @li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li @li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li @li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li @/ul
The terminals are output on these layers: @ul @li 'tA', 'tB' - the two terminals of the resistor. @/li @li 'tW' - the bulk terminal (copy of the resistor area). @/li @/ul
The bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally.
This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief A device extractor for a resistor with a bulk terminal\n\nThis class supplies the generic extractor for a resistor device including a bulk terminal.\nThe device is defined the same way than devices are defined for \\DeviceExtractorResistor.\n\nThe device class produced by this extractor is \\DeviceClassResistorWithBulk.\nThe extractor produces three parameters:\n\n@ul\n@li 'R' - the resistance in Ohm @/li\n@li 'A' - the resistor's area in square micrometer units @/li\n@li 'P' - the resistor's perimeter in micrometer units @/li\n@/ul\n\nThe device layer names are:\n\n@ul\n@li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li\n@li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li\n@li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li\n@/ul\n\nThe terminals are output on these layers:\n@ul\n@li 'tA', 'tB' - the two terminals of the resistor. @/li\n@li 'tW' - the bulk terminal (copy of the resistor area). @/li\n@/ul\n\nThe bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally.\n\nThis class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \\DeviceExtractor.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 142
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
new
builtin
new() -> DeviceExtractorResistorWithBulk
@brief Creates a new device extractor with the given name For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3.
DeviceParameterDefinition
@brief A parameter descriptor This class is used inside the \DeviceClass class to describe a parameter of the device.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A parameter descriptor\nThis class is used inside the \\DeviceClass class to describe a parameter of the device.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 97
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceParameterDefinition' objects>
list of weak references to the object
default_value
class
default_value: float = <attribute 'default_value' of 'DeviceParameterDefinition' objects>
@brief Gets the default value of the parameter.
@brief Sets the default value of the parameter. The default value is used to initialize parameters of \Device objects.
description
class
description: str = <attribute 'description' of 'DeviceParameterDefinition' objects>
@brief Gets the description of the parameter.
@brief Sets the description of the parameter.
geo_scaling_exponent
class
geo_scaling_exponent: float = <attribute 'geo_scaling_exponent' of 'DeviceParameterDefinition' objects>
@brief Gets the geometry scaling exponent. This value is used when applying '.options scale' in the SPICE reader for example. It is zero for 'no scaling', 1.0 for linear scaling and 2.0 for quadratic scaling.
This attribute has been added in version 0.28.6.
@brief Sets the geometry scaling exponent. See \geo_scaling_exponent for details.
This attribute has been added in version 0.28.6.
is_primary
class
is_primary: bool = <attribute 'is_primary' of 'DeviceParameterDefinition' objects>
@brief Gets a value indicating whether the parameter is a primary parameter See \is_primary= for details about this predicate.
@brief Sets a value indicating whether the parameter is a primary parameter If this flag is set to true (the default), the parameter is considered a primary parameter. Only primary parameters are compared by default.
name
class
name: str = <attribute 'name' of 'DeviceParameterDefinition' objects>
@brief Gets the name of the parameter.
@brief Sets the name of the parameter.
si_scaling
class
si_scaling: float = <attribute 'si_scaling' of 'DeviceParameterDefinition' objects>
@brief Gets the scaling factor to SI units. For parameters in micrometers - for example W and L of MOS devices - this factor can be set to 1e-6 to reflect the unit.
@brief Sets the scaling factor to SI units.
This setter has been added in version 0.28.6.
__copy__
method descriptor
__copy__() -> DeviceParameterDefinition
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceParameterDefinition
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new parameter definition. @param name The name of the parameter @param description The human-readable description @param default_value The initial value @param is_primary True, if the parameter is a primary parameter (see \is_primary=) @param si_scaling The scaling factor to SI units @param geo_scaling_exponent Indicates how the parameter scales with geometrical scaling (0: no scaling, 1.0: linear, 2.0: quadratic)
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DeviceParameterDefinition
@brief Creates a copy of self
id
method descriptor
id() -> int
@brief Gets the ID of the parameter. The ID of the parameter is used in some places to refer to a specific parameter (e.g. in the \NetParameterRef object).
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DeviceParameterDefinition
@brief Creates a new parameter definition. @param name The name of the parameter @param description The human-readable description @param default_value The initial value @param is_primary True, if the parameter is a primary parameter (see \is_primary=) @param si_scaling The scaling factor to SI units @param geo_scaling_exponent Indicates how the parameter scales with geometrical scaling (0: no scaling, 1.0: linear, 2.0: quadratic)
DeviceReconnectedTerminal
@brief Describes a terminal rerouting in combined devices. Combined devices are implemented as a generalization of the device abstract concept in \Device. For combined devices, multiple \DeviceAbstract references are present. To support different combination schemes, device-to-abstract routing is supported. Parallel combinations will route all outer terminals to corresponding terminals of all device abstracts (because of terminal swapping these may be different ones).
This object describes one route to an abstract's terminal. The device index is 0 for the main device abstract and 1 for the first combined device abstract.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief Describes a terminal rerouting in combined devices.\nCombined devices are implemented as a generalization of the device abstract concept in \\Device. For combined devices, multiple \\DeviceAbstract references are present. To support different combination schemes, device-to-abstract routing is supported. Parallel combinations will route all outer terminals to corresponding terminals of all device abstracts (because of terminal swapping these may be different ones).\n\nThis object describes one route to an abstract's terminal. The device index is 0 for the main device abstract and 1 for the first combined device abstract.\n\nThis class has been introduced in version 0.26.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 87
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceReconnectedTerminal' objects>
list of weak references to the object
device_index
class
device_index: int = <attribute 'device_index' of 'DeviceReconnectedTerminal' objects>
@brief The device abstract index getter. See the class description for details.
@brief The device abstract index setter. See the class description for details.
other_terminal_id
class
other_terminal_id: int = <attribute 'other_terminal_id' of 'DeviceReconnectedTerminal' objects>
@brief The getter for the abstract's connected terminal. See the class description for details.
@brief The setter for the abstract's connected terminal. See the class description for details.
__copy__
method descriptor
__copy__() -> DeviceReconnectedTerminal
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceReconnectedTerminal
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DeviceReconnectedTerminal
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DeviceReconnectedTerminal
@brief Creates a new object of this class
DeviceTerminalDefinition
@brief A terminal descriptor This class is used inside the \DeviceClass class to describe a terminal of the device.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A terminal descriptor\nThis class is used inside the \\DeviceClass class to describe a terminal of the device.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 96
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DeviceTerminalDefinition' objects>
list of weak references to the object
description
class
description: str = <attribute 'description' of 'DeviceTerminalDefinition' objects>
@brief Gets the description of the terminal.
@brief Sets the description of the terminal.
name
class
name: str = <attribute 'name' of 'DeviceTerminalDefinition' objects>
@brief Gets the name of the terminal.
@brief Sets the name of the terminal.
__copy__
method descriptor
__copy__() -> DeviceTerminalDefinition
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> DeviceTerminalDefinition
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new terminal definition.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> DeviceTerminalDefinition
@brief Creates a copy of self
id
method descriptor
id() -> int
@brief Gets the ID of the terminal. The ID of the terminal is used in some places to refer to a specific terminal (e.g. in the \NetTerminalRef object).
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> DeviceTerminalDefinition
@brief Creates a new terminal definition.
Edge
@brief An edge class
An edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2). Edges play a role in the database as parts of polygons and to describe a line through both points. Although supported, edges are rarely used as individual database objects.
See @The Database API@ for more details about the database objects like the Edge class.
__doc__
class
__doc__ = '@brief An edge class\n\nAn edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2). Edges play a role in the database as parts of polygons and to describe a line through both points.\nAlthough supported, edges are rarely used as individual database objects.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects like the Edge class.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 44
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Edge' objects>
list of weak references to the object
p1
class
p1: Point = <attribute 'p1' of 'Edge' objects>
@brief The first point.
@brief Sets the first point. This method has been added in version 0.23.
p2
class
p2: Point = <attribute 'p2' of 'Edge' objects>
@brief The second point.
@brief Sets the second point. This method has been added in version 0.23.
x1
class
x1: int = <attribute 'x1' of 'Edge' objects>
@brief Shortcut for p1.x
@brief Sets p1.x This method has been added in version 0.23.
x2
class
x2: int = <attribute 'x2' of 'Edge' objects>
@brief Shortcut for p2.x
@brief Sets p2.x This method has been added in version 0.23.
y1
class
y1: int = <attribute 'y1' of 'Edge' objects>
@brief Shortcut for p1.y
@brief Sets p1.y This method has been added in version 0.23.
y2
class
y2: int = <attribute 'y2' of 'Edge' objects>
@brief Shortcut for p2.y
@brief Sets p2.y This method has been added in version 0.23.
__copy__
method descriptor
__copy__() -> Edge
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Edge
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test @param e The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given edge. This method enables edges as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(dedge: DEdge) -> None
__init__(p1: Point, p2: Point) -> None
__init__(x1: int, y1: int, x2: int, y2: int) -> None
__init__()
@brief Constructor with two points
Two points are given to create a new edge.
__lt__
method descriptor
__lt__() -> bool
@brief Less operator @param e The object to compare against @return True, if the edge is 'less' as the other edge with respect to first and second point
__mul__
method descriptor
__mul__() -> Edge
@brief Scale edge
The * operator scales self with the given factor.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled edge
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test @param e The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the edge If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__() -> Edge
@brief Scale edge
The * operator scales self with the given factor.
This method has been introduced in version 0.22.
@param scale_factor The scaling factor
@return The scaled edge
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the edge If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Return the bounding box of the edge.
clipped
method descriptor
clipped() -> Any
@brief Returns the edge clipped at the given box
@param box The clip box. @return The clipped edge or nil if the edge does not intersect with the box.
This method has been introduced in version 0.26.2.
clipped_line
method descriptor
clipped_line() -> Any
@brief Returns the line through the edge clipped at the given box
@param box The clip box. @return The part of the line through the box or nil if the line does not intersect with the box.
In contrast to \clipped, this method will consider the edge extended infinitely (a "line"). The returned edge will be the part of this line going through the box.
This method has been introduced in version 0.26.2.
coincident
method descriptor
coincident() -> bool
@brief Coincidence check.
Checks whether a edge is coincident with another edge. Coincidence is defined by being parallel and that at least one point of one edge is on the other edge.
@param e the edge to test with
@return True if the edges are coincident.
contains
method descriptor
contains() -> bool
@brief Tests whether a point is on an edge.
A point is on a edge if it is on (or at least closer than a grid point to) the edge.
@param p The point to test with the edge.
@return True if the point is on the edge.
contains_excl
method descriptor
contains_excl() -> bool
@brief Tests whether a point is on an edge excluding the endpoints.
A point is on a edge if it is on (or at least closer than a grid point to) the edge.
@param p The point to test with the edge.
@return True if the point is on the edge but not equal p1 or p2.
create
method descriptor
create() -> None
@brief 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.
crossed_by
method descriptor
crossed_by() -> bool
@brief Checks, if the line given by self is crossed by the edge e
self if considered an infinite line. This predicate renders true if the edge e is cut by this line. In other words: this method returns true if e.p1 is in one semispace of self while e.p2 is in the other or one of them is exactly on self.
@param e The edge representing the line that the edge must be crossing.
crossing_point
method descriptor
crossing_point() -> Point
@brief Returns the crossing point on two edges.
This method delivers the point where the given line (self) crosses the edge given by the argument "e". self is considered infinitely long and is required to cut through the edge "e". If self does not cut this line, the result is undefined. See \crossed_by? for a description of the crossing predicate.
@param e The edge representing the line that self must be crossing. @return The point where self crosses the line given by "e".
This method has been introduced in version 0.19.
cut_point
method descriptor
cut_point() -> Any
@brief Returns the intersection point of the lines through the two edges.
This method delivers the intersection point between the lines through the two edges. If the lines are parallel and do not intersect, the result will be nil. In contrast to \intersection_point, this method will regard the edges as infinitely extended and intersection is not confined to the edge span.
@param e The edge to test. @return The point where the lines intersect.
This method has been introduced in version 0.27.1.
d
method descriptor
d() -> Vector
@brief Gets the edge extension as a vector. This method is equivalent to p2 - p1. This method has been introduced in version 0.26.2.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
distance
method descriptor
distance() -> int
@brief Gets the distance of the point from the line through the edge.
Returns the distance between the edge and the point. The distance is signed which is negative if the point is to the "right" of the edge and positive if the point is to the "left". The distance is measured by projecting the point onto the line through the edge. If the edge is degenerated, the distance is not defined.
This method considers the edge to define an infinite line running through it. \distance returns the distance of 'p' to this line. A similar method is \euclidian_distance, but the latter regards the edge a finite set of points between the endpoints.
@param p The point to test.
@return The distance
distance_abs
method descriptor
distance_abs() -> int
@brief Absolute distance between the edge and a point.
Returns the distance between the edge and the point.
@param p The point to test.
@return The distance
dup
method descriptor
dup() -> Edge
@brief Creates a copy of self
dx
method descriptor
dx() -> int
@brief The horizontal extend of the edge.
dx_abs
method descriptor
dx_abs() -> int
@brief The absolute value of the horizontal extend of the edge.
dy
method descriptor
dy() -> int
@brief The vertical extend of the edge.
dy_abs
method descriptor
dy_abs() -> int
@brief The absolute value of the vertical extend of the edge.
enlarge
method descriptor
enlarge() -> Edge
@brief Enlarges the edge.
Enlarges the edge by the given distance and returns the enlarged edge. The edge is overwritten. Enlargement means that the first point is shifted by -p, the second by p.
@param p The distance to move the edge points.
@return The enlarged edge.
enlarged
method descriptor
enlarged() -> Edge
@brief Returns the enlarged edge (does not modify self)
Enlarges the edge by the given offset and returns the enlarged edge. The edge is not modified. Enlargement means that the first point is shifted by -p, the second by p.
@param p The distance to move the edge points.
@return The enlarged edge.
euclidian_distance
method descriptor
euclidian_distance() -> int
@brief Gets the distance of the point from the the edge.
Returns the minimum distance of the point to any point on the edge. Unlike \distance, the edge is considered a finite set of points between the endpoints. The result is also not signed like it is the case for \distance.
This method has been introduced in version 0.28.14.
@param p The point to test.
@return The distance
extend
method descriptor
extend() -> Edge
@brief Extends the edge (modifies self)
Extends the edge by the given distance and returns the extended edge. The edge is not modified. Extending means that the first point is shifted by -d along the edge, the second by d. The length of the edge will increase by 2*d.
\extended is a version that does not modify self but returns the extended edges.
This method has been introduced in version 0.23.
@param d The distance by which to shift the end points.
@return The extended edge (self).
extended
method descriptor
extended() -> Edge
@brief Returns the extended edge (does not modify self)
Extends the edge by the given distance and returns the extended edge. The edge is not modified. Extending means that the first point is shifted by -d along the edge, the second by d. The length of the edge will increase by 2*d.
\extend is a version that modifies self (in-place).
This method has been introduced in version 0.23.
@param d The distance by which to shift the end points.
@return The extended edge.
from_dedge
builtin
from_dedge() -> Edge
@brief Creates an integer coordinate edge from a floating-point coordinate edge
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'.
from_s
builtin
from_s() -> Edge
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given edge. This method enables edges as hash keys.
This method has been introduced in version 0.25.
intersect
method descriptor
intersect() -> bool
@brief Intersection test.
Returns true if the edges intersect. Two edges intersect if they share at least one point. If the edges coincide, they also intersect. If one of the edges is degenerate (both points are identical), that point is required to sit exaclty on the other edge. If both edges are degenerate, their points are required to be identical.
@param e The edge to test.
The 'intersects' (with an 's') synonym has been introduced in version 0.28.12.
intersection_point
method descriptor
intersection_point() -> Any
@brief Returns the intersection point of two edges.
This method delivers the intersection point. If the edges do not intersect, the result will be nil.
@param e The edge to test. @return The point where the edges intersect.
This method has been introduced in version 0.19. From version 0.26.2, this method will return nil in case of non-intersection.
intersects
method descriptor
intersects() -> bool
@brief Intersection test.
Returns true if the edges intersect. Two edges intersect if they share at least one point. If the edges coincide, they also intersect. If one of the edges is degenerate (both points are identical), that point is required to sit exaclty on the other edge. If both edges are degenerate, their points are required to be identical.
@param e The edge to test.
The 'intersects' (with an 's') synonym has been introduced in version 0.28.12.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_degenerate
method descriptor
is_degenerate() -> bool
@brief Test for degenerated edge
An edge is degenerate, if both end and start point are identical.
is_parallel
method descriptor
is_parallel() -> bool
@brief Test for being parallel
@param e The edge to test against
@return True if both edges are parallel
length
method descriptor
length() -> int
@brief The length of the edge
move
method descriptor
move(dx: int, dy: int) -> Edge
move(p: Vector) -> Edge
move()
@brief Moves the edge.
Moves the edge by the given offset and returns the moved edge. The edge is overwritten.
@param dx The x distance to move the edge. @param dy The y distance to move the edge.
@return The moved edge.
This version has been added in version 0.23.
moved
method descriptor
moved(dx: int, dy: int) -> Edge
moved(p: Vector) -> Edge
moved()
@brief Returns the moved edge (does not modify self)
Moves the edge by the given offset and returns the moved edge. The edge is not modified.
@param dx The x distance to move the edge. @param dy The y distance to move the edge.
@return The moved edge.
This version has been added in version 0.23.
new
builtin
new() -> Edge
new(dedge: DEdge) -> Edge
new(p1: Point, p2: Point) -> Edge
new(x1: int, y1: int, x2: int, y2: int) -> Edge
new()
@brief Constructor with two points
Two points are given to create a new edge.
new_pp
builtin
new_pp() -> Edge
@brief Constructor with two points
Two points are given to create a new edge.
new_xyxy
builtin
new_xyxy() -> Edge
@brief Constructor with two coordinates given as single values
Two points are given to create a new edge.
ortho_length
method descriptor
ortho_length() -> int
@brief The orthogonal length of the edge ("manhattan-length")
@return The orthogonal length (abs(dx)+abs(dy))
shift
method descriptor
shift() -> Edge
@brief Shifts the edge (modifies self)
Shifts the edge by the given distance and returns the shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right.
\shifted is a version that does not modify self but returns the extended edges.
This method has been introduced in version 0.23.
@param d The distance by which to shift the edge.
@return The shifted edge (self).
shifted
method descriptor
shifted() -> Edge
@brief Returns the shifted edge (does not modify self)
Shifts the edge by the given distance and returns the shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right.
\shift is a version that modifies self (in-place).
This method has been introduced in version 0.23.
@param d The distance by which to shift the edge.
@return The shifted edge.
side_of
method descriptor
side_of() -> int
@brief Indicates at which side the point is located relative to the edge.
Returns 1 if the point is "left" of the edge, 0 if on and -1 if the point is "right" of the edge.
@param p The point to test.
@return The side value
sq_length
method descriptor
sq_length() -> int
@brief The square of the length of the edge
swap_points
method descriptor
swap_points() -> Edge
@brief Swap the points of the edge
This version modifies self. A version that does not modify self is \swapped_points. Swapping the points basically reverses the direction of the edge.
This method has been introduced in version 0.23.
swapped_points
method descriptor
swapped_points() -> Edge
@brief Returns an edge in which both points are swapped
Swapping the points basically reverses the direction of the edge.
This method has been introduced in version 0.23.
to_dtype
method descriptor
to_dtype() -> DEdge
@brief Converts the edge to a floating-point coordinate edge
The database unit can be specified to translate the integer-coordinate edge into a floating-point coordinate edge in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the edge If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
transformed
method descriptor
transformed(t: CplxTrans) -> DEdge
transformed(t: ICplxTrans) -> Edge
transformed(t: Trans) -> Edge
transformed()
@brief Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge.
@param t The transformation to apply.
@return The transformed edge.
transformed_cplx
method descriptor
transformed_cplx() -> DEdge
@brief Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge.
@param t The transformation to apply.
@return The transformed edge.
EdgeFilter
@brief A generic edge filter adaptor
Edge filters are an efficient way to filter edge from a Edges collection. To apply a filter, derive your own filter class and pass an instance to the \Edges#filter or \Edges#filtered method.
Conceptually, these methods take each edge from the collection and present it to the filter's 'selected' method. Based on the result of this evaluation, the edge is kept or discarded.
The magic happens when deep mode edge collections are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using the filter.
You can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that filters edges parallel to a given one: @code class ParallelFilter < RBA::EdgeFilter
# Constructor def initialize(ref_edge) self.is_scale_invariant # orientation matters, but scale does not @ref_edge = ref_edge end
# Select only parallel ones def selected(edge) return edge.is_parallel?(@ref_edge) end
end
edges = ... # some Edges object ref_edge = ... # some Edge parallel_only = edges.filtered(ParallelFilter::new(ref_edge)) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge filter adaptor\n\nEdge filters are an efficient way to filter edge from a Edges collection. To apply a filter, derive your own filter class and pass an instance to the \\Edges#filter or \\Edges#filtered method.\n\nConceptually, these methods take each edge from the collection and present it to the filter's 'selected' method.\nBased on the result of this evaluation, the edge is kept or discarded.\n\nThe magic happens when deep mode edge collections are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using the filter.\n\nYou can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that filters edges parallel to a given one:\n@code\nclass ParallelFilter < RBA::EdgeFilter\n\n # Constructor\n def initialize(ref_edge)\n self.is_scale_invariant # orientation matters, but scale does not\n @ref_edge = ref_edge\n end\n \n # Select only parallel ones\n def selected(edge)\n return edge.is_parallel?(@ref_edge)\n end\n\nend\n\nedges = ... # some Edges object\nref_edge = ... # some Edge\nparallel_only = edges.filtered(ParallelFilter::new(ref_edge))\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 53
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeFilter' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'EdgeFilter' objects>
@brief Gets a value indicating whether the filter needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the filter needs raw (unmerged) input This flag must be set before using this filter. It tells the filter implementation whether the filter wants to have raw input (unmerged). The default value is 'false', meaning that the filter will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgeFilter' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) filters are area or perimeter filters. The area or perimeter of a polygon depends on the scale, but not on the orientation of the polygon.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) filter is the square selector. Whether a polygon is a square or not does not depend on the polygon's orientation nor scale.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) filter is the bounding box aspect ratio (height/width) filter. The definition of heigh and width depends on the orientation, but the ratio is independent on scale.
new
builtin
new() -> EdgeFilter
@brief Creates a new object of this class
EdgeMode
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
All
class
All: EdgeMode = All (0)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
Concave
class
Concave: EdgeMode = Concave (2)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
Convex
class
Convex: EdgeMode = Convex (1)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotConcave
class
NotConcave: EdgeMode = NotConcave (7)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotConvex
class
NotConvex: EdgeMode = NotConvex (6)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotStep
class
NotStep: EdgeMode = NotStep (10)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotStepIn
class
NotStepIn: EdgeMode = NotStepIn (8)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotStepOut
class
NotStepOut: EdgeMode = NotStepOut (9)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
Step
class
Step: EdgeMode = Step (5)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
StepIn
class
StepIn: EdgeMode = StepIn (3)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
StepOut
class
StepOut: EdgeMode = StepOut (4)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
__doc__
class
__doc__ = '@brief This class represents the edge mode type for \\Region#edges.\n\nThis enum has been introduced in version 0.29.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 166
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeMode' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> EdgeMode
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> EdgeMode
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: EdgeMode) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> EdgeMode
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> EdgeMode
new(s: str) -> EdgeMode
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
EdgeOperator
@brief A generic edge-to-polygon operator
Edge processors are an efficient way to process edges from an edge collection. To apply a processor, derive your own operator class and pass an instance to the \Edges#processed method.
Conceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output edges derived from the input edge. The output edge collection is the sum over all these individual results.
The magic happens when deep mode edge collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that shrinks every edge to half of the size, but does not change the position. In this example the 'position' is defined by the center of the edge: @code class ShrinkToHalf < RBA::EdgeOperator
# Constructor def initialize self.is_isotropic_and_scale_invariant # scale or orientation do not matter end
# Shrink to half size def process(edge) shift = edge.bbox.center - RBA::Point::new # shift vector return [ (edge.moved(-shift) * 0.5).moved(shift) ] end
end
edges = ... # some Edges collection shrinked_to_half = edges.processed(ShrinkToHalf::new) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge-to-polygon operator\n\nEdge processors are an efficient way to process edges from an edge collection. To apply a processor, derive your own operator class and pass an instance to the \\Edges#processed method.\n\nConceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output edges derived from the input edge.\nThe output edge collection is the sum over all these individual results.\n\nThe magic happens when deep mode edge collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that shrinks every edge to half of the size, but does not change the position.\nIn this example the 'position' is defined by the center of the edge:\n@code\nclass ShrinkToHalf < RBA::EdgeOperator\n\n # Constructor\n def initialize\n self.is_isotropic_and_scale_invariant # scale or orientation do not matter\n end\n \n # Shrink to half size\n def process(edge)\n shift = edge.bbox.center - RBA::Point::new # shift vector\n return [ (edge.moved(-shift) * 0.5).moved(shift) ]\n end\n\nend\n\nedges = ... # some Edges collection\nshrinked_to_half = edges.processed(ShrinkToHalf::new)\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 54
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeOperator' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'EdgeOperator' objects>
@brief Gets a value indicating whether the processor needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the processor needs raw (unmerged) input This flag must be set before using this processor. It tells the processor implementation whether the processor wants to have raw input (unmerged). The default value is 'false', meaning that the processor will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
result_is_merged
class
result_is_merged: bool = <attribute 'result_is_merged' of 'EdgeOperator' objects>
@brief Gets a value indicating whether the processor delivers merged output See \result_is_merged= for details.
@brief Sets a value indicating whether the processor delivers merged output This flag must be set before using this processor. If the processor maintains the merged condition by design (output is merged if input is), it is a good idea to set this predicate to 'true'. This will avoid additional merge steps when the resulting collection is used in further operations that need merged input .
result_must_not_be_merged
class
result_must_not_be_merged: bool = <attribute 'result_must_not_be_merged' of 'EdgeOperator' objects>
@brief Gets a value indicating whether the processor's output must not be merged See \result_must_not_be_merged= for details.
@brief Sets a value indicating whether the processor's output must not be merged This flag must be set before using this processor. The processor can set this flag if it wants to deliver shapes that must not be merged - e.g. point-like edges or strange or degenerated polygons. .
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgeOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> EdgeOperator
@brief Creates a new object of this class
EdgePair
@brief 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.
__doc__
class
__doc__ = '@brief An edge pair (a pair of two edges)\nEdge 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).\n\nEdge 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.\n\nThis class has been introduced in version 0.23.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 46
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgePair' objects>
list of weak references to the object
first
class
first: Edge = <attribute 'first' of 'EdgePair' objects>
@brief Gets the first edge
@brief Sets the first edge
second
class
second: Edge = <attribute 'second' of 'EdgePair' objects>
@brief Gets the second edge
@brief Sets the second edge
symmetric
class
symmetric: bool = <attribute 'symmetric' of 'EdgePair' objects>
@brief Returns a value indicating whether the edge pair is symmetric For symmetric edge pairs, the edges are commutable. Specifically, a symmetric edge pair with (e1,e2) is identical to (e2,e1). Symmetric edge pairs are generated by some checks for which there is no directed error marker (width, space, notch, isolated).
Symmetric edge pairs have been introduced in version 0.27.
@brief Sets a value indicating whether the edge pair is symmetric See \symmetric? for a description of this attribute.
Symmetric edge pairs have been introduced in version 0.27.
__copy__
method descriptor
__copy__() -> EdgePair
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> EdgePair
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality Returns true, if this edge pair and the given one are equal
This method has been introduced in version 0.25.
__hash__
method descriptor
__hash__() -> int
@brief 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.
__init__
method descriptor
__init__() -> None
__init__(dedge_pair: DEdgePair) -> None
__init__(first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> None
__init__()
@brief Constructor from two edges
This constructor creates an edge pair from the two edges given. See \symmetric? for a description of this attribute.
__lt__
method descriptor
__lt__() -> bool
@brief 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.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality Returns true, if this edge pair and the given one are not equal
This method has been introduced in version 0.25.
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the edge pair If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the edge pair If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
area
method descriptor
area() -> int
@brief Gets the area between the edges of the edge pair
This attribute has been introduced in version 0.28.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Gets the bounding box of the edge pair
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
distance
method descriptor
distance() -> int
@brief Gets the distance of the edges in the edge pair
The distance between the two edges is defined as the minimum distance between any two points on the two edges.
This attribute has been introduced in version 0.28.14.
dup
method descriptor
dup() -> EdgePair
@brief Creates a copy of self
from_s
builtin
from_s() -> EdgePair
@brief 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.
greater
method descriptor
greater() -> Edge
@brief Gets the 'greater' edge for symmetric edge pairs As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'second' edge in a way independent on the actual assignment.
This read-only attribute has been introduced in version 0.27.
hash
method descriptor
hash() -> int
@brief 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.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
lesser
method descriptor
lesser() -> Edge
@brief Gets the 'lesser' edge for symmetric edge pairs As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'first' edge in a way independent on the actual assignment.
This read-only attribute has been introduced in version 0.27.
new
builtin
new() -> EdgePair
new(dedge_pair: DEdgePair) -> EdgePair
new(first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> EdgePair
new()
@brief Constructor from two edges
This constructor creates an edge pair from the two edges given. See \symmetric? for a description of this attribute.
normalized
method descriptor
normalized() -> EdgePair
@brief 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.
perimeter
method descriptor
perimeter() -> int
@brief Gets the perimeter of the edge pair
The perimeter is defined as the sum of the lengths of both edges ('active perimeter').
This attribute has been introduced in version 0.28.
polygon
method descriptor
polygon() -> Polygon
@brief 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 applies 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. @param e The enlargement (set to zero for exact representation)
simple_polygon
method descriptor
simple_polygon() -> SimplePolygon
@brief 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 applies 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. @param e The enlargement (set to zero for exact representation)
to_dtype
method descriptor
to_dtype() -> DEdgePair
@brief 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
method descriptor
to_s() -> str
@brief Returns a string representing the edge pair If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
transformed
method descriptor
transformed(t: CplxTrans) -> DEdgePair
transformed(t: ICplxTrans) -> EdgePair
transformed(t: Trans) -> EdgePair
transformed()
@brief 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.
@param t The transformation to apply.
@return The transformed edge pair
EdgePairFilter
@brief A generic edge pair filter adaptor
EdgePair filters are an efficient way to filter edge pairs from a EdgePairs collection. To apply a filter, derive your own filter class and pass an instance to \EdgePairs#filter or \EdgePairs#filtered method.
Conceptually, these methods take each edge pair from the collection and present it to the filter's 'selected' method. Based on the result of this evaluation, the edge pair is kept or discarded.
The magic happens when deep mode edge pair collections are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using the filter.
You can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that filters edge pairs where the edges are perpendicular: @code class PerpendicularEdgesFilter < RBA::EdgePairFilter
# Constructor def initialize self.is_isotropic_and_scale_invariant # orientation and scale do not matter end
# Select edge pairs where the edges are perpendicular def selected(edge_pair) return edge_pair.first.d.sprod_sign(edge_pair.second.d) == 0 end
end
edge_pairs = ... # some EdgePairs object perpendicular_only = edge_pairs.filtered(PerpendicularEdgesFilter::new) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge pair filter adaptor\n\nEdgePair filters are an efficient way to filter edge pairs from a EdgePairs collection. To apply a filter, derive your own filter class and pass an instance to \\EdgePairs#filter or \\EdgePairs#filtered method.\n\nConceptually, these methods take each edge pair from the collection and present it to the filter's 'selected' method.\nBased on the result of this evaluation, the edge pair is kept or discarded.\n\nThe magic happens when deep mode edge pair collections are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using the filter.\n\nYou can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that filters edge pairs where the edges are perpendicular:\n@code\nclass PerpendicularEdgesFilter < RBA::EdgePairFilter\n\n # Constructor\n def initialize\n self.is_isotropic_and_scale_invariant # orientation and scale do not matter\n end\n \n # Select edge pairs where the edges are perpendicular\n def selected(edge_pair)\n return edge_pair.first.d.sprod_sign(edge_pair.second.d) == 0\n end\n\nend\n\nedge_pairs = ... # some EdgePairs object\nperpendicular_only = edge_pairs.filtered(PerpendicularEdgesFilter::new)\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 48
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgePairFilter' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgePairFilter' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) filters are area or perimeter filters. The area or perimeter of a polygon depends on the scale, but not on the orientation of the polygon.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) filter is the square selector. Whether a polygon is a square or not does not depend on the polygon's orientation nor scale.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) filter is the bounding box aspect ratio (height/width) filter. The definition of heigh and width depends on the orientation, but the ratio is independent on scale.
new
builtin
new() -> EdgePairFilter
@brief Creates a new object of this class
EdgePairOperator
@brief A generic edge-pair operator
Edge pair processors are an efficient way to process edge pairs from an edge pair collection. To apply a processor, derive your own operator class and pass an instance to the \EdgePairs#processed or \EdgePairs#process method.
Conceptually, these methods take each edge pair from the edge pair collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output edge pairs derived from the input edge pair. The output edge pair collection is the sum over all these individual results.
The magic happens when deep mode edge pair collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that flips the edge pairs (swaps first and second edge): @code class FlipEdgePairs < RBA::EdgePairOperator
# Constructor def initialize self.is_isotropic_and_scale_invariant # orientation and scale do not matter end
# Flips the edge pair def process(edge_pair) return [ RBA::EdgePair::new(edge_pair.second, edge_pair.first) ] end
end
edge_pairs = ... # some EdgePairs object flipped = edge_pairs.processed(FlipEdgePairs::new) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge-pair operator\n\nEdge pair processors are an efficient way to process edge pairs from an edge pair collection. To apply a processor, derive your own operator class and pass an instance to the \\EdgePairs#processed or \\EdgePairs#process method.\n\nConceptually, these methods take each edge pair from the edge pair collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output edge pairs derived from the input edge pair.\nThe output edge pair collection is the sum over all these individual results.\n\nThe magic happens when deep mode edge pair collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that flips the edge pairs (swaps first and second edge):\n@code\nclass FlipEdgePairs < RBA::EdgePairOperator\n\n # Constructor\n def initialize\n self.is_isotropic_and_scale_invariant # orientation and scale do not matter\n end\n \n # Flips the edge pair\n def process(edge_pair)\n return [ RBA::EdgePair::new(edge_pair.second, edge_pair.first) ]\n end\n\nend\n\nedge_pairs = ... # some EdgePairs object\nflipped = edge_pairs.processed(FlipEdgePairs::new)\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 49
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgePairOperator' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgePairOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> EdgePairOperator
@brief Creates a new object of this class
EdgePairToEdgeOperator
@brief A generic edge-pair-to-edge operator
Edge processors are an efficient way to process edge pairs from an edge pair collection. To apply a processor, derive your own operator class and pass an instance to \EdgePairs#processed method.
Conceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output edges derived from the input edge pair. The output edge pair collection is the sum over all these individual results.
The magic happens when deep mode edge pair collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \EdgeToEdgePairOperator class, with the exception that this incarnation has to deliver edges and takes edge pairs.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge-pair-to-edge operator\n\nEdge processors are an efficient way to process edge pairs from an edge pair collection. To apply a processor, derive your own operator class and pass an instance to \\EdgePairs#processed method.\n\nConceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output edges derived from the input edge pair.\nThe output edge pair collection is the sum over all these individual results.\n\nThe magic happens when deep mode edge pair collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\EdgeToEdgePairOperator class, with the exception that this incarnation has to deliver edges and takes edge pairs.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 51
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgePairToEdgeOperator' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgePairToEdgeOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> EdgePairToEdgeOperator
@brief Creates a new object of this class
EdgePairToPolygonOperator
@brief A generic edge-pair-to-polygon operator
Edge pair processors are an efficient way to process edge pairs from an edge pair collection. To apply a processor, derive your own operator class and pass an instance to the \EdgePairs#processed method.
Conceptually, these methods take each edge pair from the edge pair collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output polygons derived from the input edge pair. The output region is the sum over all these individual results.
The magic happens when deep mode edge pair collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \EdgeToPolygonOperator class, with the exception that this incarnation receives edge pairs.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge-pair-to-polygon operator\n\nEdge pair processors are an efficient way to process edge pairs from an edge pair collection. To apply a processor, derive your own operator class and pass an instance to the \\EdgePairs#processed method.\n\nConceptually, these methods take each edge pair from the edge pair collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output polygons derived from the input edge pair.\nThe output region is the sum over all these individual results.\n\nThe magic happens when deep mode edge pair collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\EdgeToPolygonOperator class, with the exception that this incarnation receives edge pairs.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 50
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgePairToPolygonOperator' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgePairToPolygonOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> EdgePairToPolygonOperator
@brief Creates a new object of this class
EdgePairs
Bases: klayout.dbcore.ShapeCollection
@brief EdgePairs (a collection of edge pairs)
Edge pairs are used mainly in the context of the DRC functions (width_check, space_check etc.) of \Region and \Edges. A single edge pair represents two edges participating in a DRC violation. In the two-layer checks (inside, overlap) The first edge represents an edge from the first layer and the second edge an edge from the second layer. For single-layer checks (width, space) the order of the edges is arbitrary.
This class has been introduced in version 0.23.
__doc__
class
__doc__ = '@brief EdgePairs (a collection of edge pairs)\n\nEdge pairs are used mainly in the context of the DRC functions (width_check, space_check etc.) of \\Region and \\Edges. A single edge pair represents two edges participating in a DRC violation. In the two-layer checks (inside, overlap) The first edge represents an edge from the first layer and the second edge an edge from the second layer. For single-layer checks (width, space) the order of the edges is arbitrary.\n\nThis class has been introduced in version 0.23.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 202
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__add__
method descriptor
__add__() -> EdgePairs
@brief Returns the combined edge pair collection of self and the other one
@return The resulting edge pair collection
This operator adds the edge pairs of the other collection to self and returns a new combined set.
This method has been introduced in version 0.24. The 'join' alias has been introduced in version 0.28.12.
__copy__
method descriptor
__copy__() -> EdgePairs
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> EdgePairs
@brief Creates a copy of self
__getitem__
method descriptor
__getitem__() -> EdgePair
@brief Returns the nth edge pair
This method returns nil if the index is out of range. It is available for flat edge pairs only - i.e. those for which \has_valid_edge_pairs? is true. Use \flatten to explicitly flatten an edge pair collection.
The \each iterator is the more general approach to access the edge pairs.
__iadd__
method descriptor
__iadd__() -> EdgePairs
@brief Adds the edge pairs of the other edge pair collection to self
@return The edge pair collection after modification (self)
This operator adds the edge pairs of the other collection to self.
This method has been introduced in version 0.24.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
__init__
method descriptor
__init__() -> None
__init__(array: Sequence[EdgePair]) -> None
__init__(edge_pair: EdgePair) -> None
__init__(shape_iterator: RecursiveShapeIterator) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> None
__init__(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None
__init__(shapes: Shapes) -> None
__init__()
@brief Creates a hierarchical edge pair collection from an original layer with a transformation
This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. This version will create a hierarchical edge pair collection which supports hierarchical operations. The transformation is useful to scale to a specific database unit for example. Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts.
@code dss = RBA::DeepShapeStore::new 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::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) @/code
This constructor has been introduced in version 0.26.
__iter__
method descriptor
__iter__() -> Iterator[EdgePair]
@brief Returns each edge pair of the edge pair collection
__len__
method descriptor
__len__() -> int
@brief Returns the (flat) number of edge pairs in the edge pair collection
The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
__repr__
method descriptor
__repr__() -> str
@brief Converts the edge pair collection to a string The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter.
__str__
method descriptor
__str__() -> str
@brief Converts the edge pair collection to a string The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Return the bounding box of the edge pair collection The bounding box is the box enclosing all points of all edge pairs.
clear
method descriptor
clear() -> None
@brief Clears the edge pair collection
count
method descriptor
count() -> int
@brief Returns the (flat) number of edge pairs in the edge pair collection
The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
create
method descriptor
create() -> None
@brief 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.
data_id
method descriptor
data_id() -> int
@brief Returns the data ID (a unique identifier for the underlying data storage)
This method has been added in version 0.26.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
disable_progress
method descriptor
disable_progress() -> None
@brief Disable progress reporting Calling this method will disable progress reporting. See \enable_progress.
dup
method descriptor
dup() -> EdgePairs
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[EdgePair]
@brief Returns each edge pair of the edge pair collection
edges
method descriptor
edges() -> Edges
@brief Decomposes the edge pairs into single edges @return An edge collection containing the individual edges
enable_progress
method descriptor
enable_progress() -> None
@brief Enable progress reporting After calling this method, the edge pair 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.
enable_properties
method descriptor
enable_properties() -> None
@brief Enables properties for the given container. This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key.
This method has been introduced in version 0.28.4.
extents
method descriptor
extents() -> Region
extents(d: int) -> Region
extents(dx: int, dy: int) -> Region
extents()
@brief Returns a region with the enlarged bounding boxes of the edge pairs This method will return a region consisting of the bounding boxes of the edge pairs 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.
filter
method descriptor
filter() -> None
@brief Applies a generic filter in place (replacing the edge pairs from the EdgePair collection) See \EdgePairFilter for a description of this feature.
This method has been introduced in version 0.29.
filter_properties
method descriptor
filter_properties() -> None
@brief Filters properties by certain keys. Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
filtered
method descriptor
filtered() -> EdgePairs
@brief Applies a generic filter and returns a filtered copy See \EdgePairFilter for a description of this feature.
This method has been introduced in version 0.29.
first_edges
method descriptor
first_edges() -> Edges
@brief Returns the first one of all edges @return An edge collection containing the first edges
flatten
method descriptor
flatten() -> None
@brief Explicitly flattens an edge pair collection
If the collection is already flat (i.e. \has_valid_edge_pairs? returns true), this method will not change the collection.
This method has been introduced in version 0.26.
has_valid_edge_pairs
method descriptor
has_valid_edge_pairs() -> bool
@brief Returns true if the edge pair collection is flat and individual edge pairs can be accessed randomly
This method has been introduced in version 0.26.
hier_count
method descriptor
hier_count() -> int
@brief Returns the (hierarchical) number of edge pairs in the edge pair collection
The count is computed 'hierarchical', i.e. edge pairs inside a cell are counted once even if the cell is instantiated multiple times.
This method has been introduced in version 0.27.
insert
method descriptor
insert(edge_pair: EdgePair) -> None
insert(edge_pairs: EdgePairs) -> None
insert(first: Edge, second: Edge) -> None
insert()
@brief Inserts all edge pairs from the other edge pair collection into this edge pair collection This method has been introduced in version 0.25.
insert_into
method descriptor
insert_into() -> None
@brief Inserts this edge pairs into the given layout, below the given cell and into the given layer. If the edge pair collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused.
This method has been introduced in version 0.26.
insert_into_as_polygons
method descriptor
insert_into_as_polygons() -> None
@brief Inserts this edge pairs into the given layout, below the given cell and into the given layer. If the edge pair collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused.
The edge pairs will be converted to polygons with the enlargement value given be 'e'.
This method has been introduced in version 0.26.
inside
method descriptor
inside() -> EdgePairs
@brief Returns the edge pairs from this edge pair collection which are inside (completely covered by) polygons from the region
@return A new edge pair collection containing the edge pairs completely inside polygons from the region
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
interacting
method descriptor
interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
interacting()
@brief Returns the edge pairs from this edge pair collection which overlap or touch polygons from the region
@return A new edge pair collection containing the edge pairs overlapping or touching polygons from the region
'min_count' and 'max_count' impose a constraint on the number of times an edge pair of this collection has to interact with (different) polygons of the other region to make the edge pair selected. An edge pair is not selected by this method if the number of polygons interacting with an edge pair of this collection is between min_count and max_count (including max_count).
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_deep
method descriptor
is_deep() -> bool
@brief Returns true if the edge pair collection is a deep (hierarchical) one
This method has been added in version 0.26.
is_empty
method descriptor
is_empty() -> bool
@brief Returns true if the collection is empty
join
method descriptor
join() -> EdgePairs
@brief Returns the combined edge pair collection of self and the other one
@return The resulting edge pair collection
This operator adds the edge pairs of the other collection to self and returns a new combined set.
This method has been introduced in version 0.24. The 'join' alias has been introduced in version 0.28.12.
join_with
method descriptor
join_with() -> EdgePairs
@brief Adds the edge pairs of the other edge pair collection to self
@return The edge pair collection after modification (self)
This operator adds the edge pairs of the other collection to self.
This method has been introduced in version 0.24.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
map_properties
method descriptor
map_properties() -> None
@brief Maps properties by name key. Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
move
method descriptor
move(p: Vector) -> EdgePairs
move(x: int, y: int) -> EdgePairs
move()
@brief Moves the edge pair collection
Moves the edge pairs by the given offset and returns the moved edge pairs. The edge pair collection is overwritten.
@param x The x distance to move the edge pairs. @param y The y distance to move the edge pairs.
@return The moved edge pairs (self).
moved
method descriptor
moved(p: Vector) -> EdgePairs
moved(x: int, y: int) -> EdgePairs
moved()
@brief Returns the moved edge pair collection (does not modify self)
Moves the edge pairs by the given offset and returns the moved edge pairs. The edge pair collection is not modified.
@param x The x distance to move the edge pairs. @param y The y distance to move the edge pairs.
@return The moved edge pairs.
new
builtin
new() -> EdgePairs
new(array: Sequence[EdgePair]) -> EdgePairs
new(edge_pair: EdgePair) -> EdgePairs
new(shape_iterator: RecursiveShapeIterator) -> EdgePairs
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> EdgePairs
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> EdgePairs
new(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> EdgePairs
new(shapes: Shapes) -> EdgePairs
new()
@brief Creates a hierarchical edge pair collection from an original layer with a transformation
This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. This version will create a hierarchical edge pair collection which supports hierarchical operations. The transformation is useful to scale to a specific database unit for example. Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts.
@code dss = RBA::DeepShapeStore::new 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::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) @/code
This constructor has been introduced in version 0.26.
not_inside
method descriptor
not_inside() -> EdgePairs
@brief Returns the edge pairs from this edge pair collection which are not inside (not completely covered by) polygons from the region
@return A new edge pair collection containing the edge pairs not completely inside polygons from the region
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
not_interacting
method descriptor
not_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
not_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
not_interacting()
@brief Returns the edge pairs from this edge pair collection which do not overlap or touch polygons from the region
@return A new edge pair collection containing the edge pairs not overlapping or touching polygons from the region
'min_count' and 'max_count' impose a constraint on the number of times an edge pair of this collection has to interact with (different) polygons of the other region to make the edge pair selected. An edge pair is not selected by this method if the number of polygons interacting with an edge pair of this collection is between min_count and max_count (including max_count).
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
not_outside
method descriptor
not_outside() -> EdgePairs
@brief Returns the edge pairs from this edge pair collection which are not outside (partially overlapped by) polygons from the other region
@return A new edge pair collection containing the the selected edges
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
outside
method descriptor
outside() -> EdgePairs
@brief Returns the edge pairs from this edge pair collection which are outside (not overlapped by) polygons from the other region
@return A new edge pair collection containing the the selected edges
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
polygons
method descriptor
polygons() -> Region
polygons(e: int) -> Region
polygons()
@brief Converts the edge pairs to polygons This method creates polygons from the edge pairs. Each polygon will be a triangle or quadrangle which connects the start and end points of the edges forming the edge pair. This version allows one to specify an enlargement which is applied to the edges. The length of the edges is modified by applying the enlargement and the edges are shifted by the enlargement. By specifying an enlargement it is possible to give edge pairs an area which otherwise would not have one (coincident edges, two point-like edges).
process
method descriptor
process() -> None
@brief Applies a generic edge pair processor in place (replacing the edge pairs from the EdgePairs collection) See \EdgePairProcessor for a description of this feature.
This method has been introduced in version 0.29.
processed
method descriptor
processed(processed: EdgePairOperator) -> EdgePairs
processed(processed: EdgePairToEdgeOperator) -> Edges
processed(processed: EdgePairToPolygonOperator) -> Region
processed()
@brief Applies a generic edge-pair-to-polygon processor and returns an Region with the results See \EdgePairToPolygonProcessor for a description of this feature.
This method has been introduced in version 0.29.
pull_interacting
method descriptor
pull_interacting(other: Edges) -> Edges
pull_interacting(other: Region) -> Region
pull_interacting()
@brief Returns all polygons of "other" which are interacting with (overlapping, touching) edge pairs of this set The "pull_..." methods are similar to "select_..." but work the opposite way: they select shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." methods provide a way for re-hierarchization.
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
@return The region after the polygons have been selected (from other)
Merged semantics applies for this method (see \merged_semantics= of merged semantics)
This method has been introduced in version 0.29.6
remove_properties
method descriptor
remove_properties() -> None
@brief Removes properties for the given container. This will remove all properties on the given container.
This method has been introduced in version 0.28.4.
second_edges
method descriptor
second_edges() -> Edges
@brief Returns the second one of all edges @return An edge collection containing the second edges
select_inside
method descriptor
select_inside() -> EdgePairs
@brief Selects the edge pairs from this edge pair collection which are inside (completely covered by) polygons from the region
@return The edge pair collection after the edge pairs have been selected (self)
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
select_interacting
method descriptor
select_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
select_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
select_interacting()
@brief Selects the edge pairs from this edge pair collection which overlap or touch polygons from the region
@return The edge pair collection after the edge pairs have been selected (self)
This is the in-place version of \interacting - i.e. self is modified rather than a new collection is returned.
This method has been introduced in version 0.29.6
select_not_inside
method descriptor
select_not_inside() -> EdgePairs
@brief Selects the edge pairs from this edge pair collection which are not inside (completely covered by) polygons from the region
@return The edge pair collection after the edge pairs have been selected (self)
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
select_not_interacting
method descriptor
select_not_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
select_not_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> EdgePairs
select_not_interacting()
@brief Selects the edge pairs from this edge pair collection which do not overlap or touch polygons from the region
@return The edge pair collection after the edge pairs have been selected (self)
This is the in-place version of \not_interacting - i.e. self is modified rather than a new collection is returned.
This method has been introduced in version 0.29.6
select_not_outside
method descriptor
select_not_outside() -> EdgePairs
@brief Selects the edge pairs from this edge pair collection which are not outside (partially overlapped by) polygons from the other region
@return The edge pair collection after the edges have been selected (self)
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
select_outside
method descriptor
select_outside() -> EdgePairs
@brief Selects the edge pairs from this edge pair collection which are outside (not overlapped by) polygons from the other region
@return The edge pair collection after the edges have been selected (self)
Edge pairs are considered 'filled' in the context of this operation - i.e. the area between the edges belongs to the edge pair, hence participates in the check.
This method has been introduced in version 0.29.6
size
method descriptor
size() -> int
@brief Returns the (flat) number of edge pairs in the edge pair collection
The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
split_inside
method descriptor
split_inside() -> List[EdgePairs]
@brief Selects the edge pairs from this edge pair collection which are and are not inside (completely covered by) polygons from the other region
@return A two-element list of edge pair collections (first: inside, second: non-inside)
This method provides a faster way to compute both inside and non-inside edge pairs compared to using separate methods. It has been introduced in version 0.29.6.
split_interacting
method descriptor
split_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[EdgePairs]
split_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[EdgePairs]
split_interacting()
@brief Selects the edge pairs from this edge pair collection which do and do not interact with polygons from the other region
@return A two-element list of edge pair collections (first: interacting, second: non-interacting)
This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.29.6.
split_outside
method descriptor
split_outside() -> List[EdgePairs]
@brief Selects the edge pairs from this edge pair collection which are and are not outside (not overlapped by) polygons from the other region
@return A two-element list of edge pair collections (first: outside, second: non-outside)
This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. This method has been introduced in version 0.29.6
swap
method descriptor
swap() -> None
@brief Swap the contents of this collection with the contents of another collection 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
method descriptor
to_s() -> str
to_s(max_count: int) -> str
to_s()
@brief Converts the edge pair collection to a string This version allows specification of the maximum number of edge pairs contained in the string.
transform
method descriptor
transform(t: ICplxTrans) -> EdgePairs
transform(t: IMatrix2d) -> EdgePairs
transform(t: IMatrix3d) -> EdgePairs
transform(t: Trans) -> EdgePairs
transform()
@brief Transform the edge pair collection (modifies self)
Transforms the edge pair collection with the given 3d matrix transformation. This version modifies the edge pair collection and returns a reference to self.
@param t The transformation to apply.
@return The transformed edge pair collection.
This variant has been introduced in version 0.27.
transform_icplx
method descriptor
transform_icplx() -> EdgePairs
@brief Transform the edge pair collection with a complex transformation (modifies self)
Transforms the edge pair collection with the given transformation. This version modifies the edge pair collection and returns a reference to self.
@param t The transformation to apply.
@return The transformed edge pair collection.
transformed
method descriptor
transformed(t: ICplxTrans) -> EdgePairs
transformed(t: IMatrix2d) -> EdgePairs
transformed(t: IMatrix3d) -> EdgePairs
transformed(t: Trans) -> EdgePairs
transformed()
@brief Transform the edge pair collection
Transforms the edge pairs with the given 3d matrix transformation. Does not modify the edge pair collection but returns the transformed edge pairs.
@param t The transformation to apply.
@return The transformed edge pairs.
This variant has been introduced in version 0.27.
transformed_icplx
method descriptor
transformed_icplx() -> EdgePairs
@brief Transform the edge pair collection with a complex transformation
Transforms the edge pairs with the given complex transformation. Does not modify the edge pair collection but returns the transformed edge pairs.
@param t The transformation to apply.
@return The transformed edge pairs.
with_abs_angle
method descriptor
with_abs_angle(angle: float, inverse: bool) -> EdgePairs
with_abs_angle(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs
with_abs_angle()
@brief Filter the edge pairs by orientation of their edges
This method behaves like \with_angle, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up.
This method has been added in version 0.29.1.
with_abs_angle_both
method descriptor
with_abs_angle_both(angle: float, inverse: bool) -> EdgePairs
with_abs_angle_both(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs
with_abs_angle_both()
This method behaves like \with_angle_both, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up.
This method has been added in version 0.29.1.
with_angle
method descriptor
with_angle(angle: float, inverse: bool) -> EdgePairs
with_angle(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs
with_angle(type: Edges.EdgeType, inverse: bool) -> EdgePairs
with_angle()
@brief Filter the edge pairs by orientation of their edges Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having an angle of the given type are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned.
This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \Edges#OrthoEdges, \Edges#DiagonalEdges or \Edges#OrthoDiagonalEdges types.
Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. I.e
@code result = edge_pairs.with_angle(RBA::Edges::Ortho, false) others = edge_pairs.with_angle_both(RBA::Edges::Ortho, true) @/code
This method has been added in version 0.28.
with_angle_both
method descriptor
with_angle_both(angle: float, inverse: bool) -> EdgePairs
with_angle_both(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs
with_angle_both(type: Edges.EdgeType, inverse: bool) -> EdgePairs
with_angle_both()
@brief Filter the edge pairs by orientation of their edges Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having an angle of the given type are returned. If "inverse" is true, edge pairs not fulfilling this criterion for both edges are returned.
This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \Edges#OrthoEdges, \Edges#DiagonalEdges or \Edges#OrthoDiagonalEdges types.
Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. I.e
@code result = edge_pairs.with_angle_both(RBA::Edges::Ortho, false) others = edge_pairs.with_angle(RBA::Edges::Ortho, true) @/code
This method has been added in version 0.28.
with_area
method descriptor
with_area(area: int, inverse: bool) -> EdgePairs
with_area(min_area: int, max_area: int, inverse: bool) -> EdgePairs
with_area()
@brief Filters the edge pairs by the enclosed area Filters the edge pairs in the edge pair collection by enclosed area. If "inverse" is false, only edge pairs with an area between min_area and max_area (max_area itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned.
This method has been added in version 0.27.2.
with_distance
method descriptor
with_distance(distance: int, inverse: bool) -> EdgePairs
with_distance(min_distance: Any, max_distance: Any, inverse: bool) -> EdgePairs
with_distance()
@brief Filters the edge pairs by the distance of the edges Filters the edge pairs in the edge pair collection by distance of the edges. If "inverse" is false, only edge pairs where both edges have a distance between min_distance and max_distance (max_distance itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned.
Distance is measured as the shortest distance between any of the points on the edges.
This method has been added in version 0.27.1.
with_internal_angle
method descriptor
with_internal_angle(angle: float, inverse: bool) -> EdgePairs
with_internal_angle(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs
with_internal_angle()
@brief Filters the edge pairs by the angle between their edges Filters the edge pairs in the edge pair collection by the angle between their edges. If "inverse" is false, only edge pairs with an angle between min_angle and max_angle (max_angle itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned.
The angle is measured between the two edges. It is between 0 (parallel or anti-parallel edges) and 90 degree (perpendicular edges).
With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range.
This method has been added in version 0.27.2.
with_length
method descriptor
with_length(length: int, inverse: bool) -> EdgePairs
with_length(min_length: Any, max_length: Any, inverse: bool) -> EdgePairs
with_length()
@brief Filters the edge pairs by length of one of their edges Filters the edge pairs in the edge pair collection by length of at least one of their edges. If "inverse" is false, only edge pairs with at least one edge having a length between min_length and max_length (excluding max_length itself) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
This method has been added in version 0.27.1.
with_length_both
method descriptor
with_length_both(length: int, inverse: bool) -> EdgePairs
with_length_both(min_length: Any, max_length: Any, inverse: bool) -> EdgePairs
with_length_both()
@brief Filters the edge pairs by length of both of their edges Filters the edge pairs in the edge pair collection by length of both of their edges. If "inverse" is false, only edge pairs with both edges having a length between min_length and max_length (excluding max_length itself) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
This method has been added in version 0.27.1.
write
method descriptor
write() -> None
@brief Writes the region to a file This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell.
This method has been introduced in version 0.29.
EdgeProcessor
@brief The edge processor (boolean, sizing, merge)
The edge processor implements the boolean and edge set operations (size, merge). Because the edge processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times.
Here is a simple example of how to use the edge processor:
@code ep = RBA::EdgeProcessor::new
Prepare two boxes
a = [ RBA::Polygon::new(RBA::Box::new(0, 0, 300, 300)) ] b = [ RBA::Polygon::new(RBA::Box::new(100, 100, 200, 200)) ]
Run an XOR -> creates a polygon with a hole, since the 'resolve_holes' parameter
is false:
out = ep.boolean_p2p(a, b, RBA::EdgeProcessor::ModeXor, false, false) out.to_s # -> [(0,0;0,300;300,300;300,0/100,100;200,100;200,200;100,200)] @/code
ModeANotB
class
ModeANotB: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ModeAnd
class
ModeAnd: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ModeBNotA
class
ModeBNotA: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ModeOr
class
ModeOr: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ModeXor
class
ModeXor: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief The edge processor (boolean, sizing, merge)\n\nThe edge processor implements the boolean and edge set operations (size, merge). Because the edge processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times.\n\nHere is a simple example of how to use the edge processor:\n\n@code\nep = RBA::EdgeProcessor::new\n# Prepare two boxes\na = [ RBA::Polygon::new(RBA::Box::new(0, 0, 300, 300)) ]\nb = [ RBA::Polygon::new(RBA::Box::new(100, 100, 200, 200)) ]\n# Run an XOR -> creates a polygon with a hole, since the 'resolve_holes' parameter\n# is false:\nout = ep.boolean_p2p(a, b, RBA::EdgeProcessor::ModeXor, false, false)\nout.to_s # -> [(0,0;0,300;300,300;300,0/100,100;200,100;200,200;100,200)]\n@/code\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 52
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeProcessor' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> EdgeProcessor
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> EdgeProcessor
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
boolean
method descriptor
boolean(a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]
boolean(a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]
boolean()
@brief Boolean operation for a set of given edges, creating edges
This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param a The input edges (first operand) @param b The input edges (second operand) @param mode The boolean mode (one of the Mode.. values) @return The output edges
boolean_e2e
method descriptor
boolean_e2e() -> List[Edge]
@brief Boolean operation for a set of given edges, creating edges
This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param a The input edges (first operand) @param b The input edges (second operand) @param mode The boolean mode (one of the Mode.. values) @return The output edges
boolean_e2p
method descriptor
boolean_e2p() -> List[Polygon]
@brief Boolean operation for a set of given edges, creating polygons
This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.
This method produces polygons on output and allows fine-tuning of the parameters for that purpose.
Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param a The input polygons (first operand) @param b The input polygons (second operand) @param mode The boolean mode (one of the Mode.. values) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
boolean_p2e
method descriptor
boolean_p2e() -> List[Edge]
@brief Boolean operation for a set of given polygons, creating edges
This method computes the result for the given boolean operation on two sets of polygons. The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
This is a convenience method that bundles filling of the edges, processing with a Boolean operator and puts the result into an output vector.
Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param a The input polygons (first operand) @param b The input polygons (second operand) @param mode The boolean mode @return The output edges
boolean_p2p
method descriptor
boolean_p2p() -> List[Polygon]
@brief Boolean operation for a set of given polygons, creating polygons
This method computes the result for the given boolean operation on two sets of polygons. This method produces polygons on output and allows fine-tuning of the parameters for that purpose.
This is a convenience method that bundles filling of the edges, processing with a Boolean operator and puts the result into an output vector.
Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param a The input polygons (first operand) @param b The input polygons (second operand) @param mode The boolean mode (one of the Mode.. values) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
boolean_to_polygon
method descriptor
boolean_to_polygon(a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
boolean_to_polygon(a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
boolean_to_polygon()
@brief Boolean operation for a set of given edges, creating polygons
This method computes the result for the given boolean operation on two sets of edges. The input edges must form closed contours where holes and hulls must be oriented differently. The input edges are processed with a simple non-zero wrap count rule as a whole.
This method produces polygons on output and allows fine-tuning of the parameters for that purpose.
Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param a The input polygons (first operand) @param b The input polygons (second operand) @param mode The boolean mode (one of the Mode.. values) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
disable_progress
method descriptor
disable_progress() -> None
@brief Disable progress reporting Calling this method will stop the edge processor from showing a progress bar. See \enable_progress.
This method has been introduced in version 0.23.
dup
method descriptor
dup() -> EdgeProcessor
@brief Creates a copy of self
enable_progress
method descriptor
enable_progress() -> None
@brief Enable progress reporting After calling this method, the edge processor will report the progress through a progress bar. 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.
This method has been introduced in version 0.23.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
merge
method descriptor
merge() -> List[Edge]
@brief Merge the given polygons
In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) @return The output edges
merge_p2e
method descriptor
merge_p2e() -> List[Edge]
@brief Merge the given polygons
In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) @return The output edges
merge_p2p
method descriptor
merge_p2p() -> List[Polygon]
@brief Merge the given polygons
In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.
This method produces polygons and allows fine-tuning of the parameters for that purpose.
Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
merge_to_polygon
method descriptor
merge_to_polygon() -> List[Polygon]
@brief Merge the given polygons
In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping polygons do not contribute to higher wrap count areas.
This method produces polygons and allows fine-tuning of the parameters for that purpose.
Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
mode_and
builtin
mode_and() -> int
@brief boolean method's mode value for AND operation
mode_anotb
builtin
mode_anotb() -> int
@brief boolean method's mode value for A NOT B operation
mode_bnota
builtin
mode_bnota() -> int
@brief boolean method's mode value for B NOT A operation
mode_or
builtin
mode_or() -> int
@brief boolean method's mode value for OR operation
mode_xor
builtin
mode_xor() -> int
@brief boolean method's mode value for XOR operation
new
builtin
new() -> EdgeProcessor
@brief Creates a new object of this class
simple_merge
method descriptor
simple_merge(in_: Sequence[Edge]) -> List[Edge]
simple_merge(in_: Sequence[Edge], mode: int) -> List[Edge]
simple_merge(in_: Sequence[Polygon]) -> List[Edge]
simple_merge(in_: Sequence[Polygon], mode: int) -> List[Edge]
simple_merge()
@brief Merge the given polygons and specify the merge mode
The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.
This method has been added in version 0.22.
The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).
@param mode See description @param in The input edges @return The output edges
simple_merge_e2e
method descriptor
simple_merge_e2e(in_: Sequence[Edge]) -> List[Edge]
simple_merge_e2e(in_: Sequence[Edge], mode: int) -> List[Edge]
simple_merge_e2e()
@brief Merge the given polygons and specify the merge mode
The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.
This method has been added in version 0.22.
The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).
@param mode See description @param in The input edges @return The output edges
simple_merge_e2p
method descriptor
simple_merge_e2p(in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]
simple_merge_e2p(in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]
simple_merge_e2p()
@brief Merge the given polygons and specify the merge mode
The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.
This method produces polygons and allows fine-tuning of the parameters for that purpose.
This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.
This method has been added in version 0.22.
The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).
@param mode See description @param in The input edges @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
simple_merge_p2e
method descriptor
simple_merge_p2e(in_: Sequence[Polygon]) -> List[Edge]
simple_merge_p2e(in_: Sequence[Polygon], mode: int) -> List[Edge]
simple_merge_p2e()
@brief Merge the given polygons and specify the merge mode
The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.
The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while holes are oriented counter-clockwise.
This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.
This method has been added in version 0.22.
The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).
@param mode See description @param in The input polygons @return The output edges
simple_merge_p2p
method descriptor
simple_merge_p2p(in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]
simple_merge_p2p(in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]
simple_merge_p2p()
@brief Merge the given polygons and specify the merge mode
The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they have different orientation (since a polygon is oriented by construction that is not easy to achieve). The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before merging them. "simple_merge" is somewhat faster and consumes less memory.
This method produces polygons and allows fine-tuning of the parameters for that purpose.
This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.
This method has been added in version 0.22.
The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).
@param mode See description @param in The input polygons @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
simple_merge_to_polygon
method descriptor
simple_merge_to_polygon(in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]
simple_merge_to_polygon(in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]
simple_merge_to_polygon(in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]
simple_merge_to_polygon(in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]
simple_merge_to_polygon()
@brief Merge the given polygons and specify the merge mode
The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. Overlapping contours are merged when the orientation is the same.
This method produces polygons and allows fine-tuning of the parameters for that purpose.
This is a convenience method that bundles filling of the edges, processing with a SimpleMerge operator and puts the result into an output vector.
This method has been added in version 0.22.
The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule).
@param mode See description @param in The input edges @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
size
method descriptor
size(in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]
size(in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]
size()
@brief Size the given polygons (isotropic)
This method is equivalent to calling the anisotropic version with identical dx and dy.
Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param d The sizing value in x direction @param mode The sizing mode @return The output edges
size_p2e
method descriptor
size_p2e(in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]
size_p2e(in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]
size_p2e()
@brief Size the given polygons (isotropic)
This method is equivalent to calling the anisotropic version with identical dx and dy.
Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param d The sizing value in x direction @param mode The sizing mode @return The output edges
size_p2p
method descriptor
size_p2p(in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_p2p(in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_p2p()
@brief Size the given polygons into polygons (isotropic)
This method is equivalent to calling the anisotropic version with identical dx and dy.
Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param d The sizing value in x direction @param mode The sizing mode @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
size_to_polygon
method descriptor
size_to_polygon(in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_to_polygon(in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_to_polygon()
@brief Size the given polygons into polygons (isotropic)
This method is equivalent to calling the anisotropic version with identical dx and dy.
Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated.
@param in The input polygons @param d The sizing value in x direction @param mode The sizing mode @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if touching corners should be resolved into less connected contours @return The output polygons
EdgeToEdgePairOperator
@brief A generic edge-to-edge-pair operator
Edge processors are an efficient way to process edges from an edge collection. To apply a processor, derive your own operator class and pass an instance to the \Edges#processed method.
Conceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output edge pairs derived from the input edge. The output edge pair collection is the sum over all these individual results.
The magic happens when deep mode edge collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \EdgeOperator class, with the exception that this incarnation has to deliver edge pairs.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge-to-edge-pair operator\n\nEdge processors are an efficient way to process edges from an edge collection. To apply a processor, derive your own operator class and pass an instance to the \\Edges#processed method.\n\nConceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output edge pairs derived from the input edge.\nThe output edge pair collection is the sum over all these individual results.\n\nThe magic happens when deep mode edge collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\EdgeOperator class, with the exception that this incarnation has to deliver edge pairs.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 56
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeToEdgePairOperator' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'EdgeToEdgePairOperator' objects>
@brief Gets a value indicating whether the processor needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the processor needs raw (unmerged) input This flag must be set before using this processor. It tells the processor implementation whether the processor wants to have raw input (unmerged). The default value is 'false', meaning that the processor will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
result_is_merged
class
result_is_merged: bool = <attribute 'result_is_merged' of 'EdgeToEdgePairOperator' objects>
@brief Gets a value indicating whether the processor delivers merged output See \result_is_merged= for details.
@brief Sets a value indicating whether the processor delivers merged output This flag must be set before using this processor. If the processor maintains the merged condition by design (output is merged if input is), it is a good idea to set this predicate to 'true'. This will avoid additional merge steps when the resulting collection is used in further operations that need merged input .
result_must_not_be_merged
class
result_must_not_be_merged: bool = <attribute 'result_must_not_be_merged' of 'EdgeToEdgePairOperator' objects>
@brief Gets a value indicating whether the processor's output must not be merged See \result_must_not_be_merged= for details.
@brief Sets a value indicating whether the processor's output must not be merged This flag must be set before using this processor. The processor can set this flag if it wants to deliver shapes that must not be merged - e.g. point-like edges or strange or degenerated polygons. .
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgeToEdgePairOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> EdgeToEdgePairOperator
@brief Creates a new object of this class
EdgeToPolygonOperator
@brief A generic edge-to-polygon operator
Edge processors are an efficient way to process edges from an edge collection. To apply a processor, derive your own operator class and pass an instance to the \Edges#processed method.
Conceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output polygons derived from the input edge. The output region is the sum over all these individual results.
The magic happens when deep mode edge collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \EdgeOperator class, with the exception that this incarnation has to deliver edges.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic edge-to-polygon operator\n\nEdge processors are an efficient way to process edges from an edge collection. To apply a processor, derive your own operator class and pass an instance to the \\Edges#processed method.\n\nConceptually, these methods take each edge from the edge collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output polygons derived from the input edge.\nThe output region is the sum over all these individual results.\n\nThe magic happens when deep mode edge collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\EdgeOperator class, with the exception that this incarnation has to deliver edges.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 55
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeToPolygonOperator' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'EdgeToPolygonOperator' objects>
@brief Gets a value indicating whether the processor needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the processor needs raw (unmerged) input This flag must be set before using this processor. It tells the processor implementation whether the processor wants to have raw input (unmerged). The default value is 'false', meaning that the processor will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
result_is_merged
class
result_is_merged: bool = <attribute 'result_is_merged' of 'EdgeToPolygonOperator' objects>
@brief Gets a value indicating whether the processor delivers merged output See \result_is_merged= for details.
@brief Sets a value indicating whether the processor delivers merged output This flag must be set before using this processor. If the processor maintains the merged condition by design (output is merged if input is), it is a good idea to set this predicate to 'true'. This will avoid additional merge steps when the resulting collection is used in further operations that need merged input .
result_must_not_be_merged
class
result_must_not_be_merged: bool = <attribute 'result_must_not_be_merged' of 'EdgeToPolygonOperator' objects>
@brief Gets a value indicating whether the processor's output must not be merged See \result_must_not_be_merged= for details.
@brief Sets a value indicating whether the processor's output must not be merged This flag must be set before using this processor. The processor can set this flag if it wants to deliver shapes that must not be merged - e.g. point-like edges or strange or degenerated polygons. .
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'EdgeToPolygonOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> EdgeToPolygonOperator
@brief Creates a new object of this class
Edges
Bases: klayout.dbcore.ShapeCollection
@brief 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.
AlwaysIncludeZeroDistance
class
AlwaysIncludeZeroDistance: ZeroDistanceMode = AlwaysIncludeZeroDistance (4)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
DiagonalEdges
class
DiagonalEdges: EdgeType = DiagonalEdges (1)
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
DifferentPropertiesConstraint
class
DifferentPropertiesConstraint: PropertyConstraint = DifferentPropertiesConstraint (4)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
DifferentPropertiesConstraintDrop
class
DifferentPropertiesConstraintDrop: PropertyConstraint = DifferentPropertiesConstraintDrop (5)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
Euclidian
class
Euclidian: Metrics = Euclidian (1)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
IgnoreProperties
class
IgnoreProperties: PropertyConstraint = IgnoreProperties (0)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
IncludeZeroDistanceWhenCollinearAndTouching
class
IncludeZeroDistanceWhenCollinearAndTouching: ZeroDistanceMode = IncludeZeroDistanceWhenCollinearAndTouching (2)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenOverlapping
class
IncludeZeroDistanceWhenOverlapping: ZeroDistanceMode = IncludeZeroDistanceWhenOverlapping (3)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenTouching
class
IncludeZeroDistanceWhenTouching: ZeroDistanceMode = IncludeZeroDistanceWhenTouching (1)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
NeverIncludeZeroDistance
class
NeverIncludeZeroDistance: ZeroDistanceMode = NeverIncludeZeroDistance (0)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
NoPropertyConstraint
class
NoPropertyConstraint: PropertyConstraint = NoPropertyConstraint (1)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
OrthoDiagonalEdges
class
OrthoDiagonalEdges: EdgeType = OrthoDiagonalEdges (2)
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
OrthoEdges
class
OrthoEdges: EdgeType = OrthoEdges (0)
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
Projection
class
Projection: Metrics = Projection (3)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
SamePropertiesConstraint
class
SamePropertiesConstraint: PropertyConstraint = SamePropertiesConstraint (2)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
SamePropertiesConstraintDrop
class
SamePropertiesConstraintDrop: PropertyConstraint = SamePropertiesConstraintDrop (3)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
Square
class
Square: Metrics = Square (2)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = "@brief A collection of edges (Not necessarily describing closed contours)\n\n\nThis 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).\n\nThe 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.\n\nEdge 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. \nEdge 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.\nOverlapping parts are counted once in that mode. Dot-like edges are not considered in merged semantics.\nIn raw mode (without merged semantics), each edge is considered as it is. Overlaps between edges\nmay exists and merging has to be done explicitly using the \\merge method. The semantics can be\nselected using \\merged_semantics=.\n\n\nThis class has been introduced in version 0.23.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 203
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
merged_semantics
class
merged_semantics: bool = <attribute 'merged_semantics' of 'Edges' objects>
@brief Gets a flag indicating whether merged semantics is enabled See \merged_semantics= for a description of this attribute.
@brief Enable or disable merged semantics If merged semantics is enabled (the default), colinear, connected or overlapping edges will be considered as single edges.
EdgeType
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
DiagonalEdges
class
DiagonalEdges: EdgeType = DiagonalEdges (1)
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
OrthoDiagonalEdges
class
OrthoDiagonalEdges: EdgeType = OrthoDiagonalEdges (2)
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
OrthoEdges
class
OrthoEdges: EdgeType = OrthoEdges (0)
@brief This enum specifies the edge type for edge angle filters.
This enum was introduced in version 0.28.
__doc__
class
__doc__ = '@brief This enum specifies the edge type for edge angle filters.\n\nThis enum was introduced in version 0.28.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 204
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EdgeType' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Edges.EdgeType) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> Edges.EdgeType
new(s: str) -> Edges.EdgeType
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__add__
method descriptor
__add__() -> Edges
@brief Returns the combined edge set of self and the other one
@return 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.
The 'join' alias has been introduced in version 0.28.12.
__and__
method descriptor
__and__(other: Edges) -> Edges
__and__(other: Region) -> Edges
__and__()
@brief Returns the parts of the edges inside the given region
@return 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.The 'and' alias has been introduced in version 0.28.12.
__copy__
method descriptor
__copy__() -> Edges
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Edges
@brief Creates a copy of self
__getitem__
method descriptor
__getitem__() -> Edge
@brief Returns the nth edge of the collection
This method returns nil if the index is out of range. It is available for flat edge collections only - i.e. those for which \has_valid_edges? is true. Use \flatten to explicitly flatten an edge collection. This method returns the raw edge (not merged edges, even if merged semantics is enabled).
The \each iterator is the more general approach to access the edges.
__iadd__
method descriptor
__iadd__() -> Edges
@brief Adds the edges of the other edge collection to self
@return 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.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
__iand__
method descriptor
__iand__(other: Edges) -> Edges
__iand__(other: Region) -> Edges
__iand__()
@brief Selects the parts of the edges inside the given region in-place (modifying self)
@return 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. Note that in Ruby, the '&=' operator actually does not exist, but is emulated by '&' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'and_with' instead.
The 'and_with' alias has been introduced in version 0.28.12.
__init__
method descriptor
__init__() -> None
__init__(array: Sequence[Edge]) -> None
__init__(array: Sequence[Polygon]) -> None
__init__(box: Box) -> None
__init__(edge: Edge) -> None
__init__(path: Path) -> None
__init__(polygon: Polygon) -> None
__init__(polygon: SimplePolygon) -> None
__init__(shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> None
__init__(shapes: Shapes, as_edges: Optional[bool] = ...) -> None
__init__()
@brief Constructor from a text set
@param shape_iterator The iterator from which to derive the texts @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. @param expr The selection string @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact.
This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available:
@code region = RBA::Region::new(iter, dss, "") # all texts region = RBA::Region::new(iter, dss, "A") # all texts starting with an 'A' region = RBA::Region::new(iter, dss, "A", false) # all texts exactly matching 'A' @/code
This method has been introduced in version 0.26.
__ior__
method descriptor
__ior__() -> Edges
@brief Performs the boolean OR between self and the other edge set in-place (modifying self)
@return 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. Note that in Ruby, the '|=' operator actually does not exist, but is emulated by '|' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'or_with' instead.
The 'or_with' alias has been introduced in version 0.28.12.
__isub__
method descriptor
__isub__(other: Edges) -> Edges
__isub__(other: Region) -> Edges
__isub__()
@brief Selects the parts of the edges outside the given region in-place (modifying self)
@return 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.
Note that in Ruby, the '-=' operator actually does not exist, but is emulated by '-' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'not_with' instead.
This method has been introduced in version 0.24.The 'not_with' alias has been introduced in version 0.28.12.
__iter__
method descriptor
__iter__() -> Iterator[Edge]
@brief Returns each edge of the region
__ixor__
method descriptor
__ixor__() -> Edges
@brief Performs the boolean XOR between self and the other edge collection in-place (modifying self)
@return 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.
Note that in Ruby, the '^=' operator actually does not exist, but is emulated by '^' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'xor_with' instead.
The 'xor_with' alias has been introduced in version 0.28.12.
__len__
method descriptor
__len__() -> int
@brief Returns the (flat) number of edges in the edge collection
This returns the number of raw edges (not merged edges if merged semantics is enabled). The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
__or__
method descriptor
__or__() -> Edges
@brief Returns the boolean OR between self and the other edge set
@return 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. The 'or' alias has been introduced in version 0.28.12.
__repr__
method descriptor
__repr__() -> str
@brief 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.
__str__
method descriptor
__str__() -> str
@brief 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.
__sub__
method descriptor
__sub__(other: Edges) -> Edges
__sub__(other: Region) -> Edges
__sub__()
@brief Returns the parts of the edges outside the given region
@return 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.The 'not' alias has been introduced in version 0.28.12.
__xor__
method descriptor
__xor__() -> Edges
@brief Returns the boolean XOR between self and the other edge collection
@return 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.
The 'xor' alias has been introduced in version 0.28.12.
and_
method descriptor
and_(other: Edges) -> Edges
and_(other: Region) -> Edges
and_()
@brief Returns the parts of the edges inside the given region
@return 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.The 'and' alias has been introduced in version 0.28.12.
and_with
method descriptor
and_with(other: Edges) -> Edges
and_with(other: Region) -> Edges
and_with()
@brief Selects the parts of the edges inside the given region in-place (modifying self)
@return 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. Note that in Ruby, the '&=' operator actually does not exist, but is emulated by '&' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'and_with' instead.
The 'and_with' alias has been introduced in version 0.28.12.
andnot
method descriptor
andnot(other: Edges) -> List[Edges]
andnot(other: Region) -> List[Edges]
andnot()
@brief Returns the boolean AND and NOT between self and the region
@return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result
This method will compute the boolean AND and NOT simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately.
This method has been added in version 0.28.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Returns the bounding box of the edge collection The bounding box is the box enclosing all points of all edges.
centers
method descriptor
centers() -> Edges
@brief Returns edges representing the center part of the edges @return A new collection of edges representing the part around the center This method allows one 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:
@code 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 @/code
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
method descriptor
clear() -> None
@brief Clears the edge collection
count
method descriptor
count() -> int
@brief Returns the (flat) number of edges in the edge collection
This returns the number of raw edges (not merged edges if merged semantics is enabled). The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
create
method descriptor
create() -> None
@brief 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.
data_id
method descriptor
data_id() -> int
@brief Returns the data ID (a unique identifier for the underlying data storage)
This method has been added in version 0.26.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
disable_progress
method descriptor
disable_progress() -> None
@brief Disable progress reporting Calling this method will disable progress reporting. See \enable_progress.
dup
method descriptor
dup() -> Edges
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[Edge]
@brief Returns each edge of the region
each_merged
method descriptor
each_merged() -> Iterator[Edge]
@brief 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
method descriptor
enable_progress() -> None
@brief 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.
enable_properties
method descriptor
enable_properties() -> None
@brief Enables properties for the given container. This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key.
This method has been introduced in version 0.28.4.
enclosed_check
method descriptor
enclosed_check() -> EdgePairs
@brief Performs an inside check with options @param d The minimum distance for which the edges are checked @param other The other edge collection against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
The 'enclosed_check' alias was introduced in version 0.27.5. 'zero_distance_mode' has been added in version 0.29.
enclosing_check
method descriptor
enclosing_check() -> EdgePairs
@brief Performs an enclosing check with options @param d The minimum distance for which the edges are checked @param other The other edge collection against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
'zero_distance_mode' has been added in version 0.29.
end_segments
method descriptor
end_segments() -> Edges
@brief Returns edges representing a part of the edge before the end point @return A new collection of edges representing the end part This method allows one 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:
@code 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 @/code
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
method descriptor
extended() -> Region
@brief Returns a region with shapes representing the edges with the specified extensions @param b the parallel extension at the start point of the edge @param e the parallel extension at the end point of the edge @param o the perpendicular extension to the "outside" (left side as seen in the direction of the edge) @param i the perpendicular extension to the "inside" (right side as seen in the direction of the edge) @param join If true, connected edges are joined before the extension is applied @return A region containing the polygons representing these extended edges This is a generic version of \extended_in and \extended_out. It allows one 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
method descriptor
extended_in() -> Region
@brief Returns a region with shapes representing the edges with the given width @param e The extension width @return 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
method descriptor
extended_out() -> Region
@brief Returns a region with shapes representing the edges with the given width @param e The extension width @return 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
method descriptor
extents() -> Region
extents(d: int) -> Region
extents(dx: int, dy: int) -> Region
extents()
@brief 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.
filter
method descriptor
filter() -> None
@brief Applies a generic filter in place (replacing the edges from the Edges collection) See \EdgeFilter for a description of this feature.
This method has been introduced in version 0.29.
filter_properties
method descriptor
filter_properties() -> None
@brief Filters properties by certain keys. Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
filtered
method descriptor
filtered() -> Edges
@brief Applies a generic filter and returns a filtered copy See \EdgeFilter for a description of this feature.
This method has been introduced in version 0.29.
flatten
method descriptor
flatten() -> None
@brief Explicitly flattens an edge collection
If the collection is already flat (i.e. \has_valid_edges? returns true), this method will not change it.
This method has been introduced in version 0.26.
has_valid_edges
method descriptor
has_valid_edges() -> bool
@brief Returns true if the edge collection is flat and individual edges can be accessed randomly
This method has been introduced in version 0.26.
hier_count
method descriptor
hier_count() -> int
@brief Returns the (hierarchical) number of edges in the edge collection
This returns the number of raw edges (not merged edges if merged semantics is enabled). The count is computed 'hierarchical', i.e. edges inside a cell are counted once even if the cell is instantiated multiple times.
This method has been introduced in version 0.27.
in_
method descriptor
in_() -> Edges
@brief 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.
in_and_out
method descriptor
in_and_out() -> List[Edges]
@brief Returns all polygons which are members and not members of the other region This method is equivalent to calling \members_of and \not_members_of, but delivers both results at the same time and is more efficient than two separate calls. The first element returned is the \members_of part, the second is the \not_members_of part.
This method has been introduced in version 0.28.
insert
method descriptor
insert(box: Box) -> None
insert(edge: Edge) -> None
insert(edges: Edges) -> None
insert(edges: Sequence[Edge]) -> None
insert(path: Path) -> None
insert(polygon: Polygon) -> None
insert(polygon: SimplePolygon) -> None
insert(polygons: Sequence[Polygon]) -> None
insert(region: Region) -> None
insert(shape_iterator: RecursiveShapeIterator) -> None
insert(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None
insert(shapes: Shapes) -> None
insert(shapes: Shapes, trans: ICplxTrans) -> None
insert(shapes: Shapes, trans: Trans) -> None
insert()
@brief Inserts all edges from the array into this edge collection
insert_into
method descriptor
insert_into() -> None
@brief Inserts this edge collection into the given layout, below the given cell and into the given layer. If the edge collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused.
This method has been introduced in version 0.26.
inside
method descriptor
inside(other: Edges) -> Edges
inside(other: Region) -> Edges
inside()
@brief Returns the edges from this edge collection which are inside (completely covered by) polygons from the region
@return A new edge collection containing the the selected edges
This method has been introduced in version 0.28.
inside_check
method descriptor
inside_check() -> EdgePairs
@brief Performs an inside check with options @param d The minimum distance for which the edges are checked @param other The other edge collection against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
The 'enclosed_check' alias was introduced in version 0.27.5. 'zero_distance_mode' has been added in version 0.29.
inside_outside_part
method descriptor
inside_outside_part() -> List[Edges]
@brief Returns the partial edges inside and outside the given region
@return A two-element array of edge collections with the first one being the \inside_part result and the second one being the \outside_part result
This method will compute the results simultaneously. Because this requires a single sweep only, using this method is faster than doing \inside_part and \outside_part separately.
This method has been added in version 0.28.
inside_part
method descriptor
inside_part() -> Edges
@brief Returns the parts of the edges of this edge collection which are inside the polygons of the region
@return 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
method descriptor
interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
interacting()
@brief Returns the edges from this edge collection which overlap or touch polygons from the region
@return A new edge collection containing the edges overlapping or touching polygons from the region
'min_count' and 'max_count' impose a constraint on the number of times an edge of this collection has to interact with (different) polygons of the other region to make the edge selected. An edge is selected by this method if the number of polygons interacting with an edge of this collection is between min_count and max_count (including max_count).
'min_count' and 'max_count' have been introduced in version 0.29.
intersections
method descriptor
intersections() -> Edges
@brief Computes the intersections between this edges and other edges This computation is like an AND operation, but also including crossing points between non-coincident edges as degenerated (point-like) edges.
This method has been introduced in version 0.26.2
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_deep
method descriptor
is_deep() -> bool
@brief Returns true if the edge collection is a deep (hierarchical) one
This method has been added in version 0.26.
is_empty
method descriptor
is_empty() -> bool
@brief Returns true if the edge collection is empty
is_merged
method descriptor
is_merged() -> bool
@brief 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.
join
method descriptor
join() -> Edges
@brief Returns the combined edge set of self and the other one
@return 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.
The 'join' alias has been introduced in version 0.28.12.
join_with
method descriptor
join_with() -> Edges
@brief Adds the edges of the other edge collection to self
@return 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.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
length
method descriptor
length() -> int
length(rect: Box) -> int
length()
@brief 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)
map_properties
method descriptor
map_properties() -> None
@brief Maps properties by name key. Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
members_of
method descriptor
members_of() -> Edges
@brief 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.
merge
method descriptor
merge() -> Edges
@brief Merge the edges
@return 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
method descriptor
merged() -> Edges
@brief Returns the merged edge collection
@return 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.
move
method descriptor
move(v: Vector) -> Edges
move(x: int, y: int) -> Edges
move()
@brief Moves the edge collection
Moves the edge collection by the given offset and returns the moved edge collection. The edge collection is overwritten.
@param x The x distance to move the edge collection. @param y The y distance to move the edge collection.
@return The moved edge collection (self).
moved
method descriptor
moved(v: Vector) -> Edges
moved(x: int, v: int) -> Edges
moved()
@brief Returns the moved edge collection (does not modify self)
Moves the edge collection by the given offset and returns the moved edge collection. The edge collection is not modified.
@param x The x distance to move the edge collection. @param y The y distance to move the edge collection.
@return The moved edge collection.
new
builtin
new() -> Edges
new(array: Sequence[Edge]) -> Edges
new(array: Sequence[Polygon]) -> Edges
new(box: Box) -> Edges
new(edge: Edge) -> Edges
new(path: Path) -> Edges
new(polygon: Polygon) -> Edges
new(polygon: SimplePolygon) -> Edges
new(shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> Edges
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> Edges
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> Edges
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges
new(shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> Edges
new(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges
new(shapes: Shapes, as_edges: Optional[bool] = ...) -> Edges
new()
@brief Constructor from a text set
@param shape_iterator The iterator from which to derive the texts @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. @param expr The selection string @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact.
This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available:
@code region = RBA::Region::new(iter, dss, "") # all texts region = RBA::Region::new(iter, dss, "A") # all texts starting with an 'A' region = RBA::Region::new(iter, dss, "A", false) # all texts exactly matching 'A' @/code
This method has been introduced in version 0.26.
not_
method descriptor
not_(other: Edges) -> Edges
not_(other: Region) -> Edges
not_()
@brief Returns the parts of the edges outside the given region
@return 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.The 'not' alias has been introduced in version 0.28.12.
not_in
method descriptor
not_in() -> Edges
@brief 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.
not_inside
method descriptor
not_inside(other: Edges) -> Edges
not_inside(other: Region) -> Edges
not_inside()
@brief Returns the edges from this edge collection which are not inside (completely covered by) polygons from the region
@return A new edge collection containing the the selected edges
This method has been introduced in version 0.28.
not_interacting
method descriptor
not_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
not_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
not_interacting()
@brief Returns the edges from this edge collection which do not overlap or touch polygons from the region
@return A new edge collection containing the edges not overlapping or touching polygons from the region
'min_count' and 'max_count' impose a constraint on the number of times an edge of this collection has to interact with (different) polygons of the other region to make the edge selected. An edge is not selected by this method if the number of polygons interacting with an edge of this collection is between min_count and max_count (including max_count).
'min_count' and 'max_count' have been introduced in version 0.29.
not_members_of
method descriptor
not_members_of() -> Edges
@brief 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.
not_outside
method descriptor
not_outside(other: Edges) -> Edges
not_outside(other: Region) -> Edges
not_outside()
@brief Returns the edges from this edge collection which are not outside (partially overlapped by) polygons from the region
@return A new edge collection containing the the selected edges
This method has been introduced in version 0.28.
not_with
method descriptor
not_with(other: Edges) -> Edges
not_with(other: Region) -> Edges
not_with()
@brief Selects the parts of the edges outside the given region in-place (modifying self)
@return 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.
Note that in Ruby, the '-=' operator actually does not exist, but is emulated by '-' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'not_with' instead.
This method has been introduced in version 0.24.The 'not_with' alias has been introduced in version 0.28.12.
or_
method descriptor
or_() -> Edges
@brief Returns the boolean OR between self and the other edge set
@return 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. The 'or' alias has been introduced in version 0.28.12.
or_with
method descriptor
or_with() -> Edges
@brief Performs the boolean OR between self and the other edge set in-place (modifying self)
@return 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. Note that in Ruby, the '|=' operator actually does not exist, but is emulated by '|' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'or_with' instead.
The 'or_with' alias has been introduced in version 0.28.12.
outside
method descriptor
outside(other: Edges) -> Edges
outside(other: Region) -> Edges
outside()
@brief Returns the edges from this edge collection which are outside (not overlapped by) polygons from the region
@return A new edge collection containing the the selected edges
This method has been introduced in version 0.28.
outside_part
method descriptor
outside_part() -> Edges
@brief Returns the parts of the edges of this edge collection which are outside the polygons of the region
@return 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
method descriptor
overlap_check() -> EdgePairs
@brief Performs an overlap check with options @param d The minimum distance for which the edges are checked @param other The other edge collection against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
'zero_distance_mode' has been added in version 0.29.
process
method descriptor
process() -> None
@brief Applies a generic edge processor in place (replacing the edges from the Edges collection) See \EdgeProcessor for a description of this feature.
This method has been introduced in version 0.29.
processed
method descriptor
processed(processed: EdgeOperator) -> Edges
processed(processed: EdgeToEdgePairOperator) -> EdgePairs
processed(processed: EdgeToPolygonOperator) -> Region
processed()
@brief Applies a generic edge-to-polygon processor and returns an edge collection with the results See \EdgeToPolygonProcessor for a description of this feature.
This method has been introduced in version 0.29.
pull_interacting
method descriptor
pull_interacting(other: Edges) -> Edges
pull_interacting(other: Region) -> Region
pull_interacting()
@brief Returns all edges of "other" which are interacting with polygons of this edge set See the other \pull_interacting version for more details.
@return The edge collection after the edges have been selected (from other)
Merged semantics applies for this method (see \merged_semantics= of merged semantics)
This method has been introduced in version 0.26.1
remove_properties
method descriptor
remove_properties() -> None
@brief Removes properties for the given container. This will remove all properties on the given container.
This method has been introduced in version 0.28.4.
select_inside
method descriptor
select_inside(other: Edges) -> Edges
select_inside(other: Region) -> Edges
select_inside()
@brief Selects the edges from this edge collection which are inside (completely covered by) polygons from the region
@return The edge collection after the edges have been selected (self)
This method has been introduced in version 0.28.
select_inside_part
method descriptor
select_inside_part() -> Edges
@brief Selects the parts of the edges from this edge collection which are inside the polygons of the given region
@return 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
method descriptor
select_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
select_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
select_interacting()
@brief Selects the edges from this edge collection which overlap or touch polygons from the region
@return The edge collection after the edges have been selected (self)
This is the in-place version of \interacting - i.e. self is modified rather than a new collection is returned.
'min_count' and 'max_count' have been introduced in version 0.29.
select_not_inside
method descriptor
select_not_inside(other: Edges) -> Edges
select_not_inside(other: Region) -> Edges
select_not_inside()
@brief Selects the edges from this edge collection which are not inside (completely covered by) polygons from the region
@return The edge collection after the edges have been selected (self)
This method has been introduced in version 0.28.
select_not_interacting
method descriptor
select_not_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
select_not_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Edges
select_not_interacting()
@brief Selects the edges from this edge collection which do not overlap or touch polygons from the region
@return The edge collection after the edges have been selected (self)
This is the in-place version of \not_interacting - i.e. self is modified rather than a new collection is returned.
'min_count' and 'max_count' have been introduced in version 0.29.
select_not_outside
method descriptor
select_not_outside(other: Edges) -> Edges
select_not_outside(other: Region) -> Edges
select_not_outside()
@brief Selects the edges from this edge collection which are not outside (partially overlapped by) polygons from the region
@return The edge collection after the edges have been selected (self)
This method has been introduced in version 0.28.
select_outside
method descriptor
select_outside(other: Edges) -> Edges
select_outside(other: Region) -> Edges
select_outside()
@brief Selects the edges from this edge collection which are outside (not overlapped by) polygons from the region
@return The edge collection after the edges have been selected (self)
This method has been introduced in version 0.28.
select_outside_part
method descriptor
select_outside_part() -> Edges
@brief Selects the parts of the edges from this edge collection which are outside the polygons of the given region
@return 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
method descriptor
separation_check() -> EdgePairs
@brief Performs an overlap check with options @param d The minimum distance for which the edges are checked @param other The other edge collection against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
'zero_distance_mode' has been added in version 0.29.
size
method descriptor
size() -> int
@brief Returns the (flat) number of edges in the edge collection
This returns the number of raw edges (not merged edges if merged semantics is enabled). The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
space_check
method descriptor
space_check() -> EdgePairs
@brief Performs a space check with options @param d The minimum distance for which the edges are checked @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
'zero_distance_mode' has been added in version 0.29.
split_inside
method descriptor
split_inside(other: Edges) -> List[Edges]
split_inside(other: Region) -> List[Edges]
split_inside()
@brief Selects the edges from this edge collection which are and are not inside (completely covered by) polygons from the other region
@return A two-element list of edge collections (first: inside, second: non-inside)
This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28.
split_interacting
method descriptor
split_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Edges]
split_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Edges]
split_interacting()
@brief Selects the edges from this edge collection which do and do not interact with polygons from the other region
@return A two-element list of edge collections (first: interacting, second: non-interacting)
This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. 'min_count' and 'max_count' have been introduced in version 0.29.
split_outside
method descriptor
split_outside(other: Edges) -> List[Edges]
split_outside(other: Region) -> List[Edges]
split_outside()
@brief Selects the edges from this edge collection which are and are not outside (not overlapped by) polygons from the other region
@return A two-element list of edge collections (first: outside, second: non-outside)
This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28.
start_segments
method descriptor
start_segments() -> Edges
@brief Returns edges representing a part of the edge after the start point @return A new collection of edges representing the start part This method allows one 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:
@code 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 @/code
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
method descriptor
swap() -> None
@brief 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
method descriptor
to_s() -> str
to_s(max_count: int) -> str
to_s()
@brief Converts the edge collection to a string This version allows specification of the maximum number of edges contained in the string.
transform
method descriptor
transform(t: ICplxTrans) -> Edges
transform(t: IMatrix2d) -> Edges
transform(t: IMatrix3d) -> Edges
transform(t: Trans) -> Edges
transform()
@brief Transform the edge collection (modifies self)
Transforms the edge collection with the given 3d matrix transformation. This version modifies the edge collection and returns a reference to self.
@param t The transformation to apply.
@return The transformed edge collection.
This variant has been introduced in version 0.27.
transform_icplx
method descriptor
transform_icplx() -> Edges
@brief Transform the edge collection with a complex transformation (modifies self)
Transforms the edge collection with the given transformation. This version modifies the edge collection and returns a reference to self.
@param t The transformation to apply.
@return The transformed edge collection.
transformed
method descriptor
transformed(t: ICplxTrans) -> Edges
transformed(t: IMatrix2d) -> Edges
transformed(t: IMatrix3d) -> Edges
transformed(t: Trans) -> Edges
transformed()
@brief Transform the edge collection
Transforms the edge collection with the given 3d matrix transformation. Does not modify the edge collection but returns the transformed edge collection.
@param t The transformation to apply.
@return The transformed edge collection.
This variant has been introduced in version 0.27.
transformed_icplx
method descriptor
transformed_icplx() -> Edges
@brief Transform the edge collection with a complex transformation
Transforms the edge collection with the given complex transformation. Does not modify the edge collection but returns the transformed edge collection.
@param t The transformation to apply.
@return The transformed edge collection.
width_check
method descriptor
width_check() -> EdgePairs
@brief Performs a width check with options @param d The minimum width for which the edges are checked @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The threshold angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper threshold of the projected length of one edge onto another @param zero_distance_mode Specifies how to handle edges with zero distance
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 selecting 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.
'zero_distance_mode' has been added in version 0.29.
with_abs_angle
method descriptor
with_abs_angle(angle: float, inverse: bool) -> Edges
with_abs_angle(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges
with_abs_angle()
@brief Filter the edges by orientation
This method behaves like \with_angle, but angles are always positive - i.e. there is no differentiation between edges sloping 'down' vs. edges sloping 'up.
This method has been added in version 0.29.1.
with_angle
method descriptor
with_angle(angle: float, inverse: bool) -> Edges
with_angle(min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges
with_angle(type: Edges.EdgeType, inverse: bool) -> Edges
with_angle()
@brief Filters the edges by orientation type Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have an angle of the given type are returned. If "inverse" is true, edges which do not conform to this criterion are returned.
This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \OrthoEdges, \DiagonalEdges or \OrthoDiagonalEdges types.
This method has been added in version 0.28.
with_length
method descriptor
with_length(length: int, inverse: bool) -> Edges
with_length(min_length: Any, max_length: Any, inverse: bool) -> Edges
with_length()
@brief Filters 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.
write
method descriptor
write() -> None
@brief Writes the region to a file This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell.
This method has been introduced in version 0.29.
xor
method descriptor
xor() -> Edges
@brief Returns the boolean XOR between self and the other edge collection
@return 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.
The 'xor' alias has been introduced in version 0.28.12.
xor_with
method descriptor
xor_with() -> Edges
@brief Performs the boolean XOR between self and the other edge collection in-place (modifying self)
@return 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.
Note that in Ruby, the '^=' operator actually does not exist, but is emulated by '^' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'xor_with' instead.
The 'xor_with' alias has been introduced in version 0.28.12.
EqualDeviceParameters
@brief A device parameter equality comparer. Attach this object to a device class with \DeviceClass#equal_parameters= to make the device class use this comparer:
@code
20nm tolerance for length:
equal_device_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_L, 0.02, 0.0)
one percent tolerance for width:
equal_device_parameters += RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_W, 0.0, 0.01)
applies the compare delegate:
netlist.device_class_by_name("NMOS").equal_parameters = equal_device_parameters @/code
You can use this class to specify fuzzy equality criteria for the comparison of device parameters in netlist verification or to confine the equality of devices to certain parameters only.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A device parameter equality comparer.\nAttach this object to a device class with \\DeviceClass#equal_parameters= to make the device class use this comparer:\n\n@code\n# 20nm tolerance for length:\nequal_device_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_L, 0.02, 0.0)\n# one percent tolerance for width:\nequal_device_parameters += RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_W, 0.0, 0.01)\n# applies the compare delegate:\nnetlist.device_class_by_name("NMOS").equal_parameters = equal_device_parameters\n@/code\n\nYou can use this class to specify fuzzy equality criteria for the comparison of device parameters in netlist verification or to confine the equality of devices to certain parameters only.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 98
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EqualDeviceParameters' objects>
list of weak references to the object
__add__
method descriptor
__add__() -> EqualDeviceParameters
@brief Combines two parameters for comparison. The '+' operator will join the parameter comparers and produce one that checks the combined parameters.
__copy__
method descriptor
__copy__() -> EqualDeviceParameters
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> EqualDeviceParameters
@brief Creates a copy of self
__iadd__
method descriptor
__iadd__() -> EqualDeviceParameters
@brief Combines two parameters for comparison (in-place). The '+=' operator will join the parameter comparers and produce one that checks the combined parameters.
__init__
method descriptor
__init__() -> None
@brief Creates a device parameter comparer for a single parameter. 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1).
A value of 0 for both absolute and relative deviation means the parameters have to match exactly.
If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> EqualDeviceParameters
@brief Creates a copy of self
ignore
builtin
ignore() -> EqualDeviceParameters
@brief Creates a device parameter comparer which ignores the parameter.
This specification can be used to make a parameter ignored. Starting with version 0.27.4, all primary parameters are compared. Before 0.27.4, giving a tolerance meant only those parameters are compared. To exclude a primary parameter from the compare, use the 'ignore' specification for that parameter.
This constructor has been introduced in version 0.27.4.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> EqualDeviceParameters
@brief Creates a device parameter comparer for a single parameter. 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1).
A value of 0 for both absolute and relative deviation means the parameters have to match exactly.
If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match.
to_string
method descriptor
to_string() -> str
@hide
GenericDeviceCombiner
@brief A class implementing the combination of two devices (parallel or serial mode). Reimplement this class to provide a custom device combiner. Device combination requires 'supports_paralell_combination' or 'supports_serial_combination' to be set to true for the device class. In the netlist device combination step, the algorithm will try to identify devices which can be combined into single devices and use the combiner object to implement the actual joining of such devices.
Attach this object to a device class with \DeviceClass#combiner= to make the device class use this combiner.
This class has been added in version 0.27.3.
__doc__
class
__doc__ = "@brief A class implementing the combination of two devices (parallel or serial mode).\nReimplement this class to provide a custom device combiner.\nDevice combination requires 'supports_paralell_combination' or 'supports_serial_combination' to be set to true for the device class. In the netlist device combination step, the algorithm will try to identify devices which can be combined into single devices and use the combiner object to implement the actual joining of such devices.\n\nAttach this object to a device class with \\DeviceClass#combiner= to make the device class use this combiner.\n\nThis class has been added in version 0.27.3."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 100
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'GenericDeviceCombiner' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> GenericDeviceCombiner
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> GenericDeviceCombiner
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> GenericDeviceCombiner
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> GenericDeviceCombiner
@brief Creates a new object of this class
GenericDeviceExtractor
Bases: klayout.dbcore.DeviceExtractorBase
@brief The basic class for implementing custom device extractors.
This class serves as a base class for implementing customized device extractors. This class does not provide any extraction functionality, so you have to implement every detail.
Device extraction requires a few definitions. The definitions are made in the reimplementation of the \setup method. Required definitions to be made are:
@ul @li The name of the extractor. This will also be the name of the device class produced by the extractor. The name is set using \name=. @/li @li The device class of the devices to produce. The device class is registered using \register_device_class. @/li @li The layers used for the device extraction. These are input layers for the extraction as well as output layers for defining the terminals. Terminals are the points at which the nets connect to the devices. Layers are defined using \define_layer. Initially, layers are abstract definitions with a name and a description. Concrete layers will be given when defining the connectivity. @/li @/ul
When the device extraction is started, the device extraction algorithm will first ask the device extractor for the 'connectivity'. This is not a connectivity in a sense of electrical connections. The connectivity defines are logical compound that makes up the device. 'Connected' shapes are collected and presented to the device extractor. The connectivity is obtained by calling \get_connectivity. This method must be implemented to produce the connectivity.
Finally, the individual devices need to be extracted. Each cluster of connected shapes is presented to the device extractor. A cluster may include more than one device. It's the device extractor's responsibility to extract the devices from this cluster and deliver the devices through \create_device. In addition, terminals have to be defined, so the net extractor can connect to the devices. Terminal definitions are made through \define_terminal. The device extraction is implemented in the \extract_devices method.
If errors occur during device extraction, the \error method may be used to issue such errors. Errors reported this way are kept in the error log.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief The basic class for implementing custom device extractors.\n\nThis class serves as a base class for implementing customized device extractors. This class does not provide any extraction functionality, so you have to implement every detail.\n\nDevice extraction requires a few definitions. The definitions are made in the reimplementation of the \\setup\nmethod. Required definitions to be made are:\n\n@ul\n @li The name of the extractor. This will also be the name of the device class produced by the extractor. The name is set using \\name=. @/li\n @li The device class of the devices to produce. The device class is registered using \\register_device_class. @/li\n @li The layers used for the device extraction. These are input layers for the extraction as well as output layers for defining the terminals. Terminals are the points at which the nets connect to the devices.\n Layers are defined using \\define_layer. Initially, layers are abstract definitions with a name and a description.\n Concrete layers will be given when defining the connectivity. @/li\n@/ul\n\nWhen the device extraction is started, the device extraction algorithm will first ask the device extractor for the 'connectivity'. This is not a connectivity in a sense of electrical connections. The connectivity defines are logical compound that makes up the device. 'Connected' shapes are collected and presented to the device extractor.\nThe connectivity is obtained by calling \\get_connectivity. This method must be implemented to produce the connectivity.\n\nFinally, the individual devices need to be extracted. Each cluster of connected shapes is presented to the device extractor. A cluster may include more than one device. It's the device extractor's responsibility to extract the devices from this cluster and deliver the devices through \\create_device. In addition, terminals have to be defined, so the net extractor can connect to the devices. Terminal definitions are made through \\define_terminal. The device extraction is implemented in the \\extract_devices method.\n\nIf errors occur during device extraction, the \\error method may be used to issue such errors. Errors reported this way are kept in the error log.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 138
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
create_device
method descriptor
create_device() -> Device
@brief Creates a device. The device object returned can be configured by the caller, e.g. set parameters. It will be owned by the netlist and must not be deleted by the caller.
dbu
method descriptor
dbu() -> float
@brief Gets the database unit
define_layer
method descriptor
define_layer() -> NetlistDeviceExtractorLayerDefinition
@brief Defines a layer. @return The layer descriptor object created for this layer (use 'index' to get the layer's index) Each call will define one more layer for the device extraction. This method shall be used inside the implementation of \setup to define the device layers. The actual geometries are later available to \extract_devices in the order the layers are defined.
define_opt_layer
method descriptor
define_opt_layer() -> NetlistDeviceExtractorLayerDefinition
@brief Defines a layer with a fallback layer. @return The layer descriptor object created for this layer (use 'index' to get the layer's index) As \define_layer, this method allows specification of device extraction layer. In addition to \define_layout, it features a fallback layer. If in the device extraction statement, the primary layer is not given, the fallback layer will be used. Hence, this layer is optional. The fallback layer is given by its index and must be defined before the layer using the fallback layer is defined. For the index, 0 is the first layer defined, 1 the second and so forth.
define_terminal
method descriptor
define_terminal(device: Device, terminal_id: int, layer_index: int, point: Point) -> None
define_terminal(device: Device, terminal_id: int, layer_index: int, shape: Box) -> None
define_terminal(device: Device, terminal_id: int, layer_index: int, shape: Polygon) -> None
define_terminal(device: Device, terminal_name: str, layer_name: str, point: Point) -> None
define_terminal(device: Device, terminal_name: str, layer_name: str, shape: Box) -> None
define_terminal(device: Device, terminal_name: str, layer_name: str, shape: Polygon) -> None
define_terminal()
@brief Defines a device terminal using names for terminal and layer.
This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. It has been introduced in version 0.28.
error
method descriptor
error(category_name: str, category_description: str, message: str) -> None
error(category_name: str, category_description: str, message: str, geometry: DPolygon) -> None
error(category_name: str, category_description: str, message: str, geometry: Polygon) -> None
error(message: str) -> None
error(message: str, geometry: DPolygon) -> None
error(message: str, geometry: Polygon) -> None
error()
@brief Issues an error with the given category name and description, message and database-unit polygon geometry
register_device_class
method descriptor
register_device_class() -> None
@brief Registers a device class. The device class object will become owned by the netlist and must not be deleted by the caller. The name of the device class will be changed to the name given to the device extractor. This method shall be used inside the implementation of \setup to register the device classes.
sdbu
method descriptor
sdbu() -> float
@brief Gets the scaled database unit Use this unit to compute device properties. It is the database unit multiplied with the device scaling factor.
warn
method descriptor
warn(category_name: str, category_description: str, message: str) -> None
warn(category_name: str, category_description: str, message: str, geometry: DPolygon) -> None
warn(category_name: str, category_description: str, message: str, geometry: Polygon) -> None
warn(message: str) -> None
warn(message: str, geometry: DPolygon) -> None
warn(message: str, geometry: Polygon) -> None
warn()
@brief Issues a warning with the given category name and description, message and database-unit polygon geometry Warnings have been introduced in version 0.28.13.
GenericDeviceParameterCompare
Bases: klayout.dbcore.EqualDeviceParameters
@brief A class implementing the comparison of device parameters. Reimplement this class to provide a custom device parameter compare scheme. Attach this object to a device class with \DeviceClass#equal_parameters= to make the device class use this comparer.
This class is intended for special cases. In most scenarios it is easier to use \EqualDeviceParameters instead of implementing a custom comparer class.
This class has been added in version 0.26. The 'equal' method has been dropped in 0.27.1 as it can be expressed as !less(a,b) && !less(b,a).
__doc__
class
__doc__ = "@brief A class implementing the comparison of device parameters.\nReimplement this class to provide a custom device parameter compare scheme.\nAttach this object to a device class with \\DeviceClass#equal_parameters= to make the device class use this comparer.\n\nThis class is intended for special cases. In most scenarios it is easier to use \\EqualDeviceParameters instead of implementing a custom comparer class.\n\nThis class has been added in version 0.26. The 'equal' method has been dropped in 0.27.1 as it can be expressed as !less(a,b) && !less(b,a)."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 99
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
GenericNetlistCompareLogger
Bases: klayout.dbcore.NetlistCompareLogger
@brief An event receiver for the netlist compare feature. The \NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of its methods to receive certain kind of events. This class has been introduced in version 0.26.
Error
class
Error: Severity = Error (3)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Info
class
Info: Severity = Info (1)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
NoSeverity
class
NoSeverity: Severity = NoSeverity (0)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Warning
class
Warning: Severity = Warning (2)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
__doc__
class
__doc__ = '@brief An event receiver for the netlist compare feature.\nThe \\NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of its methods to receive certain kind of events.\nThis class has been introduced in version 0.26.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 113
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
HAlign
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignCenter
class
HAlignCenter: HAlign = HAlignCenter (1)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignLeft
class
HAlignLeft: HAlign = HAlignLeft (0)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignRight
class
HAlignRight: HAlign = HAlignRight (2)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
NoHAlign
class
NoHAlign: HAlign = NoHAlign (-1)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief This class represents the horizontal alignment modes.\nThis enum has been introduced in version 0.28.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 177
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'HAlign' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> HAlign
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> HAlign
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: HAlign) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> HAlign
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> HAlign
new(s: str) -> HAlign
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
ICplxTrans
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
M0
class
M0: ICplxTrans = m0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
M135
class
M135: ICplxTrans = m135 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
M45
class
M45: ICplxTrans = m45 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
M90
class
M90: ICplxTrans = m90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
R0
class
R0: ICplxTrans = r0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
R180
class
R180: ICplxTrans = r180 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
R270
class
R270: ICplxTrans = r270 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
R90
class
R90: ICplxTrans = r90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::Point::new(100, 200)).to_s # -290,170 @/code
This class has been introduced in version 0.18.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A complex transformation\n\nA complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary\nangle and a displacement. This is also the order, the operations are applied.\nThis version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.\n\nComplex transformations are extensions of the simple transformation classes (\\Trans in that case) and behave similar.\n\nTransformations can be used to transform points or other objects. Transformations can be combined with the \'*\' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:\n\n@code\n# Create a transformation that applies a magnification of 1.5, a rotation by 90 degree\n# and displacement of 10 in x and 20 units in y direction:\nt = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0)\nt.to_s # r90 *1.5 10,20\n# compute the inverse:\nt.inverted.to_s # r270 *0.666666667 -13,7\n# Combine with another displacement (applied after that):\n(RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25\n# Transform a point:\nt.trans(RBA::Point::new(100, 200)).to_s # -290,170\n@/code\n\nThis class has been introduced in version 0.18.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 190
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ICplxTrans' objects>
list of weak references to the object
angle
class
angle: float = <attribute 'angle' of 'ICplxTrans' objects>
@brief Gets the angle
Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree.
@return The rotation angle this transformation provides in degree units (0..360 deg).
@brief Sets the angle @param a The new angle See \angle for a description of that attribute.
disp
class
disp: Vector = <attribute 'disp' of 'ICplxTrans' objects>
@brief Gets the displacement
@brief Sets the displacement @param u The new displacement
mag
class
mag: float = <attribute 'mag' of 'ICplxTrans' objects>
@brief Gets the magnification
@brief Sets the magnification @param m The new magnification
mirror
class
mirror: bool = <attribute 'mirror' of 'ICplxTrans' objects>
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
@brief Sets the mirror flag "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag
__copy__
method descriptor
__copy__() -> ICplxTrans
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ICplxTrans
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(c: ICplxTrans, mag: Optional[float] = ..., u: Optional[Vector] = ...) -> None
__init__(c: ICplxTrans, mag: Optional[float] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[Vector] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> None
__init__(t: Trans, mag: Optional[float] = ...) -> None
__init__(trans: CplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: DCplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: VCplxTrans, dbu: Optional[float] = ...) -> None
__init__(u: Vector) -> None
__init__(x: int, y: int) -> None
__init__()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
__lt__
method descriptor
__lt__() -> bool
@brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions.
__mul__
method descriptor
__mul__(box: Box) -> Box
__mul__(d: int) -> int
__mul__(edge: Edge) -> Edge
__mul__(p: Point) -> Point
__mul__(p: Vector) -> Vector
__mul__(path: Path) -> Path
__mul__(polygon: Polygon) -> Polygon
__mul__(t: ICplxTrans) -> ICplxTrans
__mul__(t: VCplxTrans) -> VCplxTrans
__mul__(text: Text) -> Text
__mul__()
@brief Returns the concatenated transformation
The * operator returns self*t ("t is applied before this transformation").
@param t The transformation to apply before @return The modified transformation
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality
__repr__
method descriptor
__repr__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: Box) -> Box
__rmul__(d: int) -> int
__rmul__(edge: Edge) -> Edge
__rmul__(p: Point) -> Point
__rmul__(p: Vector) -> Vector
__rmul__(path: Path) -> Path
__rmul__(polygon: Polygon) -> Polygon
__rmul__(text: Text) -> Text
__rmul__()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
ctrans
method descriptor
ctrans() -> int
@brief Transforms a single distance
The "ctrans" method transforms the given distance. This is equivalent to multiplying with the magnification. For the simple transformations, there is no magnification and no modification of the distance.
@param d The distance to transform @return The transformed distance
The product '*' has been added as a synonym in version 0.28. The distance can be signed since version 0.29.3.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ICplxTrans
@brief Creates a copy of self
from_dtrans
builtin
from_dtrans() -> ICplxTrans
@brief Creates an integer coordinate transformation from another coordinate flavour
The 'dbu' argument is used to transform the input space and output space from floating-point units to integer units and vice versa. Formally, the ICplxTrans transformation is initialized with 'to_dbu * trans * from_dbu' where 'from_dbu' is the transformation into micrometer space, or more precisely 'CplxTrans(mag=dbu)' and 'to_dbu' is the transformation into DBU space, or more precisely 'VCplxTrans(mag=1/dbu)'.
This constructor has been introduced in version 0.25. The 'dbu' argument has been added in version 0.29.
from_s
builtin
from_s() -> ICplxTrans
@brief 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.
from_trans
builtin
from_trans() -> ICplxTrans
@brief Creates an integer coordinate transformation from another coordinate flavour
The 'dbu' argument is used to transform the output space from floating-point units to integer units. Formally, the CplxTrans transformation is initialized with 'to_dbu * trans' where 'to_dbu' is the transformation into DBU space, or more precisely 'VCplxTrans(mag=1/dbu)'.
This constructor has been introduced in version 0.25. The 'dbu' argument has been added in version 0.29.
hash
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> ICplxTrans
@brief Inverts the transformation (in place)
Inverts the transformation and replaces this transformation by its inverted one.
@return The inverted transformation
inverted
method descriptor
inverted() -> ICplxTrans
@brief Returns the inverted transformation
Returns the inverted transformation. This method does not modify the transformation.
@return The inverted transformation
is_complex
method descriptor
is_complex() -> bool
@brief Returns true if the transformation is a complex one
If this predicate is false, the transformation can safely be converted to a simple transformation. Otherwise, this conversion will be lossy. The predicate value is equivalent to 'is_mag || !is_ortho'.
This method has been introduced in version 0.27.5.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mag
method descriptor
is_mag() -> bool
@brief Tests, if the transformation is a magnifying one
This is the recommended test for checking if the transformation represents a magnification.
is_mirror
method descriptor
is_mirror() -> bool
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
is_ortho
method descriptor
is_ortho() -> bool
@brief Tests, if the transformation is an orthogonal transformation
If the rotation is by a multiple of 90 degree, this method will return true.
is_unity
method descriptor
is_unity() -> bool
@brief Tests, whether this is a unit transformation
new
builtin
new() -> ICplxTrans
new(c: ICplxTrans, mag: Optional[float] = ..., u: Optional[Vector] = ...) -> ICplxTrans
new(c: ICplxTrans, mag: Optional[float] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> ICplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[Vector] = ...) -> ICplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> ICplxTrans
new(t: Trans, mag: Optional[float] = ...) -> ICplxTrans
new(trans: CplxTrans, dbu: Optional[float] = ...) -> ICplxTrans
new(trans: DCplxTrans, dbu: Optional[float] = ...) -> ICplxTrans
new(trans: VCplxTrans, dbu: Optional[float] = ...) -> ICplxTrans
new(u: Vector) -> ICplxTrans
new(x: int, y: int) -> ICplxTrans
new()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
rot
method descriptor
rot() -> int
@brief Returns the respective simple transformation equivalent rotation code if possible
If this transformation is orthogonal (is_ortho () == true), then this method will return the corresponding fixpoint transformation, not taking into account magnification and displacement. If the transformation is not orthogonal, the result reflects the quadrant the rotation goes into.
s_trans
method descriptor
s_trans() -> Trans
@brief Extracts the simple transformation part
The simple transformation part does not reflect magnification or arbitrary angles. Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0.
to_itrans
method descriptor
to_itrans() -> DCplxTrans
@brief Converts the transformation to another transformation with floating-point input and output coordinates
The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit.
This method is redundant with the conversion constructors and is ill-named. Instead of 'to_itrans' use the conversion constructor:
@code dtrans = RBA::DCplxTrans::new(itrans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
to_s
method descriptor
to_s() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
to_trans
method descriptor
to_trans() -> VCplxTrans
@brief Converts the transformation to another transformation with floating-point input coordinates
This method is redundant with the conversion constructors and is ill-named. Instead of 'to_trans' use the conversion constructor:
@code vtrans = RBA::VCplxTrans::new(itrans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
to_vtrans
method descriptor
to_vtrans() -> CplxTrans
@brief Converts the transformation to another transformation with floating-point output coordinates
The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit.
This method is redundant with the conversion constructors and is ill-named. Instead of 'to_vtrans' use the conversion constructor:
@code trans = RBA::CplxTrans::new(itrans, dbu) @/code
This method has been introduced in version 0.25 and was deprecated in version 0.29.
trans
method descriptor
trans(box: Box) -> Box
trans(edge: Edge) -> Edge
trans(p: Point) -> Point
trans(p: Vector) -> Vector
trans(path: Path) -> Path
trans(polygon: Polygon) -> Polygon
trans(text: Text) -> Text
trans()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
IMatrix2d
@brief A 2d matrix object used mainly for representing rotation and shear transformations (integer coordinate version).
This object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear.
The integer variant was introduced in version 0.27.
__doc__
class
__doc__ = '@brief A 2d matrix object used mainly for representing rotation and shear transformations (integer coordinate version).\n\nThis object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear.\n\nThe integer variant was introduced in version 0.27.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 81
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'IMatrix2d' objects>
list of weak references to the object
__add__
method descriptor
__add__() -> IMatrix2d
@brief Sum of two matrices. @param m The other matrix. @return The (element-wise) sum of self+m
__copy__
method descriptor
__copy__() -> IMatrix2d
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> IMatrix2d
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
__init__(m11: float, m12: float, m21: float, m22: float) -> None
__init__(m: float) -> None
__init__(mx: float, my: float) -> None
__init__(t: DCplxTrans) -> None
__init__()
@brief Create a new Matrix2d from the four coefficients
__mul__
method descriptor
__mul__(box: Box) -> Box
__mul__(e: Edge) -> Edge
__mul__(m: IMatrix2d) -> IMatrix2d
__mul__(p: Point) -> Point
__mul__(p: Polygon) -> Polygon
__mul__(p: SimplePolygon) -> SimplePolygon
__mul__(v: Vector) -> Vector
__mul__()
@brief Product of two matrices. @param m The other matrix. @return The matrix product self*m
__repr__
method descriptor
__repr__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
__rmul__
method descriptor
__rmul__(box: Box) -> Box
__rmul__(e: Edge) -> Edge
__rmul__(m: IMatrix2d) -> IMatrix2d
__rmul__(p: Point) -> Point
__rmul__(p: Polygon) -> Polygon
__rmul__(p: SimplePolygon) -> SimplePolygon
__rmul__(v: Vector) -> Vector
__rmul__()
@brief Product of two matrices. @param m The other matrix. @return The matrix product self*m
__str__
method descriptor
__str__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
angle
method descriptor
angle() -> float
@brief Returns the rotation angle of the rotation component of this matrix. @return The angle in degree. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cplx_trans
method descriptor
cplx_trans() -> ICplxTrans
@brief Converts this matrix to a complex transformation (if possible). @return The complex transformation. This method is successful only if the matrix does not contain shear components and the magnification must be isotropic.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> IMatrix2d
@brief Creates a copy of self
inverted
method descriptor
inverted() -> IMatrix2d
@brief The inverse of this matrix. @return The inverse of this matrix
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mirror
method descriptor
is_mirror() -> bool
@brief Returns the mirror flag of this matrix. @return True if this matrix has a mirror component. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear.
m
method descriptor
m() -> float
@brief Gets the m coefficient with the given index. @return The coefficient [i,j]
m11
method descriptor
m11() -> float
@brief Gets the m11 coefficient. @return The value of the m11 coefficient
m12
method descriptor
m12() -> float
@brief Gets the m12 coefficient. @return The value of the m12 coefficient
m21
method descriptor
m21() -> float
@brief Gets the m21 coefficient. @return The value of the m21 coefficient
m22
method descriptor
m22() -> float
@brief Gets the m22 coefficient. @return The value of the m22 coefficient
mag_x
method descriptor
mag_x() -> float
@brief Returns the x magnification of the magnification component of this matrix. @return The magnification factor. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation.
mag_y
method descriptor
mag_y() -> float
@brief Returns the y magnification of the magnification component of this matrix. @return The magnification factor. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation.
new
builtin
new() -> IMatrix2d
new(m11: float, m12: float, m21: float, m22: float) -> IMatrix2d
new(m: float) -> IMatrix2d
new(mx: float, my: float) -> IMatrix2d
new(t: DCplxTrans) -> IMatrix2d
new()
@brief Create a new Matrix2d from the four coefficients
newc
builtin
newc(mag: float, rotation: float, mirror: bool) -> IMatrix2d
newc(shear: float, mx: float, my: float, rotation: float, mirror: bool) -> IMatrix2d
newc()
@brief Create a new Matrix2d representing a shear, anisotropic magnification, rotation and mirroring @param shear The shear angle @param mx The magnification in x direction @param my The magnification in y direction @param rotation The rotation angle (in degree) @param mirror The mirror flag (at x axis)
The order of execution of the operations is mirror, magnification, shear and rotation. This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite).
shear_angle
method descriptor
shear_angle() -> float
@brief Returns the magnitude of the shear component of this matrix. @return The shear angle in degree. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.
to_s
method descriptor
to_s() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
trans
method descriptor
trans() -> Point
@brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point
IMatrix3d
@brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations (integer coordinate version).
This object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion.
The integer variant was introduced in version 0.27.
__doc__
class
__doc__ = '@brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations (integer coordinate version).\n\nThis object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion.\n\nThe integer variant was introduced in version 0.27.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 83
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'IMatrix3d' objects>
list of weak references to the object
__add__
method descriptor
__add__() -> IMatrix3d
@brief Sum of two matrices. @param m The other matrix. @return The (element-wise) sum of self+m
__copy__
method descriptor
__copy__() -> IMatrix3d
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> IMatrix3d
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
__init__(m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> None
__init__(m11: float, m12: float, m21: float, m22: float) -> None
__init__(m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None
__init__(m: float) -> None
__init__(t: ICplxTrans) -> None
__init__()
@brief Create a new Matrix3d from the nine matrix coefficients
__mul__
method descriptor
__mul__(box: Box) -> Box
__mul__(e: Edge) -> Edge
__mul__(m: IMatrix3d) -> IMatrix3d
__mul__(p: Point) -> Point
__mul__(p: Polygon) -> Polygon
__mul__(p: SimplePolygon) -> SimplePolygon
__mul__(v: Vector) -> Vector
__mul__()
@brief Transforms a polygon with this matrix. @param p The polygon to transform. @return The transformed polygon
__repr__
method descriptor
__repr__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
__rmul__
method descriptor
__rmul__(box: Box) -> Box
__rmul__(e: Edge) -> Edge
__rmul__(m: IMatrix3d) -> IMatrix3d
__rmul__(p: Point) -> Point
__rmul__(p: Polygon) -> Polygon
__rmul__(p: SimplePolygon) -> SimplePolygon
__rmul__(v: Vector) -> Vector
__rmul__()
@brief Transforms a polygon with this matrix. @param p The polygon to transform. @return The transformed polygon
__str__
method descriptor
__str__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
angle
method descriptor
angle() -> float
@brief Returns the rotation angle of the rotation component of this matrix. @return The angle in degree. See the description of this class for details about the basic transformations.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cplx_trans
method descriptor
cplx_trans() -> DCplxTrans
@brief Converts this matrix to a complex transformation (if possible). @return The complex transformation. This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
disp
method descriptor
disp() -> Vector
@brief Returns the displacement vector of this transformation.
Starting with version 0.25 this method returns a vector type instead of a point. @return The displacement vector.
dup
method descriptor
dup() -> IMatrix3d
@brief Creates a copy of self
inverted
method descriptor
inverted() -> IMatrix3d
@brief The inverse of this matrix. @return The inverse of this matrix
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mirror
method descriptor
is_mirror() -> bool
@brief Returns the mirror flag of this matrix. @return True if this matrix has a mirror component. See the description of this class for details about the basic transformations.
m
method descriptor
m() -> float
@brief Gets the m coefficient with the given index. @return The coefficient [i,j]
mag_x
method descriptor
mag_x() -> float
@brief Returns the x magnification of the magnification component of this matrix. @return The magnification factor.
mag_y
method descriptor
mag_y() -> float
@brief Returns the y magnification of the magnification component of this matrix. @return The magnification factor.
new
builtin
new() -> IMatrix3d
new(m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> IMatrix3d
new(m11: float, m12: float, m21: float, m22: float) -> IMatrix3d
new(m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> IMatrix3d
new(m: float) -> IMatrix3d
new(t: ICplxTrans) -> IMatrix3d
new()
@brief Create a new Matrix3d from the nine matrix coefficients
newc
builtin
newc(mag: float, rotation: float, mirrx: bool) -> IMatrix3d
newc(shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d
newc(tx: float, ty: float, z: float, u: Vector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d
newc(u: Vector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d
newc()
@brief Create a new Matrix3d representing a perspective distortion, displacement, shear, anisotropic magnification, rotation and mirroring @param tx The perspective tilt angle x (around the y axis) @param ty The perspective tilt angle y (around the x axis) @param z The observer distance at which the tilt angles are given @param u The displacement @param shear The shear angle @param mx The magnification in x direction @param mx The magnification in y direction @param rotation The rotation angle (in degree) @param mirrx The mirror flag (at x axis)
The order of execution of the operations is mirror, magnification, rotation, shear, perspective distortion and displacement. This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite).
The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles for different observer distances. Hence, the observer distance must be given at which the tilt angles are given. If the magnitude of the tilt angle is not important, z can be set to 1.
Starting with version 0.25 the displacement is of vector type.
shear_angle
method descriptor
shear_angle() -> float
@brief Returns the magnitude of the shear component of this matrix. @return The shear angle in degree. The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.See the description of this class for details about the basic transformations.
to_s
method descriptor
to_s() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
trans
method descriptor
trans() -> Point
@brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point
tx
method descriptor
tx() -> float
@brief Returns the perspective tilt angle tx. @param z The observer distance at which the tilt angle is computed. @return The tilt angle tx. The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1.
ty
method descriptor
ty() -> float
@brief Returns the perspective tilt angle ty. @param z The observer distance at which the tilt angle is computed. @return The tilt angle ty. The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1.
InstElement
@brief An element in an instantiation path
This objects are used to reference a single instance in a instantiation path. The object is composed of a \CellInstArray object (accessible through the \cell_inst accessor) that describes the basic instance, which may be an array. The particular instance within the array can be further retrieved using the \array_member_trans, \specific_trans or \specific_cplx_trans methods.
__doc__
class
__doc__ = '@brief An element in an instantiation path\n\nThis objects are used to reference a single instance in a instantiation path. The object is composed of a \\CellInstArray object (accessible through the \\cell_inst accessor) that describes the basic instance, which may be an array. The particular instance within the array can be further retrieved using the \\array_member_trans, \\specific_trans or \\specific_cplx_trans methods.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 59
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'InstElement' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> InstElement
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> InstElement
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality of two InstElement objects Note: this operator returns true if both instance elements refer to the same instance, not just identical ones.
__init__
method descriptor
__init__() -> None
__init__(inst: Instance) -> None
__init__(inst: Instance, a_index: int, b_index: int) -> None
__init__()
@brief Create an instance element from an array instance pointing into a certain array member Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument.
__lt__
method descriptor
__lt__() -> bool
@brief Provides an order criterion for two InstElement objects Note: this operator is just provided to establish any order, not a particular one.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality of two InstElement objects See the comments on the == operator.
array_member_trans
method descriptor
array_member_trans() -> Trans
@brief Returns the transformation for this array member
The array member transformation is the one applicable in addition to the global transformation for the member selected from an array. If this instance is not an array instance, the specific transformation is a unit transformation without displacement.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cell_inst
method descriptor
cell_inst() -> CellInstArray
@brief Accessor to the cell instance (array).
This method is equivalent to "self.inst.cell_inst" and provided for convenience.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> InstElement
@brief Creates a copy of self
ia
method descriptor
ia() -> int
@brief Returns the 'a' axis index for array instances For instance elements describing one member of an array, this attribute will deliver the a axis index addressed by this element. See \ib and \array_member_trans for further attributes applicable to array members. If the element is a plain instance and not an array member, this attribute is a negative value.
This method has been introduced in version 0.25.
ib
method descriptor
ib() -> int
@brief Returns the 'b' axis index for array instances For instance elements describing one member of an array, this attribute will deliver the a axis index addressed by this element. See \ia and \array_member_trans for further attributes applicable to array members. If the element is a plain instance and not an array member, this attribute is a negative value.
This method has been introduced in version 0.25.
inst
method descriptor
inst() -> Instance
@brief Gets the \Instance object held in this instance path element.
This method has been added in version 0.24.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> InstElement
new(inst: Instance) -> InstElement
new(inst: Instance, a_index: int, b_index: int) -> InstElement
new()
@brief Create an instance element from an array instance pointing into a certain array member Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument.
new_i
builtin
new_i() -> InstElement
@brief Create an instance element from a single instance alone Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument.
new_iab
builtin
new_iab() -> InstElement
@brief Create an instance element from an array instance pointing into a certain array member Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument.
prop_id
method descriptor
prop_id() -> int
@brief Accessor to the property attached to this instance.
This method is equivalent to "self.inst.prop_id" and provided for convenience.
specific_cplx_trans
method descriptor
specific_cplx_trans() -> ICplxTrans
@brief Returns the specific complex transformation for this instance
The specific transformation is the one applicable for the member selected from an array. This is the effective transformation applied for this array member. \array_member_trans gives the transformation applied additionally to the instances' global transformation (in other words, specific_cplx_trans = array_member_trans * cell_inst.cplx_trans).
specific_trans
method descriptor
specific_trans() -> Trans
@brief Returns the specific transformation for this instance
The specific transformation is the one applicable for the member selected from an array. This is the effective transformation applied for this array member. \array_member_trans gives the transformation applied additionally to the instances' global transformation (in other words, specific_trans = array_member_trans * cell_inst.trans). This method delivers a simple transformation that does not include magnification components. To get these as well, use \specific_cplx_trans.
Instance
@brief An instance proxy
An instance proxy is basically a pointer to an instance of different kinds, similar to \Shape, the shape proxy. \Instance objects can be duplicated without creating copies of the instances itself: the copy will still point to the same instance than the original.
When the \Instance object is modified, the actual instance behind it is modified. The \Instance object acts as a simplified interface for single and array instances with or without properties.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief An instance proxy\n\nAn instance proxy is basically a pointer to an instance of different kinds, \nsimilar to \\Shape, the shape proxy. \\Instance objects can be duplicated without\ncreating copies of the instances itself: the copy will still point to the same instance\nthan the original.\n\nWhen the \\Instance object is modified, the actual instance behind it is modified. The \\Instance object acts as a simplified interface for single and array instances with or without properties.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 30
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Instance' objects>
list of weak references to the object
a
class
a: Vector = <attribute 'a' of 'Instance' objects>
@brief Returns the displacement vector for the 'a' axis
Starting with version 0.25 the displacement is of vector type.
@brief Sets the displacement vector for the 'a' axis
If the instance was not an array instance before it is made one.
This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type.
@brief Sets the displacement vector for the 'a' axis in micrometer units
Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally.
This method has been introduced in version 0.25.
b
class
b: Vector = <attribute 'b' of 'Instance' objects>
@brief Returns the displacement vector for the 'b' axis
Starting with version 0.25 the displacement is of vector type.
@brief Sets the displacement vector for the 'b' axis
If the instance was not an array instance before it is made one.
This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type.
@brief Sets the displacement vector for the 'b' axis in micrometer units
Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally.
This method has been introduced in version 0.25.
cell
class
cell: Cell = <attribute 'cell' of 'Instance' objects>
@brief Gets the \Cell object of the cell this instance refers to
Please note that before version 0.23 this method returned the cell the instance is contained in. For consistency, this method has been renamed \parent_cell.
This method has been introduced in version 0.23.
@brief Sets the \Cell object this instance refers to
Setting the cell object to nil is equivalent to deleting the instance.
This method has been introduced in version 0.23.
cell_index
class
cell_index: int = <attribute 'cell_index' of 'Instance' objects>
@brief Get the index of the cell this instance refers to
@brief Sets the index of the cell this instance refers to
This method has been introduced in version 0.23.
cell_inst
class
cell_inst: CellInstArray = <attribute 'cell_inst' of 'Instance' objects>
@brief Gets the basic \CellInstArray object associated with this instance reference.
@brief Changes the \CellInstArray object to the given one. This method replaces the instance by the given CellInstArray object.
This method has been introduced in version 0.22
@brief Returns the basic cell instance array object by giving a micrometer unit object. This method replaces the instance by the given CellInstArray object and it internally transformed into database units.
This method has been introduced in version 0.25
cplx_trans
class
cplx_trans: ICplxTrans = <attribute 'cplx_trans' of 'Instance' objects>
@brief Gets the complex transformation of the instance or the first instance in the array This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well.
@brief Sets the complex transformation of the instance or the first instance in the array
This method has been introduced in version 0.23.
@brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.
This method has been introduced in version 0.25.
da
class
da: DVector = <attribute 'da' of 'Instance' objects>
@brief Returns the displacement vector for the 'a' axis in micrometer units
Like \a, this method returns the displacement, but it will be translated to database units internally.
This method has been introduced in version 0.25.
@brief Sets the displacement vector for the 'a' axis in micrometer units
Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally.
This method has been introduced in version 0.25.
db
class
db: DVector = <attribute 'db' of 'Instance' objects>
@brief Returns the displacement vector for the 'b' axis in micrometer units
Like \b, this method returns the displacement, but it will be translated to database units internally.
This method has been introduced in version 0.25.
@brief Sets the displacement vector for the 'b' axis in micrometer units
Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally.
This method has been introduced in version 0.25.
dcell_inst
class
dcell_inst: DCellInstArray = <attribute 'dcell_inst' of 'Instance' objects>
@brief Returns the micrometer unit version of the basic cell instance array object.
This method has been introduced in version 0.25
@brief Returns the basic cell instance array object by giving a micrometer unit object. This method replaces the instance by the given CellInstArray object and it internally transformed into database units.
This method has been introduced in version 0.25
dcplx_trans
class
dcplx_trans: DCplxTrans = <attribute 'dcplx_trans' of 'Instance' objects>
@brief Gets the complex transformation of the instance or the first instance in the array (in micrometer units) This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers.
This method has been introduced in version 0.25.
@brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.
This method has been introduced in version 0.25.
dtrans
class
dtrans: DTrans = <attribute 'dtrans' of 'Instance' objects>
@brief Gets the transformation of the instance or the first instance in the array (in micrometer units) This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers.
This method has been introduced in version 0.25.
@brief Sets the transformation of the instance or the first instance in the array (in micrometer units) This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.
This method has been introduced in version 0.25.
na
class
na: int = <attribute 'na' of 'Instance' objects>
@brief Returns the number of instances in the 'a' axis
@brief Sets the number of instances in the 'a' axis
If the instance was not an array instance before it is made one.
This method has been introduced in version 0.23.
nb
class
nb: int = <attribute 'nb' of 'Instance' objects>
@brief Returns the number of instances in the 'b' axis
@brief Sets the number of instances in the 'b' axis
If the instance was not an array instance before it is made one.
This method has been introduced in version 0.23.
parent_cell
class
parent_cell: Cell = <attribute 'parent_cell' of 'Instance' objects>
@brief Gets the cell this instance is contained in
Returns nil if the instance does not live inside a cell. This method was named "cell" previously which lead to confusion with \cell_index. It was renamed to "parent_cell" in version 0.23.
@brief Moves the instance to a different cell
Both the current and the target cell must live in the same layout.
This method has been introduced in version 0.23.
prop_id
class
prop_id: int = <attribute 'prop_id' of 'Instance' objects>
@brief Gets the properties ID associated with the instance
@brief Sets the properties ID associated with the instance This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property.
This method has been introduced in version 0.22.
trans
class
trans: Trans = <attribute 'trans' of 'Instance' objects>
@brief Gets the transformation of the instance or the first instance in the array The transformation returned is only valid if the array does not represent a complex transformation array
@brief Sets the transformation of the instance or the first instance in the array
This method has been introduced in version 0.23.
@brief Sets the transformation of the instance or the first instance in the array (in micrometer units) This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units.
This method has been introduced in version 0.25.
__copy__
method descriptor
__copy__() -> Instance
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Instance
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality of two Instance objects See the hint on the < operator.
__getitem__
method descriptor
__getitem__() -> Any
@brief Gets the user property with the given key or, if available, the PCell parameter with the name given by the key Getting the PCell parameter has priority over the user property. This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__len__
method descriptor
__len__() -> int
@brief Gets the number of single instances in the instance array If the instance represents a single instance, the count is 1. Otherwise it is na*nb.
__lt__
method descriptor
__lt__() -> bool
@brief Provides an order criterion for two Instance objects Warning: this operator is just provided to establish any order, not a particular one.
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality of two Instance objects Warning: this operator returns true if both objects refer to the same instance, not just identical ones.
__repr__
method descriptor
__repr__() -> str
@brief Creates a string showing the contents of the reference
This method has been introduced with version 0.16.
__setitem__
method descriptor
__setitem__() -> None
@brief Sets the user property with the given key or, if available, the PCell parameter with the name given by the key Setting the PCell parameter has priority over the user property. This method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief Creates a string showing the contents of the reference
This method has been introduced with version 0.16.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
bbox(layer_index: int) -> Box
bbox()
@brief Gets the bounding box of the instance for a given layer @param layer_index The index of the layer the bounding box will be computed for. The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all its children', an empty bounding box will be returned. This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28.
bbox_per_layer
method descriptor
bbox_per_layer() -> Box
@brief Gets the bounding box of the instance for a given layer @param layer_index The index of the layer the bounding box will be computed for. The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all its children', an empty bounding box will be returned. This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28.
cell_
method descriptor
cell_()
@brief Gets the \Cell object of the cell this instance refers to
This is the const version of the \cell method. It will return a const \Cell object and itself can be called on a const \Instance object.
This variant has been introduced in version 0.25.
change_pcell_parameter
method descriptor
change_pcell_parameter() -> None
@brief Changes a single parameter of a PCell instance to the given value
This method changes a parameter of a PCell instance to the given value. The name identifies the PCell parameter and must correspond to one parameter listed in the PCell declaration.
This method has been introduced in version 0.24.
change_pcell_parameters
method descriptor
change_pcell_parameters(dict: Dict[str, Any]) -> None
change_pcell_parameters(params: Sequence[Any]) -> None
change_pcell_parameters()
@brief Changes the parameters of a PCell instance to the dictionary of parameters
This method changes the parameters of a PCell instance to the given values. The values are specifies as a dictionary of names (keys) vs. values. Unknown names are ignored and only the parameters listed in the dictionary are changed.
This method has been introduced in version 0.24.
convert_to_static
method descriptor
convert_to_static() -> None
@brief Converts a PCell instance to a static cell
If the instance is a PCell instance, this method will convert the cell into a static cell and remove the PCell variant if required. A new cell will be created containing the PCell content but being a static cell. If the instance is not a PCell instance, this method won't do anything.
This method has been introduced in version 0.24.
create
method descriptor
create() -> None
@brief 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.
dbbox
method descriptor
dbbox() -> DBox
dbbox(layer_index: int) -> DBox
dbbox()
@brief Gets the bounding box of the instance in micron units @param layer_index The index of the layer the bounding box will be computed for. Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit.
This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28.
dbbox_per_layer
method descriptor
dbbox_per_layer() -> DBox
@brief Gets the bounding box of the instance in micron units @param layer_index The index of the layer the bounding box will be computed for. Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit.
This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28.
delete
method descriptor
delete() -> None
@brief Deletes this instance
After this method was called, the instance object is pointing to nothing.
This method has been introduced in version 0.23.
delete_property
method descriptor
delete_property() -> None
@brief Deletes the user property with the given key This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances.
This method has been introduced in version 0.22.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Instance
@brief Creates a copy of self
explode
method descriptor
explode() -> None
@brief Explodes the instance array
This method does nothing if the instance was not an array before. The instance object will point to the first instance of the array afterwards.
This method has been introduced in version 0.23.
flatten
method descriptor
flatten() -> None
flatten(levels: int) -> None
flatten()
@brief Flattens the instance
This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. This version of the method allows specification of the number of hierarchy levels to remove. Specifying 1 for 'levels' will remove the instance and replace it by the contents of the cell. Specifying a negative value or zero for the number of levels will flatten the instance completely.
This method has been introduced in version 0.24.
has_prop_id
method descriptor
has_prop_id() -> bool
@brief Returns true, if the instance has properties
is_complex
method descriptor
is_complex() -> bool
@brief Tests, if the array is a complex array
Returns true if the array represents complex instances (that is, with magnification and arbitrary rotation angles).
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_null
method descriptor
is_null() -> bool
@brief Checks, if the instance is a valid one
is_pcell
method descriptor
is_pcell() -> bool
@brief Returns a value indicating whether the instance is a PCell instance
This method has been introduced in version 0.24.
is_regular_array
method descriptor
is_regular_array() -> bool
@brief Tests, if this instance is a regular array
is_valid
method descriptor
is_valid() -> bool
@brief Tests if the \Instance object is still pointing to a valid instance If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again.
This method has been introduced in version 0.23 and is a shortcut for "inst.cell.is_valid?(inst)".
layout
method descriptor
layout() -> Layout
layout() -> Layout
layout()
@brief Gets the layout this instance is contained in
This const version of the method has been introduced in version 0.25.
new
builtin
new() -> Instance
@brief Creates a new object of this class
parent_cell_
method descriptor
parent_cell_()
@brief Gets the cell this instance is contained in
Returns nil if the instance does not live inside a cell.
This const version of the \parent_cell method has been introduced in version 0.25.
pcell_declaration
method descriptor
pcell_declaration() -> PCellDeclaration_Native
@brief Returns the PCell declaration object
If the instance is a PCell instance, this method returns the PCell declaration object for that PCell. If not, this method will return nil. This method has been introduced in version 0.24.
pcell_parameter
method descriptor
pcell_parameter() -> Any
@brief Gets a PCell parameter by the name of the parameter @return The parameter value or nil if the instance is not a PCell or does not have a parameter with given name
This method has been introduced in version 0.25.
pcell_parameters
method descriptor
pcell_parameters() -> List[Any]
@brief Gets the parameters of a PCell instance as a list of values @return A list of values
If the instance is a PCell instance, this method will return an array of values where each value corresponds to one parameter. The order of the values is the order the parameters are declared in the PCell declaration. If the instance is not a PCell instance, this list returned will be empty.
This method has been introduced in version 0.24.
pcell_parameters_by_name
method descriptor
pcell_parameters_by_name() -> Dict[str, Any]
@brief Gets the parameters of a PCell instance as a dictionary of values vs. names @return A dictionary of values by parameter name
If the instance is a PCell instance, this method will return a map of values vs. parameter names. The names are the ones defined in the PCell declaration.If the instance is not a PCell instance, the dictionary returned will be empty.
This method has been introduced in version 0.24.
properties
method descriptor
properties() -> Any
@brief Gets the user properties as a hash This method is a convenience method that gets all user properties as a single hash.
This method has been introduced in version 0.29.5.
property
method descriptor
property() -> Any
@brief Gets the user property with the given key This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. This method has been introduced in version 0.22.
set_property
method descriptor
set_property() -> None
@brief Sets the user property with the given key to the given value This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances.
This method has been introduced in version 0.22.
size
method descriptor
size() -> int
@brief Gets the number of single instances in the instance array If the instance represents a single instance, the count is 1. Otherwise it is na*nb.
to_s
method descriptor
to_s() -> str
to_s(with_cellname: bool) -> str
to_s()
@brief Creates a string showing the contents of the reference
Passing true to with_cellname makes the string contain the cellname instead of the cell index
This method has been introduced with version 0.23.
transform
method descriptor
transform(t: DCplxTrans) -> None
transform(t: DTrans) -> None
transform(t: ICplxTrans) -> None
transform(t: Trans) -> None
transform()
@brief Transforms the instance array with the given complex transformation (given in micrometer units) Transforms the instance like \transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units.
This method has been introduced in version 0.25.
transform_into
method descriptor
transform_into(t: DCplxTrans) -> None
transform_into(t: DTrans) -> None
transform_into(t: ICplxTrans) -> None
transform_into(t: Trans) -> None
transform_into()
@brief Transforms the instance array with the given complex transformation (given in micrometer units) Transforms the instance like \transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units.
This method has been introduced in version 0.25.
LEFDEFReaderConfiguration
@brief Detailed LEF/DEF reader options This class is a aggregate belonging to the \LoadLayoutOptions class. It provides options for the LEF/DEF reader. These options have been placed into a separate class to account for their complexity. This class specifically handles layer mapping. This is the process of generating layer names or GDS layer/datatypes from LEF/DEF layers and purpose combinations. There are basically two ways: to use a map file or to use pattern-based production rules.
To use a layer map file, set the \map_file attribute to the name of the layer map file. The layer map file lists the GDS layer and datatype numbers to generate for the geometry.
The pattern-based approach will use the layer name and attach a purpose-dependent suffix to it. Use the ..._suffix attributes to specify this suffix. For routing, the corresponding attribute is \routing_suffix for example. A purpose can also be mapped to a specific GDS datatype using the corresponding ..._datatype attributes. The decorated or undecorated names are looked up in a layer mapping table in the next step. The layer mapping table is specified using the \layer_map attribute. This table can be used to map layer names to specific GDS layers by using entries of the form 'NAME: layer-number'.
If a layer map file is present, the pattern-based attributes are ignored.
__doc__
class
__doc__ = "@brief Detailed LEF/DEF reader options\nThis class is a aggregate belonging to the \\LoadLayoutOptions class. It provides options for the LEF/DEF reader. These options have been placed into a separate class to account for their complexity.\nThis class specifically handles layer mapping. This is the process of generating layer names or GDS layer/datatypes from LEF/DEF layers and purpose combinations. There are basically two ways: to use a map file or to use pattern-based production rules.\n\nTo use a layer map file, set the \\map_file attribute to the name of the layer map file. The layer map file lists the GDS layer and datatype numbers to generate for the geometry.\n\nThe pattern-based approach will use the layer name and attach a purpose-dependent suffix to it. Use the ..._suffix attributes to specify this suffix. For routing, the corresponding attribute is \\routing_suffix for example. A purpose can also be mapped to a specific GDS datatype using the corresponding ..._datatype attributes.\nThe decorated or undecorated names are looked up in a layer mapping table in the next step. The layer mapping table is specified using the \\layer_map attribute. This table can be used to map layer names to specific GDS layers by using entries of the form 'NAME: layer-number'.\n\nIf a layer map file is present, the pattern-based attributes are ignored.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 195
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LEFDEFReaderConfiguration' objects>
list of weak references to the object
blockages_datatype
class
blockages_datatype: int = <attribute 'blockages_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the blockage marker layer datatype value. See \produce_via_geometry for details about the layer production rules.
@brief Sets the blockage marker layer datatype value. See \produce_via_geometry for details about the layer production rules.
blockages_suffix
class
blockages_suffix: str = <attribute 'blockages_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the blockage marker layer name suffix. See \produce_via_geometry for details about the layer production rules.
@brief Sets the blockage marker layer name suffix. See \produce_via_geometry for details about the layer production rules.
cell_outline_layer
class
cell_outline_layer: str = <attribute 'cell_outline_layer' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the layer on which to produce the cell outline (diearea). This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details. The setter for this attribute is \cell_outline_layer=. See also \produce_cell_outlines.
@brief Sets the layer on which to produce the cell outline (diearea). See \cell_outline_layer for details.
create_other_layers
class
create_other_layers: bool = <attribute 'create_other_layers' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether layers not mapped in the layer map shall be created too See \layer_map for details.
@brief Sets a value indicating whether layers not mapped in the layer map shall be created too See \layer_map for details.
dbu
class
dbu: float = <attribute 'dbu' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the database unit to use for producing the layout. This value specifies the database to be used for the layout that is read. When a DEF file is specified with a different database unit, the layout is translated into this database unit.
@brief Sets the database unit to use for producing the layout. See \dbu for details.
fills_datatype
class
fills_datatype: int = <attribute 'fills_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the fill geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.
Fill support has been introduced in version 0.27.
@brief Sets the fill geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.
Fill support has been introduced in version 0.27.
fills_datatype_str
class
fills_datatype_str: str = <attribute 'fills_datatype_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
fills_suffix
class
fills_suffix: str = <attribute 'fills_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the fill geometry layer name suffix. See \produce_via_geometry for details about the layer production rules.
Fill support has been introduced in version 0.27.
@brief Sets the fill geometry layer name suffix. See \produce_via_geometry for details about the layer production rules.
Fill support has been introduced in version 0.27.
fills_suffix_str
class
fills_suffix_str: str = <attribute 'fills_suffix_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
instance_property_name
class
instance_property_name: Any = <attribute 'instance_property_name' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether and how to produce instance names as properties. If set to a value not nil, instance names will be attached to the instances generated as user properties. This attribute then specifies the user property name to be used for attaching the instance names. If set to nil, no instance names will be produced.
The corresponding setter is \instance_property_name=.
This method has been introduced in version 0.26.4.
@brief Sets a value indicating whether and how to produce instance names as properties. See \instance_property_name for details.
This method has been introduced in version 0.26.4.
joined_paths
class
joined_paths: bool = <attribute 'joined_paths' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether to create joined paths for wires. If this property is set to true, wires are represented by multi-segment paths as far as possible (this will fail for 45 degree path segments for example). By defauls, wires are represented by multiple straight segments.
This property has been added in version 0.28.8.
@brief Sets a value indicating whether to create joined paths for wires. See \joined_paths for details about this property.
This property has been added in version 0.28.8.
labels_datatype
class
labels_datatype: int = <attribute 'labels_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the labels layer datatype value. See \produce_via_geometry for details about the layer production rules.
@brief Sets the labels layer datatype value. See \produce_via_geometry for details about the layer production rules.
labels_suffix
class
labels_suffix: str = <attribute 'labels_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the label layer name suffix. See \produce_via_geometry for details about the layer production rules.
@brief Sets the label layer name suffix. See \produce_via_geometry for details about the layer production rules.
layer_map
class
layer_map: LayerMap = <attribute 'layer_map' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the layer map to be used for the LEF/DEF reader @return A reference to the layer map Because LEF/DEF layer mapping is substantially different than for normal layout files, the LEF/DEF reader employs a separate layer mapping table. The LEF/DEF specific layer mapping is stored within the LEF/DEF reader's configuration and can be accessed with this attribute. The layer mapping table of \LoadLayoutOptions will be ignored for the LEF/DEF reader.
The setter is \layer_map=. \create_other_layers= is available to control whether layers not specified in the layer mapping table shall be created automatically.
@brief Sets the layer map to be used for the LEF/DEF reader See \layer_map for details.
lef_files
class
lef_files: List[str] = <attribute 'lef_files' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the list technology LEF files to additionally import Returns a list of path names for technology LEF files to read in addition to the primary file. Relative paths are resolved relative to the file to read or relative to the technology base path.
The setter for this property is \lef_files=.
@brief Sets the list technology LEF files to additionally import See \lef_files for details.
lef_labels_datatype
class
lef_labels_datatype: int = <attribute 'lef_labels_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the lef_labels layer datatype value. See \produce_via_geometry for details about the layer production rules.
This method has been introduced in version 0.27.2
@brief Sets the lef_labels layer datatype value. See \produce_via_geometry for details about the layer production rules.
This method has been introduced in version 0.27.2
lef_labels_suffix
class
lef_labels_suffix: str = <attribute 'lef_labels_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the label layer name suffix. See \produce_via_geometry for details about the layer production rules.
This method has been introduced in version 0.27.2
@brief Sets the label layer name suffix. See \produce_via_geometry for details about the layer production rules.
This method has been introduced in version 0.27.2
lef_pins_datatype
class
lef_pins_datatype: int = <attribute 'lef_pins_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the LEF pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.
@brief Sets the LEF pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.
lef_pins_datatype_str
class
lef_pins_datatype_str: str = <attribute 'lef_pins_datatype_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
lef_pins_suffix
class
lef_pins_suffix: str = <attribute 'lef_pins_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the LEF pin geometry layer name suffix. See \produce_via_geometry for details about the layer production rules.
@brief Sets the LEF pin geometry layer name suffix. See \produce_via_geometry for details about the layer production rules.
lef_pins_suffix_str
class
lef_pins_suffix_str: str = <attribute 'lef_pins_suffix_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
macro_layout_files
class
macro_layout_files: List[str] = <attribute 'macro_layout_files' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the list of layout files to read for substituting macros in DEF These files play the same role than the macro layouts (see \macro_layouts), except that this property specifies a list of file names. The given files are loaded automatically to resolve macro layouts instead of LEF geometry. See \macro_resolution_mode for details when this happens. Relative paths are resolved relative to the DEF file to read or relative to the technology base path. Macros in need for substitution are looked up in the layout files by searching for cells with the same name. The files are scanned in the order they are given in the file list. The files from \macro_layout_files are scanned after the layout objects specified with \macro_layouts.
The setter for this property is \macro_layout_files=.
This property has been added in version 0.27.1.
@brief Sets the list of layout files to read for substituting macros in DEF See \macro_layout_files for details.
This property has been added in version 0.27.1.
macro_layouts
class
macro_layouts: List[Layout] = <attribute 'macro_layouts' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the layout objects used for resolving LEF macros in the DEF reader. The DEF reader can either use LEF geometry or use a separate source of layouts for the LEF macros. The \macro_resolution_mode controls whether to use LEF geometry. If LEF geometry is not used, the DEF reader will look up macro cells from the \macro_layouts and pull cell layouts from there.
The LEF cells are looked up as cells by name from the macro layouts in the order these are given in this array.
\macro_layout_files is another way of specifying such substitution layouts. This method accepts file names instead of layout objects.
This property has been added in version 0.27.
@brief Sets the layout objects used for resolving LEF macros in the DEF reader. See \macro_layouts for more details about this property.
Layout objects specified in the array for this property are not owned by the \LEFDEFReaderConfiguration object. Be sure to keep some other reference to these Layout objects if you are storing away the LEF/DEF reader configuration object.
This property has been added in version 0.27.
macro_resolution_mode
class
macro_resolution_mode: int = <attribute 'macro_resolution_mode' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the macro resolution mode (LEF macros into DEF). This property describes the way LEF macros are turned into layout cells when reading DEF. There are three modes available:
@ul @li 0: produce LEF geometry unless a FOREIGN cell is specified @/li @li 1: produce LEF geometry always and ignore FOREIGN @/li @li 2: Never produce LEF geometry and assume FOREIGN always @/li @/ul
If substitution layouts are specified with \macro_layouts, these are used to provide macro layouts in case no LEF geometry is taken.
This property has been added in version 0.27.
@brief Sets the macro resolution mode (LEF macros into DEF). See \macro_resolution_mode for details about this property.
This property has been added in version 0.27.
map_file
class
map_file: str = <attribute 'map_file' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the layer map file to use. If a layer map file is given, the reader will pull the layer mapping from this file. The layer mapping rules specified in the reader options are ignored in this case. These are the name suffix rules for vias, blockages, routing, special routing, pins etc. and the corresponding datatype rules. The \layer_map attribute will also be ignored. The layer map file path will be resolved relative to the technology base path if the LEF/DEF reader options are used in the context of a technology.
This property has been added in version 0.27.
@brief Sets the layer map file to use. See \map_file for details about this property.
This property has been added in version 0.27.
net_property_name
class
net_property_name: Any = <attribute 'net_property_name' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether and how to produce net names as properties. If set to a value not nil, net names will be attached to the net shapes generated as user properties. This attribute then specifies the user property name to be used for attaching the net names. If set to nil, no net names will be produced.
The corresponding setter is \net_property_name=.
@brief Sets a value indicating whether and how to produce net names as properties. See \net_property_name for details.
obstructions_datatype
class
obstructions_datatype: int = <attribute 'obstructions_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the obstruction marker layer datatype value. See \produce_via_geometry for details about the layer production rules.
@brief Sets the obstruction marker layer datatype value. See \produce_via_geometry for details about the layer production rules.
obstructions_suffix
class
obstructions_suffix: str = <attribute 'obstructions_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the obstruction marker layer name suffix. See \produce_via_geometry for details about the layer production rules.
@brief Sets the obstruction marker layer name suffix. See \produce_via_geometry for details about the layer production rules.
paths_relative_to_cwd
class
paths_relative_to_cwd: None = <attribute 'paths_relative_to_cwd' of 'LEFDEFReaderConfiguration' objects>
@brief Sets a value indicating whether to use paths relative to cwd (true) or DEF file (false) for map or LEF files This write-only attribute has been introduced in version 0.27.9.
pin_property_name
class
pin_property_name: Any = <attribute 'pin_property_name' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether and how to produce pin names as properties. If set to a value not nil, pin names will be attached to the pin shapes generated as user properties. This attribute then specifies the user property name to be used for attaching the pin names. If set to nil, no pin names will be produced.
The corresponding setter is \pin_property_name=.
This method has been introduced in version 0.26.4.
@brief Sets a value indicating whether and how to produce pin names as properties. See \pin_property_name for details.
This method has been introduced in version 0.26.4.
pins_datatype
class
pins_datatype: int = <attribute 'pins_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.
@brief Sets the pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.
pins_datatype_str
class
pins_datatype_str: str = <attribute 'pins_datatype_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
pins_suffix
class
pins_suffix: str = <attribute 'pins_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the pin geometry layer name suffix. See \produce_via_geometry for details about the layer production rules.
@brief Sets the pin geometry layer name suffix. See \produce_via_geometry for details about the layer production rules.
pins_suffix_str
class
pins_suffix_str: str = <attribute 'pins_suffix_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
placement_blockage_layer
class
placement_blockage_layer: str = <attribute 'placement_blockage_layer' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the layer on which to produce the placement blockage. This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \placement_blockage_layer=. See also \produce_placement_blockages.
@brief Sets the layer on which to produce the placement blockage. See \placement_blockage_layer for details.
produce_blockages
class
produce_blockages: bool = <attribute 'produce_blockages' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether routing blockage markers shall be produced. See \produce_via_geometry for details about the layer production rules.
@brief Sets a value indicating whether routing blockage markers shall be produced. See \produce_via_geometry for details about the layer production rules.
produce_cell_outlines
class
produce_cell_outlines: bool = <attribute 'produce_cell_outlines' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether to produce cell outlines (diearea). If set to true, cell outlines will be produced on the layer given by \cell_outline_layer.
@brief Sets a value indicating whether to produce cell outlines (diearea). See \produce_cell_outlines for details.
produce_fills
class
produce_fills: bool = <attribute 'produce_fills' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether fill geometries shall be produced. See \produce_via_geometry for details about the layer production rules.
Fill support has been introduced in version 0.27.
@brief Sets a value indicating whether fill geometries shall be produced. See \produce_via_geometry for details about the layer production rules.
Fill support has been introduced in version 0.27.
produce_labels
class
produce_labels: bool = <attribute 'produce_labels' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether labels shall be produced. See \produce_via_geometry for details about the layer production rules.
@brief Sets a value indicating whether labels shall be produced. See \produce_via_geometry for details about the layer production rules.
produce_lef_labels
class
produce_lef_labels: bool = <attribute 'produce_lef_labels' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether lef_labels shall be produced. See \produce_via_geometry for details about the layer production rules.
This method has been introduced in version 0.27.2
@brief Sets a value indicating whether lef_labels shall be produced. See \produce_via_geometry for details about the layer production rules.
This method has been introduced in version 0.27.2
produce_lef_pins
class
produce_lef_pins: bool = <attribute 'produce_lef_pins' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether LEF pin geometries shall be produced. See \produce_via_geometry for details about the layer production rules.
@brief Sets a value indicating whether LEF pin geometries shall be produced. See \produce_via_geometry for details about the layer production rules.
produce_obstructions
class
produce_obstructions: bool = <attribute 'produce_obstructions' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether obstruction markers shall be produced. See \produce_via_geometry for details about the layer production rules.
@brief Sets a value indicating whether obstruction markers shall be produced. See \produce_via_geometry for details about the layer production rules.
produce_pins
class
produce_pins: bool = <attribute 'produce_pins' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether pin geometries shall be produced. See \produce_via_geometry for details about the layer production rules.
@brief Sets a value indicating whether pin geometries shall be produced. See \produce_via_geometry for details about the layer production rules.
produce_placement_blockages
class
produce_placement_blockages: bool = <attribute 'produce_placement_blockages' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether to produce placement blockage regions. If set to true, polygons will be produced representing the placement blockage region on the layer given by \placement_blockage_layer.
@brief Sets a value indicating whether to produce placement blockage regions. See \produce_placement_blockages for details.
produce_regions
class
produce_regions: bool = <attribute 'produce_regions' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether to produce regions. If set to true, polygons will be produced representing the regions on the layer given by \region_layer.
The attribute has been introduced in version 0.27.
@brief Sets a value indicating whether to produce regions. See \produce_regions for details.
The attribute has been introduced in version 0.27.
produce_routing
class
produce_routing: bool = <attribute 'produce_routing' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules.
@brief Sets a value indicating whether routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules.
produce_special_routing
class
produce_special_routing: bool = <attribute 'produce_special_routing' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether special routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules.
The differentiation between special and normal routing has been introduced in version 0.27.
@brief Sets a value indicating whether special routing geometry shall be produced. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27.
produce_via_geometry
class
produce_via_geometry: bool = <attribute 'produce_via_geometry' of 'LEFDEFReaderConfiguration' objects>
@brief Sets a value indicating whether via geometries shall be produced.
If set to true, shapes will be produced for each via. The layer to be produced will be determined from the via layer's name using the suffix provided by \via_geometry_suffix. If there is a specific mapping in the layer mapping table for the via layer including the suffix, the layer/datatype will be taken from the layer mapping table. If there is a mapping to the undecorated via layer, the datatype will be substituted with the \via_geometry_datatype value. If no mapping is defined, a unique number will be assigned to the layer number and the datatype will be taken from the \via_geometry_datatype value.
For example: the via layer is 'V1', \via_geometry_suffix is 'GEO' and \via_geometry_datatype is 1. Then:
@ul @li If there is a mapping for 'V1.GEO', the layer and datatype will be taken from there. @/li @li If there is a mapping for 'V1', the layer will be taken from there and the datatype will be taken from \via_geometry_datatype. The name of the produced layer will be 'V1.GEO'. @/li @li If there is no mapping for both, the layer number will be a unique value, the datatype will be taken from \via_geometry_datatype and the layer name will be 'V1.GEO'. @/li@/ul
@brief Sets a value indicating whether via geometries shall be produced. See \produce_via_geometry for details.
read_lef_with_def
class
read_lef_with_def: bool = <attribute 'read_lef_with_def' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether to read all LEF files in the same directory than the DEF file. If this property is set to true (the default), the DEF reader will automatically consume all LEF files next to the DEF file in addition to the LEF files specified with \lef_files. If set to false, only the LEF files specified with \lef_files will be read.
This property has been added in version 0.27.
@brief Sets a value indicating whether to read all LEF files in the same directory than the DEF file. See \read_lef_with_def for details about this property.
This property has been added in version 0.27.
region_layer
class
region_layer: str = <attribute 'region_layer' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the layer on which to produce the regions. This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \region_layer=. See also \produce_regions.
The attribute has been introduced in version 0.27.
@brief Sets the layer on which to produce the regions. See \region_layer for details.
The attribute has been introduced in version 0.27.
routing_datatype
class
routing_datatype: int = <attribute 'routing_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the routing layer datatype value. See \produce_via_geometry for details about the layer production rules.
@brief Sets the routing layer datatype value. See \produce_via_geometry for details about the layer production rules.
routing_datatype_str
class
routing_datatype_str: str = <attribute 'routing_datatype_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
routing_suffix
class
routing_suffix: str = <attribute 'routing_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the routing layer name suffix. See \produce_via_geometry for details about the layer production rules.
@brief Sets the routing layer name suffix. See \produce_via_geometry for details about the layer production rules.
routing_suffix_str
class
routing_suffix_str: str = <attribute 'routing_suffix_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
separate_groups
class
separate_groups: bool = <attribute 'separate_groups' of 'LEFDEFReaderConfiguration' objects>
@brief Gets a value indicating whether to create separate parent cells for individual groups. If this property is set to true, instances belonging to different groups are separated by putting them into individual parent cells. These parent cells are named after the groups and are put into the master top cell. If this property is set to false (the default), no such group parents will be formed. This property has been added in version 0.27.
@brief Sets a value indicating whether to create separate parent cells for individual groups. See \separate_groups for details about this property.
This property has been added in version 0.27.
special_routing_datatype
class
special_routing_datatype: int = <attribute 'special_routing_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the special routing layer datatype value. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27.
@brief Sets the special routing layer datatype value. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27.
special_routing_datatype_str
class
special_routing_datatype_str: str = <attribute 'special_routing_datatype_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
special_routing_suffix
class
special_routing_suffix: str = <attribute 'special_routing_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the special routing layer name suffix. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27.
@brief Sets the special routing layer name suffix. See \produce_via_geometry for details about the layer production rules. The differentiation between special and normal routing has been introduced in version 0.27.
special_routing_suffix_str
class
special_routing_suffix_str: str = <attribute 'special_routing_suffix_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
via_cellname_prefix
class
via_cellname_prefix: str = <attribute 'via_cellname_prefix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the via cellname prefix. Vias are represented by cells. The cell name is formed by combining the via cell name prefix and the via name.
This property has been added in version 0.27.
@brief Sets the via cellname prefix. See \via_cellname_prefix for details about this property.
This property has been added in version 0.27.
via_geometry_datatype
class
via_geometry_datatype: int = <attribute 'via_geometry_datatype' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the via geometry layer datatype value. See \produce_via_geometry for details about this property.
@brief Sets the via geometry layer datatype value. See \produce_via_geometry for details about this property.
via_geometry_datatype_str
class
via_geometry_datatype_str: str = <attribute 'via_geometry_datatype_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
via_geometry_suffix
class
via_geometry_suffix: str = <attribute 'via_geometry_suffix' of 'LEFDEFReaderConfiguration' objects>
@brief Gets the via geometry layer name suffix. See \produce_via_geometry for details about this property.
@brief Sets the via geometry layer name suffix. See \produce_via_geometry for details about this property.
via_geometry_suffix_str
class
via_geometry_suffix_str: str = <attribute 'via_geometry_suffix_str' of 'LEFDEFReaderConfiguration' objects>
@hide
@hide
__copy__
method descriptor
__copy__() -> LEFDEFReaderConfiguration
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LEFDEFReaderConfiguration
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear_fill_datatypes_per_mask
method descriptor
clear_fill_datatypes_per_mask() -> None
@brief Clears the fill layer datatypes per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_fills_suffixes_per_mask
method descriptor
clear_fills_suffixes_per_mask() -> None
@brief Clears the fill layer name suffix per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_lef_pins_datatypes_per_mask
method descriptor
clear_lef_pins_datatypes_per_mask() -> None
@brief Clears the LEF pin layer datatypes per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_lef_pins_suffixes_per_mask
method descriptor
clear_lef_pins_suffixes_per_mask() -> None
@brief Clears the LEF pin layer name suffix per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_pin_datatypes_per_mask
method descriptor
clear_pin_datatypes_per_mask() -> None
@brief Clears the pin layer datatypes per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_pins_suffixes_per_mask
method descriptor
clear_pins_suffixes_per_mask() -> None
@brief Clears the pin layer name suffix per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_routing_datatypes_per_mask
method descriptor
clear_routing_datatypes_per_mask() -> None
@brief Clears the routing layer datatypes per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_routing_suffixes_per_mask
method descriptor
clear_routing_suffixes_per_mask() -> None
@brief Clears the routing layer name suffix per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_special_routing_datatypes_per_mask
method descriptor
clear_special_routing_datatypes_per_mask() -> None
@brief Clears the special routing layer datatypes per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_special_routing_suffixes_per_mask
method descriptor
clear_special_routing_suffixes_per_mask() -> None
@brief Clears the special routing layer name suffix per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_via_geometry_datatypes_per_mask
method descriptor
clear_via_geometry_datatypes_per_mask() -> None
@brief Clears the via geometry layer datatypes per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
clear_via_geometry_suffixes_per_mask
method descriptor
clear_via_geometry_suffixes_per_mask() -> None
@brief Clears the via geometry layer name suffix per mask. See \produce_via_geometry for details about this property.
Mask specific rules have been introduced in version 0.27.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LEFDEFReaderConfiguration
@brief Creates a copy of self
fills_datatype_
method descriptor
fills_datatype_()
@brief Gets the fill geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
fills_suffix_per_mask
method descriptor
fills_suffix_per_mask() -> str
@brief Gets the fill geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
lef_pins_datatype_
method descriptor
lef_pins_datatype_()
@brief Gets the LEF pin geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
lef_pins_suffix_per_mask
method descriptor
lef_pins_suffix_per_mask() -> str
@brief Gets the LEF pin geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
new
builtin
new() -> LEFDEFReaderConfiguration
@brief Creates a new object of this class
pins_datatype_
method descriptor
pins_datatype_()
@brief Gets the pin geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
pins_suffix_per_mask
method descriptor
pins_suffix_per_mask() -> str
@brief Gets the pin geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
routing_datatype_
method descriptor
routing_datatype_()
@brief Gets the routing geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
routing_suffix_per_mask
method descriptor
routing_suffix_per_mask() -> str
@brief Gets the routing geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_fills_datatype_per_mask
method descriptor
set_fills_datatype_per_mask() -> None
@brief Sets the fill geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_fills_suffix_per_mask
method descriptor
set_fills_suffix_per_mask() -> None
@brief Sets the fill geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_lef_pins_datatype_per_mask
method descriptor
set_lef_pins_datatype_per_mask() -> None
@brief Sets the LEF pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_lef_pins_suffix_per_mask
method descriptor
set_lef_pins_suffix_per_mask() -> None
@brief Sets the LEF pin geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_pins_datatype_per_mask
method descriptor
set_pins_datatype_per_mask() -> None
@brief Sets the pin geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_pins_suffix_per_mask
method descriptor
set_pins_suffix_per_mask() -> None
@brief Sets the pin geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_routing_datatype_per_mask
method descriptor
set_routing_datatype_per_mask() -> None
@brief Sets the routing geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_routing_suffix_per_mask
method descriptor
set_routing_suffix_per_mask() -> None
@brief Sets the routing geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_special_routing_datatype_per_mask
method descriptor
set_special_routing_datatype_per_mask() -> None
@brief Sets the special routing geometry layer datatype value. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_special_routing_suffix_per_mask
method descriptor
set_special_routing_suffix_per_mask() -> None
@brief Sets the special routing geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_via_geometry_datatype_per_mask
method descriptor
set_via_geometry_datatype_per_mask() -> None
@brief Sets the via geometry layer datatype value. See \produce_via_geometry for details about this property. The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
set_via_geometry_suffix_per_mask
method descriptor
set_via_geometry_suffix_per_mask() -> None
@brief Sets the via geometry layer name suffix per mask. See \produce_via_geometry for details about this property. The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
special_routing_datatype_
method descriptor
special_routing_datatype_()
@brief Gets the special routing geometry layer datatype value per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
special_routing_suffix_per_mask
method descriptor
special_routing_suffix_per_mask() -> str
@brief Gets the special routing geometry layer name suffix per mask. See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
via_geometry_datatype_
method descriptor
via_geometry_datatype_()
@brief Gets the via geometry layer datatype value per mask. See \produce_via_geometry for details about this property. The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
via_geometry_suffix_per_mask
method descriptor
via_geometry_suffix_per_mask() -> str
@brief Gets the via geometry layer name suffix per mask. See \produce_via_geometry for details about this property. The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...).
Mask specific rules have been introduced in version 0.27.
LayerInfo
@brief A structure encapsulating the layer properties
The layer properties describe how a layer is stored in a GDS2 or OASIS file for example. The \LayerInfo object represents the storage properties that are attached to a layer in the database.
In general, a layer has either a layer and a datatype number (in GDS2), a name (for example in DXF or CIF) or both (in OASIS). In the latter case, the primary identification is through layer and datatype number and the name is some annotation attached to it. A \LayerInfo object which specifies just a name returns true on \is_named?. The \LayerInfo object can also specify an anonymous layer (use \LayerInfo#new without arguments). Such a layer will not be stored when saving the layout. They can be employed for temporary layers for example. Use \LayerInfo#anonymous? to test whether a layer does not have a specification.
The \LayerInfo is used for example in \Layout#insert_layer to specify the properties of the new layer that will be created. The \is_equivalent? method compares two \LayerInfo objects using the layer and datatype numbers with a higher priority over the name.
__doc__
class
__doc__ = '@brief A structure encapsulating the layer properties\n\nThe layer properties describe how a layer is stored in a GDS2 or OASIS file for example. The \\LayerInfo object represents the storage properties that are attached to a layer in the database.\n\nIn general, a layer has either a layer and a datatype number (in GDS2), a name (for example in DXF or CIF) or both (in OASIS). In the latter case, the primary identification is through layer and datatype number and the name is some annotation attached to it. A \\LayerInfo object which specifies just a name returns true on \\is_named?.\nThe \\LayerInfo object can also specify an anonymous layer (use \\LayerInfo#new without arguments). Such a layer will not be stored when saving the layout. They can be employed for temporary layers for example. Use \\LayerInfo#anonymous? to test whether a layer does not have a specification.\n\nThe \\LayerInfo is used for example in \\Layout#insert_layer to specify the properties of the new layer that will be created. The \\is_equivalent? method compares two \\LayerInfo objects using the layer and datatype numbers with a higher priority over the name.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 61
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayerInfo' objects>
list of weak references to the object
datatype
class
datatype: int = <attribute 'datatype' of 'LayerInfo' objects>
@brief Gets the datatype
@brief Set the datatype
layer
class
layer: int = <attribute 'layer' of 'LayerInfo' objects>
@brief Gets the layer number
@brief Sets the layer number
name
class
name: str = <attribute 'name' of 'LayerInfo' objects>
@brief Gets the layer name
@brief Set the layer name The name is set on OASIS input for example, if the layer has a name.
__copy__
method descriptor
__copy__() -> LayerInfo
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayerInfo
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Compares two layer info objects @return True, if both are equal
This method was added in version 0.18.
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given layer info object. This method enables layer info objects as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(layer: int, datatype: int) -> None
__init__(layer: int, datatype: int, name: str) -> None
__init__(name: str) -> None
__init__()
@brief The constructor for a named layer with layer and datatype. Creates a \LayerInfo object representing a named layer with layer and datatype. @param layer The layer number @param datatype The datatype number @param name The name
This method was added in version 0.18.
__ne__
method descriptor
__ne__() -> bool
@brief Compares two layer info objects @return True, if both are not equal
This method was added in version 0.18.
__repr__
method descriptor
__repr__() -> str
@brief Convert the layer info object to a string @return The string
If 'as_target' is true, wildcard and relative specifications are formatted such such.
This method was added in version 0.18. The 'as_target' argument has been added in version 0.26.5.
__str__
method descriptor
__str__() -> str
@brief Convert the layer info object to a string @return The string
If 'as_target' is true, wildcard and relative specifications are formatted such such.
This method was added in version 0.18. The 'as_target' argument has been added in version 0.26.5.
anonymous
method descriptor
anonymous() -> bool
@brief Returns true, if the layer has no specification (i.e. is created by the default constructor). @return True, if the layer does not have any specification.
This method was added in version 0.23.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LayerInfo
@brief Creates a copy of self
from_string
builtin
from_string() -> LayerInfo
@brief Create a layer info object from a string @param The string @return The LayerInfo object
If 'as_target' is true, relative specifications such as '*+1' for layer or datatype are permitted.
This method will take strings as produced by \to_s and create a \LayerInfo object from them. The format is either "layer", "layer/datatype", "name" or "name (layer/datatype)".
This method was added in version 0.23. The 'as_target' argument has been added in version 0.26.5.
hash
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given layer info object. This method enables layer info objects as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_equivalent
method descriptor
is_equivalent() -> bool
@brief Equivalence of two layer info objects @return True, if both are equivalent
First, layer and datatype are compared. The name is of second order and used only if no layer or datatype is given for one of the operands. This is basically a weak comparison that reflects the search preferences. It is the basis for \Layout#find_layer. Here are some examples:
@code
no match as layer/datatypes or names differ:
RBA::LayerInfo::new(1, 17).is_equivalent?(RBA::LayerInfo::new(1, 18)) -> false RBA::LayerInfo::new('metal1').is_equivalent?(RBA::LayerInfo::new('m1')) -> false
exact match for numbered or named layers:
RBA::LayerInfo::new(1, 17).is_equivalent?(RBA::LayerInfo::new(1, 17)) -> true RBA::LayerInfo::new('metal1').is_equivalent?(RBA::LayerInfo::new('metal1')) -> true
match as names are second priority over layer/datatypes:
RBA::LayerInfo::new(1, 17, 'metal1').is_equivalent?(RBA::LayerInfo::new(1, 17, 'm1')) -> true
match as name matching is fallback:
RBA::LayerInfo::new(1, 17, 'metal1').is_equivalent?(RBA::LayerInfo::new('metal1')) -> true
no match as neither names or layer/datatypes match:
RBA::LayerInfo::new(1, 17, 'metal1').is_equivalent?(RBA::LayerInfo::new('m1')) -> false @/code
This method was added in version 0.18 and modified to compare non-named vs. named layers in version 0.28.11.
is_named
method descriptor
is_named() -> bool
@brief Returns true, if the layer is purely specified by name. @return True, if no layer or datatype is given.
This method was added in version 0.18.
new
builtin
new() -> LayerInfo
new(layer: int, datatype: int) -> LayerInfo
new(layer: int, datatype: int, name: str) -> LayerInfo
new(name: str) -> LayerInfo
new()
@brief The constructor for a named layer with layer and datatype. Creates a \LayerInfo object representing a named layer with layer and datatype. @param layer The layer number @param datatype The datatype number @param name The name
This method was added in version 0.18.
to_s
method descriptor
to_s() -> str
@brief Convert the layer info object to a string @return The string
If 'as_target' is true, wildcard and relative specifications are formatted such such.
This method was added in version 0.18. The 'as_target' argument has been added in version 0.26.5.
LayerMap
@brief An object representing an arbitrary mapping of physical layers to logical layers
"Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a \Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet.
The mapping describes an association of a set of physical layers to a set of logical ones, where multiple physical layers can be mapped to a single logical one, which effectively merges the layers.
For each logical layer, a target layer can be specified. A target layer is the layer/datatype/name combination as which the logical layer appears in the layout. By using a target layer different from the source layer renaming a layer can be achieved while loading a layout. Another use case for that feature is to assign layer names to GDS layer/datatype combinations which are numerical only.
LayerMap objects are used in two ways: as input for the reader (inside a \LoadLayoutOptions class) and as output from the reader (i.e. Layout::read method). For layer map objects used as input, the layer indexes (logical layers) can be consecutive numbers. They do not need to correspond with real layer indexes from a layout object. When used as output, the layer map's logical layers correspond to the layer indexes inside the layout that the layer map was used upon.
This is a sample how to use the LayerMap object. It maps all datatypes of layers 1, 2 and 3 to datatype 0 and assigns the names 'ONE', 'TWO' and 'THREE' to these layout layers:
@codelm = RBA::LayerMap::new lm.map("1/0-255 : ONE (1/0)") lm.map("2/0-255 : TWO (2/0)") lm.map("3/0-255 : THREE (3/0)")
read the layout using the layer map
lo = RBA::LoadLayoutOptions::new lo.layer_map.assign(lm) ly = RBA::Layout::new ly.read("input.gds", lo) @/code
1:n mapping is supported: a physical layer can be mapped to multiple logical layers using 'mmap' instead of 'map'. When using this variant, mapping acts additive. The following example will map layer 1, datatypes 0 to 255 to logical layer 0, and layer 1, datatype 17 to logical layers 0 plus 1: @codelm = RBA::LayerMap::new lm.map("1/0-255", 0) # (can be 'mmap' too) lm.mmap("1/17", 1) @/code
'unmapping' allows removing a mapping. This allows creating 'holes' in mapping ranges. The following example maps layer 1, datatypes 0 to 16 and 18 to 255 to logical layer 0: @codelm = RBA::LayerMap::new lm.map("1/0-255", 0) lm.unmap("1/17") @/code
The LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief An object representing an arbitrary mapping of physical layers to logical layers\n\n"Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a \\Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet.\n\nThe mapping describes an association of a set of physical layers to a set of logical ones, where multiple\nphysical layers can be mapped to a single logical one, which effectively merges the layers.\n\nFor each logical layer, a target layer can be specified. A target layer is the layer/datatype/name combination\nas which the logical layer appears in the layout. By using a target layer different from the source layer\nrenaming a layer can be achieved while loading a layout. Another use case for that feature is to assign\nlayer names to GDS layer/datatype combinations which are numerical only.\n\nLayerMap objects are used in two ways: as input for the reader (inside a \\LoadLayoutOptions class) and\nas output from the reader (i.e. Layout::read method). For layer map objects used as input, the layer indexes\n(logical layers) can be consecutive numbers. They do not need to correspond with real layer indexes from\na layout object. When used as output, the layer map\'s logical layers correspond to the layer indexes inside\nthe layout that the layer map was used upon.\n\nThis is a sample how to use the LayerMap object. It maps all datatypes of layers 1, 2 and 3 to datatype 0 and\nassigns the names \'ONE\', \'TWO\' and \'THREE\' to these layout layers:\n\n@codelm = RBA::LayerMap::new\nlm.map("1/0-255 : ONE (1/0)")\nlm.map("2/0-255 : TWO (2/0)")\nlm.map("3/0-255 : THREE (3/0)")\n\n# read the layout using the layer map\nlo = RBA::LoadLayoutOptions::new\nlo.layer_map.assign(lm)\nly = RBA::Layout::new\nly.read("input.gds", lo)\n@/code\n\n1:n mapping is supported: a physical layer can be mapped to multiple logical layers using \'mmap\' instead of \'map\'. When using this variant, mapping acts additive.\nThe following example will map layer 1, datatypes 0 to 255 to logical layer 0, and layer 1, datatype 17 to logical layers 0 plus 1:\n@codelm = RBA::LayerMap::new\nlm.map("1/0-255", 0) # (can be \'mmap\' too)\nlm.mmap("1/17", 1)\n@/code\n\n\'unmapping\' allows removing a mapping. This allows creating \'holes\' in mapping ranges. The following example maps layer 1, datatypes 0 to 16 and 18 to 255 to logical layer 0:\n@codelm = RBA::LayerMap::new\nlm.map("1/0-255", 0)\nlm.unmap("1/17")\n@/code\n\nThe LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 156
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayerMap' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> LayerMap
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayerMap
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear
method descriptor
clear() -> None
@brief Clears the map
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LayerMap
@brief Creates a copy of self
from_string
builtin
from_string() -> LayerMap
@brief Creates a layer map from the given string The format of the string is that used in layer mapping files: one mapping entry per line, comments are allowed using '#' or '//'. The format of each line is that used in the 'map(string, index)' method.
This method has been introduced in version 0.23.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mapped
method descriptor
is_mapped() -> bool
@brief Check, if a given physical layer is mapped @param layer The physical layer specified with an \LayerInfo object. @return True, if the layer is mapped.
logical
method descriptor
logical() -> int
@brief Returns the logical layer (the layer index in the layout object) for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. @return The logical layer index or -1 if the layer is not mapped. This method is deprecated with version 0.27 as in this version, layers can be mapped to multiple targets which this method can't capture. Use \logicals instead.
logicals
method descriptor
logicals() -> List[int]
@brief Returns the logical layers for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. @return This list of logical layers this physical layer as mapped to or empty if there is no mapping. This method has been introduced in version 0.27.
map
method descriptor
map(map_expr: str, log_layer: Optional[int] = ...) -> None
map(phys_layer: LayerInfo, log_layer: int) -> None
map(phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None
map(pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None
map(pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None
map()
@brief Maps a physical layer given by a string to a logical one @param map_expr The string describing the physical layer to map. @param log_layer The logical layer to which the physical layers are mapped.
The string expression is constructed using the syntax: "list[/list][;..]" for layer/datatype pairs. "list" is a sequence of numbers, separated by comma values or a range separated by a hyphen. Examples are: "1/2", "1-5/0", "1,2,5/0", "1/5;5/6".
layer/datatype wildcards can be specified with "". When "" is used for the upper limit, it is equivalent to "all layer above". When used alone, it is equivalent to "all layers". Examples: "1 / ", " / 10-*"
Named layers are specified simply by specifying the name, if necessary in single or double quotes (if the name begins with a digit or contains non-word characters). layer/datatype and name descriptions can be mixed, i.e. "AA;1/5" (meaning: name "AA" or layer 1/datatype 5).
A target layer can be specified with the ":
A target can include relative layer/datatype specifications and wildcards. For example, "1-10/0: +1/0" will add 1 to the original layer number. "1-10/0-50: * / " will use the original layers.
If the logical layer is negative or omitted, the method will select the next available one.
Target mapping has been added in version 0.20. The logical layer is optional since version 0.28.
mapping
method descriptor
mapping() -> LayerInfo
@brief Returns the mapped physical (or target if one is specified) layer for a given logical layer @param log_layer The logical layer for which the mapping is requested. @return A \LayerInfo object which is the physical layer mapped to the logical layer. In general, there may be more than one physical layer mapped to one logical layer. This method will return a single one of them. It will return the one with the lowest layer and datatype.
mapping_str
method descriptor
mapping_str() -> str
@brief Returns the mapping string for a given logical layer @param log_layer The logical layer for which the mapping is requested. @return A string describing the mapping. The mapping string is compatible with the string that the "map" method accepts.
mmap
method descriptor
mmap(map_expr: str, log_layer: Optional[int] = ...) -> None
mmap(phys_layer: LayerInfo, log_layer: int) -> None
mmap(phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None
mmap(pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None
mmap(pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None
mmap()
@brief Maps a physical layer given by an expression to a logical one and adds to existing mappings
This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. For backward compatibility, 'map' still substitutes mapping.
If the logical layer is negative or omitted, the method will select the next available one.
Multi-mapping has been added in version 0.27. The logical layer is optional since version 0.28.
new
builtin
new() -> LayerMap
@brief Creates a new object of this class
to_string
method descriptor
to_string() -> str
@brief Converts a layer mapping object to a string This method is the inverse of the \from_string method.
This method has been introduced in version 0.23.
unmap
method descriptor
unmap(expr: str) -> None
unmap(phys_layer: LayerInfo) -> None
unmap(pl_start: LayerInfo, pl_stop: LayerInfo) -> None
unmap()
@brief Unmaps the layers from the given expression This method has been introduced in version 0.27.
LayerMapping
@brief A layer mapping (source to target layout)
A layer mapping is an association of layers in two layouts forming pairs of layers, i.e. one layer corresponds to another layer in the other layout. The LayerMapping object describes the mapping of layers of a source layout A to a target layout B.
A layer mapping can be set up manually or using the methods \create or \create_full.
@code lm = RBA::LayerMapping::new
explicit:
lm.map(2, 1) # map layer index 2 of source to 1 of target lm.map(7, 3) # map layer index 7 of source to 3 of target ...
or employing the specification identity:
lm.create(target_layout, source_layout)
plus creating layers which don't exist in the target layout yet:
new_layers = lm.create_full(target_layout, source_layout) @/code
A layer might not be mapped to another layer which basically means that there is no corresponding layer. Such layers will be ignored in operations using the layer mapping. Use \create_full to ensure all layers of the source layout are mapped.
LayerMapping objects play a role mainly in the hierarchical copy or move operations of \Layout. However, use is not restricted to these applications.
This class has been introduced in version 0.23.
__doc__
class
__doc__ = "@brief A layer mapping (source to target layout)\n\nA layer mapping is an association of layers in two layouts forming pairs of layers, i.e. one layer corresponds to another layer in the other layout. The LayerMapping object describes the mapping of layers of a source layout A to a target layout B.\n\nA layer mapping can be set up manually or using the methods \\create or \\create_full.\n\n@code\nlm = RBA::LayerMapping::new\n# explicit:\nlm.map(2, 1) # map layer index 2 of source to 1 of target\nlm.map(7, 3) # map layer index 7 of source to 3 of target\n...\n# or employing the specification identity:\nlm.create(target_layout, source_layout)\n# plus creating layers which don't exist in the target layout yet:\nnew_layers = lm.create_full(target_layout, source_layout)\n@/code\n\nA layer might not be mapped to another layer which basically means that there is no corresponding layer.\nSuch layers will be ignored in operations using the layer mapping. Use \\create_full to ensure all layers\nof the source layout are mapped.\n\nLayerMapping objects play a role mainly in the hierarchical copy or move operations of \\Layout. However, use is not restricted to these applications.\n\nThis class has been introduced in version 0.23."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 60
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayerMapping' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> LayerMapping
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayerMapping
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear
method descriptor
clear() -> None
@brief Clears the mapping.
create
method descriptor
create() -> None
@brief Initialize the layer mapping from two layouts
@param layout_a The target layout @param layout_b The source layout
The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. \create_full is a version of this method which creates new layers in layout_a if no corresponding layer is found.
create_full
method descriptor
create_full() -> List[int]
@brief Initialize the layer mapping from two layouts
@param layout_a The target layout @param layout_b The source layout @return A list of layers created
The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. Layers with a valid specification which are not found in layout_a are created there.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LayerMapping
@brief Creates a copy of self
has_mapping
method descriptor
has_mapping() -> bool
@brief Determine if a layer in layout_b has a mapping to a layout_a layer.
@param layer_index_b The index of the layer in layout_b whose mapping is requested. @return true, if the layer has a mapping
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layer_mapping
method descriptor
layer_mapping() -> int
@brief Determine layer mapping of a layout_b layer to the corresponding layout_a layer.
@param layer_index_b The index of the layer in layout_b whose mapping is requested. @return The corresponding layer in layout_a.
map
method descriptor
map() -> None
@brief Explicitly specify a mapping.
@param layer_index_b The index of the layer in layout B (the "source") @param layer_index_a The index of the layer in layout A (the "target")
Beside using the mapping generator algorithms provided through \create and \create_full, it is possible to explicitly specify layer mappings using this method.
new
builtin
new() -> LayerMapping
@brief Creates a new object of this class
table
method descriptor
table() -> Dict[int, int]
@brief Returns the mapping table.
The mapping table is a dictionary where the keys are source layout layer indexes and the values are the target layout layer indexes.
This method has been introduced in version 0.25.
Layout
@brief The layout object
This object represents a layout. The layout object contains the cell hierarchy and adds functionality for managing cell names and layer names. The cell hierarchy can be changed by adding cells and cell instances. Cell instances will virtually put the content of a cell into another cell. Many cell instances can be put into a cell thus forming repetitions of the cell content. This process can be repeated over multiple levels. In effect a cell graphs is created with parent cells and child cells. The graph must not be recursive, so there is at least one top cell, which does not have a parent cell. Multiple top cells can be present.
\Layout is the very basic class of the layout database. It has a rich set of methods to manipulate and query the layout hierarchy, the geometrical objects, the meta information and other features of the layout database. For a discussion of the basic API and the related classes see @The Database API@.
Usually layout objects have already been created by KLayout's application core. You can address such a layout via the \CellView object inside the \LayoutView class. For example:
@code active_layout = RBA::CellView::active.layout puts "Top cell of current layout is #{active_layout.top_cell.name}" @/code
However, a layout can also be used standalone:
@code layout = RBA::Layout::new cell = layout.create_cell("TOP") layer = layout.layer(RBA::LayerInfo::new(1, 0)) cell.shapes(layer).insert(RBA::Box::new(0, 0, 1000, 1000)) layout.write("single_rect.gds") @/code
__doc__
class
__doc__ = '@brief The layout object\n\nThis object represents a layout.\nThe layout object contains the cell hierarchy and\nadds functionality for managing cell names and layer names.\nThe cell hierarchy can be changed by adding cells and cell instances.\nCell instances will virtually put the content of a cell into another cell. Many cell instances can be put into a cell thus forming repetitions of the cell content. This process can be repeated over multiple levels. In effect a cell graphs is created with parent cells and child cells. The graph must not be recursive, so there is at least one top cell, which does not have a parent cell. Multiple top cells can be present.\n\n\\Layout is the very basic class of the layout database. It has a rich set of methods to manipulate and query the layout hierarchy, the geometrical objects, the meta information and other features of the layout database. For a discussion of the basic API and the related classes see @<a href="/programming/database_api.xml">The Database API@</a>.\n\nUsually layout objects have already been created by KLayout\'s application core. You can address such a layout via the \\CellView object inside the \\LayoutView class. For example:\n\n@code\nactive_layout = RBA::CellView::active.layout\nputs "Top cell of current layout is #{active_layout.top_cell.name}"\n@/code\n\nHowever, a layout can also be used standalone:\n\n@code\nlayout = RBA::Layout::new\ncell = layout.create_cell("TOP")\nlayer = layout.layer(RBA::LayerInfo::new(1, 0))\ncell.shapes(layer).insert(RBA::Box::new(0, 0, 1000, 1000))\nlayout.write("single_rect.gds")\n@/code\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 62
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Layout' objects>
list of weak references to the object
dbu
class
dbu: float = <attribute 'dbu' of 'Layout' objects>
@brief Gets the database unit
The database unit is the value of one units distance in micrometers. For numerical reasons and to be compliant with the GDS2 format, the database objects use integer coordinates. The basic unit of these coordinates is the database unit. You can convert coordinates to micrometers by multiplying the integer value with the database unit. Typical values for the database unit are 0.001 micrometer (one nanometer).
@brief Sets the database unit
See \dbu for a description of the database unit.
prop_id
class
prop_id: int = <attribute 'prop_id' of 'Layout' objects>
@brief Gets the properties ID associated with the layout
This method has been introduced in version 0.24.
@brief Sets the properties ID associated with the layout This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property.
This method has been introduced in version 0.24.
technology_name
class
technology_name: str = <attribute 'technology_name' of 'Layout' objects>
@brief Gets the name of the technology this layout is associated with This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element.
@brief Sets the name of the technology this layout is associated with Changing the technology name will re-assess all library references because libraries can be technology specified. Cell layouts may be substituted during this re-assessment.
This method has been introduced in version 0.27.
__copy__
method descriptor
__copy__() -> Layout
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Layout
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
__init__(editable: bool) -> None
__init__(editable: bool, manager: Manager) -> None
__init__(manager: Manager) -> None
__init__()
@brief Creates a layout object
This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods.
This method was introduced in version 0.22.
add_cell
method descriptor
add_cell() -> int
@brief Adds a cell with the given name @return The index of the newly created cell.
From version 0.23 on this method is deprecated because another method exists which is more convenient because is returns a \Cell object (\create_cell).
add_lib_cell
method descriptor
add_lib_cell() -> int
@brief Imports a cell from the library @param library The reference to the library from which to import the cell @param lib_cell_index The index of the imported cell in the library @return The cell index of the new proxy cell in this layout This method imports the given cell from the library and creates a new proxy cell. The proxy cell acts as a pointer to the actual cell which still resides in the library (precisely: in library.layout). The name of the new cell will be the name of library cell.
This method has been introduced in version 0.22.
add_meta_info
method descriptor
add_meta_info() -> None
@brief Adds meta information to the layout See \LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.25.
add_pcell_variant
method descriptor
add_pcell_variant(library: Library, pcell_id: int, parameters: Dict[str, Any]) -> int
add_pcell_variant(library: Library, pcell_id: int, parameters: Sequence[Any]) -> int
add_pcell_variant(pcell_id: int, parameters: Dict[str, Any]) -> int
add_pcell_variant(pcell_id: int, parameters: Sequence[Any]) -> int
add_pcell_variant()
@brief Creates a PCell variant for a PCell located in an external library @return The cell index of the new proxy cell in this layout This method will import a PCell from a library and create a variant for the given parameter set. Technically, this method creates a proxy to the library and creates the variant inside that library.
The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object.
The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated.
This method has been introduced in version 0.22.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
begin_shapes
method descriptor
begin_shapes(cell: Cell, layer: int) -> RecursiveShapeIterator
begin_shapes(cell_index: int, layer: int) -> RecursiveShapeIterator
begin_shapes()
@brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer @param cell_index The index of the initial (top) cell @param layer The layer from which to get the shapes @return A suitable iterator
For details see the description of the \RecursiveShapeIterator class.
This method is deprecated. Use \Cell#begin_shapes_rec instead.
This method has been added in version 0.18.
begin_shapes_overlapping
method descriptor
begin_shapes_overlapping(cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator
begin_shapes_overlapping(cell_index: Cell, layer: int, region: Box) -> RecursiveShapeIterator
begin_shapes_overlapping(cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator
begin_shapes_overlapping(cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator
begin_shapes_overlapping()
@brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units @param cell The cell object for the starting cell @param layer The layer from which to get the shapes @param region The search region as a \DBox object in micrometer units @return A suitable iterator
For details see the description of the \RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region. It is convenience overload which takes a cell object instead of a cell index.
This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead.
This variant has been added in version 0.25.
begin_shapes_touching
method descriptor
begin_shapes_touching(cell: Cell, layer: int, region: Box) -> RecursiveShapeIterator
begin_shapes_touching(cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator
begin_shapes_touching(cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator
begin_shapes_touching(cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator
begin_shapes_touching()
@brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units @param cell The cell object for the starting cell @param layer The layer from which to get the shapes @param region The search region as a \DBox object in micrometer units @return A suitable iterator
For details see the description of the \RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region. It is convenience overload which takes a cell object instead of a cell index.
This method is deprecated. Use \Cell#begin_shapes_rec_touching instead.
This variant has been added in version 0.25.
break_polygons
method descriptor
break_polygons(layer: int, max_vertex_count: int, max_area_ratio: float) -> None
break_polygons(max_vertex_count: int, max_area_ratio: float) -> None
break_polygons()
@brief Breaks the polygons of the layer into smaller ones
This variant applies breaking to all cells and the given layer.
This method has been introduced in version 0.29.5.
cell
method descriptor
cell(i: int) -> Cell
cell(i: int) -> Cell
cell(name: str) -> Cell
cell(name: str) -> Cell
cell()
@brief Gets a cell object from the cell index (const version)
@param i The cell index @return A reference to the cell (a \Cell object)
If the cell index is not a valid cell index, this method will raise an error. Use \is_valid_cell_index? to test whether a given cell index is valid.
This variant has been introduced in version 0.29.6.
cell_by_name
method descriptor
cell_by_name() -> int
@brief Gets the cell index for a given name Returns the cell index for the cell with the given name. If no cell with this name exists, an exception is thrown. From version 0.23 on, a version of the \cell method is provided which returns a \Cell object for the cell with the given name or "nil" if the name is not valid. This method replaces \cell_by_name and \has_cell?
cell_name
method descriptor
cell_name() -> str
@brief Gets the name for a cell with the given index
cells
method descriptor
cells() -> int
cells(name_filter: str) -> List[Cell]
cells(name_filter: str) -> List[Cell]
cells()
@brief Gets the cell objects for a given name filter (const version)
@param name_filter The cell name filter (glob pattern) @return A list of \Cell object of the cells matching the pattern
This method has been introduced in version 0.27.3.
This variant has been introduced in version 0.29.6.
cleanup
method descriptor
cleanup() -> None
@brief Cleans up the layout This method will remove proxy objects that are no longer in use. After changing PCell parameters such proxy objects may still be present in the layout and are cached for later reuse. Usually they are cleaned up automatically, but in a scripting context it may be useful to clean up these cells explicitly.
Use 'cell_indexes_to_keep' for specifying a list of cell indexes of PCell variants or library proxies you don't want to be cleaned up.
This method has been introduced in version 0.25.
clear
method descriptor
clear() -> None
@brief Clears the layout
Clears the layout completely.
clear_all_meta_info
method descriptor
clear_all_meta_info() -> None
@brief Clears all meta information of the layout (cell specific and global) See \LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.28.16.
clear_layer
method descriptor
clear_layer(layer: LayerInfo) -> None
clear_layer(layer: LayerInfo, flags: int) -> None
clear_layer(layer_index: int) -> None
clear_layer(layer_index: int, flags: int) -> None
clear_layer()
@brief Clears a layer (given shape types only)
This variant takes a \LayerInfo object to address the layer. It does nothing if no layer with these attributes exists.
This variant was introduced in version 0.26.7.
@param layer The attributes of the layer to clear.
clear_meta_info
method descriptor
clear_meta_info() -> None
@brief Clears the meta information of the layout See \LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.28.8.
clip
method descriptor
clip(cell: Cell, box: Box) -> Cell
clip(cell: Cell, box: DBox) -> Cell
clip(cell: int, box: Box) -> int
clip(cell: int, box: DBox) -> int
clip()
@brief Clips the given cell by the given rectangle and produce a new cell with the clip @param cell The cell reference of the cell to clip @param box The clip box in micrometer units @return The reference to the new cell
This variant which takes a micrometer-unit box and cell references has been added in version 0.28.
clip_into
method descriptor
clip_into(cell: Cell, target: Layout, box: Box) -> Cell
clip_into(cell: Cell, target: Layout, box: DBox) -> Cell
clip_into(cell: int, target: Layout, box: Box) -> int
clip_into(cell: int, target: Layout, box: DBox) -> int
clip_into()
@brief Clips the given cell by the given rectangle and produce a new cell with the clip @param cell The reference to the cell to clip @param box The clip box in micrometer units @param target The target layout @return The reference to the new cell in the target layout
This variant which takes a micrometer-unit box and cell references has been added in version 0.28.
convert_cell_to_static
method descriptor
convert_cell_to_static() -> int
@brief Converts a PCell or library cell to a usual (static) cell @return The index of the new cell This method will create a new cell which contains the static representation of the PCell or library proxy given by "cell_index". If that cell is not a PCell or library proxy, it won't be touched and the input cell index is returned.
This method has been added in version 0.23.
copy_layer
method descriptor
copy_layer(src: int, dest: int) -> None
copy_layer(src: int, dest: int, flags: int) -> None
copy_layer()
@brief Copies a layer (selected shape types only)
Copies a layer from the source to the destination layer. The destination layer is not cleared before, so that this method merges shapes from the source with the destination layer.
@param src The layer index of the source layer. @param dest The layer index of the destination layer. @param flags A combination of the shape type flags from \Shapes, S... constants
This method variant has been introduced in version 0.28.9.
copy_meta_info
method descriptor
copy_meta_info(other: Layout) -> None
copy_meta_info(other: Layout, cm: CellMapping) -> None
copy_meta_info()
@brief Copies the meta information from the other layout into this layout for the cells given by the cell mapping See \LayoutMetaInfo for details about cells and meta information. This method will use the source/target cell pairs from the cell mapping object and merge the meta information from each source cell from the 'other' layout into the mapped cell inside self. This method can be used with '\copy_tree_shapes' and similar to copy meta information in addition to the shapes. All cell-specific keys in this layout will be replaced by the respective values from the other layout.
This method has been introduced in version 0.28.16.
copy_tree_shapes
method descriptor
copy_tree_shapes(source_layout: Layout, cell_mapping: CellMapping) -> None
copy_tree_shapes(source_layout: Layout, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None
copy_tree_shapes()
@brief Copies the shapes for all given mappings in the \CellMapping object using the given layer mapping @param source_layout The layout where to take the shapes from @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout @param layer_mapping Specifies which layers are copied from the source layout to the target layout
Provide a \CellMapping object to specify pairs of cells which are mapped from the source layout to this layout. When constructing such a cell mapping object for example with \CellMapping#for_multi_cells_full, use self as the target layout. During the cell mapping construction, the cell mapper will usually create a suitable target hierarchy already. After having completed the cell mapping, use \copy_tree_shapes to copy over the shapes from the source to the target layout.
This method has been added in version 0.26.8.
create
method descriptor
create() -> None
@brief 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.
create_cell
method descriptor
create_cell(name: str) -> Cell
create_cell(name: str, lib_name: str) -> Cell
create_cell(pcell_name: str, lib_name: str, params: Dict[str, Any]) -> Cell
create_cell(pcell_name: str, params: Dict[str, Any]) -> Cell
create_cell()
@brief Creates a cell for a PCell with the given PCell name from the given library @param pcell_name The name of the PCell and also the name of the cell to create @param lib_name The name of the library where to take the PCell from @param params The PCell parameters (key/value dictionary) @return The \Cell object of the newly created cell or an existing cell if this PCell has already been used with the given parameters
This method will look up the PCell by the PCell name in the specified library and create a new PCell variant for the given parameters plus the library proxy. The parameters must be specified as a key/value dictionary with the names being the ones from the PCell declaration.
If no PCell with the given name exists or the library name is not valid, nil is returned. Note that this function - despite the name - may not always create a new cell, but return an existing cell if the PCell from the library has already been used with the given parameters.
This method has been introduce in version 0.24.
delete_cell
method descriptor
delete_cell() -> None
@brief Deletes a cell
This deletes a cell but not the sub cells of the cell. These subcells will likely become new top cells unless they are used otherwise. All instances of this cell are deleted as well. Hint: to delete multiple cells, use "delete_cells" which is far more efficient in this case.
@param cell_index The index of the cell to delete
This method has been introduced in version 0.20.
delete_cell_rec
method descriptor
delete_cell_rec() -> None
@brief Deletes a cell plus all subcells
This deletes a cell and also all sub cells of the cell. In contrast to \prune_cell, all cells are deleted together with their instances even if they are used otherwise.
@param cell_index The index of the cell to delete
This method has been introduced in version 0.20.
delete_cells
method descriptor
delete_cells() -> None
@brief Deletes multiple cells
This deletes the cells but not the sub cells of these cells. These subcells will likely become new top cells unless they are used otherwise. All instances of these cells are deleted as well.
@param cell_index_list An array of cell indices of the cells to delete
This method has been introduced in version 0.20.
delete_layer
method descriptor
delete_layer(layer: LayerInfo) -> None
delete_layer(layer_index: int) -> None
delete_layer()
@brief Deletes a layer
This variant takes a \LayerInfo object to address the layer. It does nothing if no layer with these attributes exists.
This variant was introduced in version 0.26.7.
@param layer The attributes of the layer to delete.
delete_property
method descriptor
delete_property() -> None
@brief Deletes the user property with the given key This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID.
This method has been introduced in version 0.24.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dump_mem_statistics
method descriptor
dump_mem_statistics() -> None
@hide
dup
method descriptor
dup() -> Layout
@brief Creates a copy of self
each_cell
method descriptor
each_cell() -> Iterator[Cell]
@brief Iterates the unsorted cell list
each_cell_bottom_up
method descriptor
each_cell_bottom_up() -> Iterator[int]
@brief Iterates the bottom-up sorted cell list
In bottom-up traversal a cell is not delivered before the last child cell of this cell has been delivered. The bottom-up iterator does not deliver cells but cell indices actually.
each_cell_top_down
method descriptor
each_cell_top_down() -> Iterator[int]
@brief Iterates the top-down sorted cell list
The top-down cell list has the property of delivering all cells before they are instantiated. In addition the first cells are all top cells. There is at least one top cell. The top-down iterator does not deliver cells but cell indices actually. @brief begin iterator of the top-down sorted cell list
each_meta_info
method descriptor
each_meta_info() -> Iterator[LayoutMetaInfo]
@brief Iterates over the meta information of the layout See \LayoutMetaInfo for details about layouts and meta information.
This method has been introduced in version 0.25.
each_top_cell
method descriptor
each_top_cell() -> Iterator[int]
@brief Iterates the top cells A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell.
end_changes
method descriptor
end_changes() -> None
@brief Cancels the "in changes" state (see "start_changes")
error_layer
method descriptor
error_layer() -> int
@brief Returns the index of the error layer The error layer is used to place error texts on it, for example when a PCell evaluation fails.
This method has been added in version 0.23.13.
find_layer
method descriptor
find_layer(info: LayerInfo) -> Any
find_layer(layer: int, datatype: int) -> Any
find_layer(layer: int, datatype: int, name: str) -> Any
find_layer(name: str) -> Any
find_layer()
@brief Finds a layer with the given layer and datatype number and name
If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, it will return nil.
This method has been introduced in version 0.23.
flatten
method descriptor
flatten() -> None
@brief Flattens the given cell
This method propagates all shapes and instances from the specified number of hierarchy levels below into the given cell. It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. If prune is set to true, these cells are removed if not used otherwise.
@param cell_index The cell which should be flattened @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) @param prune Set to true to remove orphan cells.
This method has been introduced in version 0.20.
flatten_into
method descriptor
flatten_into() -> None
@brief Flattens the given cell into another cell
This method works like 'flatten', but allows specification of a target cell which can be different from the source cell plus a transformation which is applied for all shapes and instances in the target cell.
In contrast to the 'flatten' method, the source cell is not modified.
@param source_cell_index The source cell which should be flattened @param target_cell_index The target cell into which the resulting objects are written @param trans The transformation to apply on the output shapes and instances @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.)
This method has been introduced in version 0.24.
get_info
method descriptor
get_info() -> LayerInfo
@brief Gets the info structure for a specified layer If the layer index is not a valid layer index, an empty LayerProperties object will be returned.
guiding_shape_layer
method descriptor
guiding_shape_layer() -> int
@brief Returns the index of the guiding shape layer The guiding shape layer is used to store guiding shapes for PCells.
This method has been added in version 0.22.
has_cell
method descriptor
has_cell() -> bool
@brief Returns true if a cell with a given name exists Returns true, if the layout has a cell with the given name
has_prop_id
method descriptor
has_prop_id() -> bool
@brief Returns true, if the layout has user properties
This method has been introduced in version 0.24.
insert
method descriptor
insert(cell_index: int, layer: int, edge_pairs: EdgePairs) -> None
insert(cell_index: int, layer: int, edges: Edges) -> None
insert(cell_index: int, layer: int, region: Region) -> None
insert(cell_index: int, layer: int, texts: Texts) -> None
insert()
@brief Inserts an text collection into the given cell and layer If the text collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of texts. If the text collection is deep (hierarchical), it will create a subhierarchy below the given cell and its texts will be put into the respective cells. Suitable subcells will be picked for inserting the texts. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy.
This method has been introduced in version 0.27.
insert_layer
method descriptor
insert_layer() -> int
@brief Inserts a new layer with the given properties @return The index of the newly created layer
insert_layer_at
method descriptor
insert_layer_at() -> None
@brief Inserts a new layer with the given properties at the given index This method will associate the given layer info with the given layer index. If a layer with that index already exists, this method will change the properties of the layer with that index. Otherwise a new layer is created.
insert_special_layer
method descriptor
insert_special_layer() -> int
@brief Inserts a new special layer with the given properties
Special layers can be used to represent objects that should not participate in normal viewing or other related operations. Special layers are not reported as valid layers.
@return The index of the newly created layer
insert_special_layer_at
method descriptor
insert_special_layer_at() -> None
@brief Inserts a new special layer with the given properties at the given index
See \insert_special_layer for a description of special layers.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_editable
method descriptor
is_editable() -> bool
@brief Returns a value indicating whether the layout is editable. @return True, if the layout is editable. If a layout is editable, in general manipulation methods are enabled and some optimizations are disabled (i.e. shape arrays are expanded).
This method has been introduced in version 0.22.
is_free_layer
method descriptor
is_free_layer() -> bool
@brief Returns true, if a layer index is a free (unused) layer index
@return true, if this is the case
This method has been introduced in version 0.26.
is_special_layer
method descriptor
is_special_layer() -> bool
@brief Returns true, if a layer index is a special layer index
@return true, if this is the case
is_valid_cell_index
method descriptor
is_valid_cell_index() -> bool
@brief Returns true, if a cell index is a valid index
@return true, if this is the case This method has been added in version 0.20.
is_valid_layer
method descriptor
is_valid_layer() -> bool
@brief Returns true, if a layer index is a valid normal layout layer index
@return true, if this is the case
layer
method descriptor
layer() -> int
layer(info: LayerInfo) -> int
layer(layer: int, datatype: int) -> int
layer(layer: int, datatype: int, name: str) -> int
layer(name: str) -> int
layer()
@brief Finds or creates a layer with the given layer and datatype number and name
If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned.
This method has been introduced in version 0.23.
layer_indexes
method descriptor
layer_indexes() -> List[int]
@brief Gets a list of valid layer's indices This method returns an array with layer indices representing valid layers.
This method has been introduced in version 0.19.
layer_indices
method descriptor
layer_indices() -> List[int]
@brief Gets a list of valid layer's indices This method returns an array with layer indices representing valid layers.
This method has been introduced in version 0.19.
layer_infos
method descriptor
layer_infos() -> List[LayerInfo]
@brief Gets a list of valid layer's properties The method returns an array with layer properties representing valid layers. The sequence and length of this list corresponds to that of \layer_indexes.
This method has been introduced in version 0.25.
layers
method descriptor
layers() -> int
@brief Returns the number of layers The number of layers reports the maximum (plus 1) layer index used so far. Not all of the layers with an index in the range of 0 to layers-1 needs to be a valid layer. These layers can be either valid, special or unused. Use \is_valid_layer? and \is_special_layer? to test for the first two states.
library
method descriptor
library() -> Library
@brief Gets the library this layout lives in or nil if the layout is not part of a library This attribute has been introduced in version 0.27.5.
merge_meta_info
method descriptor
merge_meta_info(other: Layout) -> None
merge_meta_info(other: Layout, cm: CellMapping) -> None
merge_meta_info()
@brief Merges the meta information from the other layout into this layout for the cells given by the cell mapping See \LayoutMetaInfo for details about cells and meta information. This method will use the source/target cell pairs from the cell mapping object and merge the meta information from each source cell from the 'other' layout into the mapped cell inside self. This method can be used with '\copy_tree_shapes' and similar to copy meta information in addition to the shapes. Existing cell-specific keys in this layout will be overwritten by the respective values from the other layout. New keys will be added.
This method has been introduced in version 0.28.16.
meta_info
method descriptor
meta_info() -> LayoutMetaInfo
@brief Gets the meta information for a given name See \LayoutMetaInfo for details about layouts and meta information.
If no meta information with the given name exists, nil is returned.
This method has been introduced in version 0.28.8.
meta_info_value
method descriptor
meta_info_value() -> Any
@brief Gets the meta information value for a given name See \LayoutMetaInfo for details about layouts and meta information.
If no meta information with the given name exists, a nil value will be returned. A more generic version that delivers all fields of the meta information is \meta_info.
This method has been introduced in version 0.25. Starting with version 0.28.8, the value is of variant type instead of string only.
move_layer
method descriptor
move_layer(src: int, dest: int) -> None
move_layer(src: int, dest: int, flags: int) -> None
move_layer()
@brief Moves a layer (selected shape types only)
Moves a layer from the source to the destination layer. The target is not cleared before, so that this method merges shapes from the source with the destination layer. The copied shapes are removed from the source layer.
@param src The layer index of the source layer. @param dest The layer index of the destination layer. @param flags A combination of the shape type flags from \Shapes, S... constants
This method variant has been introduced in version 0.28.9.
move_tree_shapes
method descriptor
move_tree_shapes(source_layout: Layout, cell_mapping: CellMapping) -> None
move_tree_shapes(source_layout: Layout, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None
move_tree_shapes()
@brief Moves the shapes for all given mappings in the \CellMapping object using the given layer mapping
This method acts like the corresponding \copy_tree_shapes method, but removes the shapes from the source layout after they have been copied.
This method has been added in version 0.26.8.
multi_clip
method descriptor
multi_clip(cell: Cell, boxes: Sequence[Box]) -> List[Cell]
multi_clip(cell: Cell, boxes: Sequence[DBox]) -> List[Cell]
multi_clip(cell: int, boxes: Sequence[Box]) -> List[int]
multi_clip(cell: int, boxes: Sequence[DBox]) -> List[int]
multi_clip()
@brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. @param cell The reference to the cell to clip @param boxes The clip boxes in micrometer units @return The references to the new cells
This variant which takes cell references and micrometer-unit boxes has been added in version 0.28.
multi_clip_into
method descriptor
multi_clip_into(cell: Cell, target: Layout, boxes: Sequence[Box]) -> List[Cell]
multi_clip_into(cell: Cell, target: Layout, boxes: Sequence[DBox]) -> List[Cell]
multi_clip_into(cell: int, target: Layout, boxes: Sequence[Box]) -> List[int]
multi_clip_into(cell: int, target: Layout, boxes: Sequence[DBox]) -> List[int]
multi_clip_into()
@brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. @param cell The reference the cell to clip @param boxes The clip boxes in micrometer units @param target The target layout @return The references to the new cells
This variant which takes cell references and micrometer-unit boxes has been added in version 0.28.
new
builtin
new() -> Layout
new(editable: bool) -> Layout
new(editable: bool, manager: Manager) -> Layout
new(manager: Manager) -> Layout
new()
@brief Creates a layout object
This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods.
This method was introduced in version 0.22.
pcell_declaration
method descriptor
pcell_declaration(name: str) -> PCellDeclaration_Native
pcell_declaration(pcell_id: int) -> PCellDeclaration_Native
pcell_declaration()
@brief Gets a reference to the PCell declaration for the PCell with the given PCell ID. Returns a reference to the local PCell declaration with the given PCell id. If the parameter is not a valid PCell ID, this method returns nil. The PCell ID is the number returned by \register_pcell for example.
Usually this method is used on library layouts that define PCells. Note that this method cannot be used on the layouts using the PCell from a library.
This method has been introduced in version 0.22.
pcell_id
method descriptor
pcell_id() -> int
@brief Gets the ID of the PCell with the given name This method is equivalent to 'pcell_declaration(name).id'.
This method has been introduced in version 0.22.
pcell_ids
method descriptor
pcell_ids() -> List[int]
@brief Gets the IDs of the PCells registered in the layout Returns an array of PCell IDs.
This method has been introduced in version 0.24.
pcell_names
method descriptor
pcell_names() -> List[str]
@brief Gets the names of the PCells registered in the layout Returns an array of PCell names.
This method has been introduced in version 0.24.
properties
method descriptor
properties() -> Any
properties(properties_id: int) -> List[Any]
properties()
@brief Gets the properties set for a given properties ID
Basically this method performs the backward conversion of the 'properties_id' method. Given a properties ID, it returns the properties set as an array. In this array, each key and the value is stored as a pair (an array with two elements). If the properties ID is not valid, an empty array is returned. A version that returns a hash instead of pairs of key/values, is \properties_hash.
@param properties_id The properties ID to get the properties for @return An array of key/value pairs (see \properties_id)
The 'properties_array' alias was introduced in version 0.29.7 and the plain 'properties' alias was deprecated.
properties_array
method descriptor
properties_array() -> List[Any]
@brief Gets the properties set for a given properties ID
Basically this method performs the backward conversion of the 'properties_id' method. Given a properties ID, it returns the properties set as an array. In this array, each key and the value is stored as a pair (an array with two elements). If the properties ID is not valid, an empty array is returned. A version that returns a hash instead of pairs of key/values, is \properties_hash.
@param properties_id The properties ID to get the properties for @return An array of key/value pairs (see \properties_id)
The 'properties_array' alias was introduced in version 0.29.7 and the plain 'properties' alias was deprecated.
properties_hash
method descriptor
properties_hash() -> Any
@brief Gets the properties set for a given properties ID as a hash
Returns the properties for a given properties ID as a hash. It is a convenient alternative to \properties_array, which returns an array of key/value pairs.
@param properties_id The properties ID to get the properties for @return The hash representing the properties for the given ID (values vs. key)
This method has been introduced in version 0.29.7.
properties_id
method descriptor
properties_id(properties: Dict[Any, Any]) -> int
properties_id(properties: Sequence[Any]) -> int
properties_id()
@brief Gets the properties ID for a given properties set
This variant accepts a hash of value vs. key for the properties instead of array of key/value pairs. Apart from this, it behaves like the other \properties_id variant.
@param properties A hash of property keys/values (both keys and values can be integer, double or string) @return The unique properties ID for that set
This variant has been introduced in version 0.29.7.
property
method descriptor
property() -> Any
@brief Gets the Layout's user property with the given key This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the properties ID to retrieve the property value. This method has been introduced in version 0.24.
prune_cell
method descriptor
prune_cell() -> None
@brief Deletes a cell plus subcells not used otherwise
This deletes a cell and also all sub cells of the cell which are not used otherwise. The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. All instances of this cell are deleted as well.
@param cell_index The index of the cell to delete @param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.)
This method has been introduced in version 0.20.
prune_subcells
method descriptor
prune_subcells() -> None
@brief Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy
This deletes all sub cells of the cell which are not used otherwise. All instances of the deleted cells are deleted as well. It is possible to specify how many levels of hierarchy below the given root cell are considered.
@param cell_index The root cell from which to delete a sub cells @param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.)
This method has been introduced in version 0.20.
read
method descriptor
read(filename: str) -> LayerMap
read(filename: str, options: LoadLayoutOptions) -> LayerMap
read()
@brief Load the layout from the given file with options The format of the file is determined automatically and automatic unzipping is provided. In this version, some reader options can be specified. @param filename The name of the file to load. @param options The options object specifying further options for the reader. @return A layer map that contains the mapping used by the reader including the layers that have been created. This method has been added in version 0.18.
refresh
method descriptor
refresh() -> None
@brief Calls \Cell#refresh on all cells inside this layout This method is useful to recompute all PCells from a layout. Note that this does not update PCells which are linked from a library. To recompute PCells from a library, you need to use \Library#refresh on the library object from which the PCells are imported.
This method has been introduced in version 0.27.9.
register_pcell
method descriptor
register_pcell() -> int
@brief Registers a PCell declaration under the given name Registers a local PCell in the current layout. If a declaration with that name already exists, it is replaced with the new declaration.
This method has been introduced in version 0.22.
remove_meta_info
method descriptor
remove_meta_info() -> None
@brief Removes meta information from the layout See \LayoutMetaInfo for details about layouts and meta information. This method has been introduced in version 0.25.
rename_cell
method descriptor
rename_cell() -> None
@brief Renames the cell with given index The cell with the given index is renamed to the given name. NOTE: it is not ensured that the name is unique. This method allows assigning identical names to different cells which usually breaks things. Consider using \unique_cell_name to generate truely unique names.
scale_and_snap
method descriptor
scale_and_snap(cell: Cell, grid: int, mult: int, div: int) -> None
scale_and_snap(cell_index: int, grid: int, mult: int, div: int) -> None
scale_and_snap()
@brief Scales and snaps the layout below a given cell by the given rational factor and snaps to the given grid
Like the other version of \scale_and_snap, but taking a cell index for the argument.
This method has been introduced in version 0.26.1.
set_info
method descriptor
set_info() -> None
@brief Sets the info structure for a specified layer
set_property
method descriptor
set_property() -> None
@brief Sets the user property with the given key to the given value This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. This method has been introduced in version 0.24.
start_changes
method descriptor
start_changes() -> None
@brief Signals the start of an operation bringing the layout into invalid state
This method should be called whenever the layout is about to be brought into an invalid state. After calling this method, \under_construction? returns true which tells foreign code (i.e. the asynchronous painter or the cell tree view) not to use this layout object.
This state is cancelled by the \end_changes method. The start_changes method can be called multiple times and must be cancelled the same number of times.
This method can be used to speed up certain operations. For example iterating over the layout with a \RecursiveShapeIterator while modifying other layers of the layout can be very inefficient, because inside the loop the layout's state is invalidate and updated frequently. Putting a update and start_changes sequence before the loop (use both methods in that order!) and a end_changes call after the loop can improve the performance dramatically.
In addition, it can be necessary to prevent redraw operations in certain cases by using start_changes .. end_changes, in particular when it is possible to put a layout object into an invalid state temporarily.
While the layout is under construction \update can be called to update the internal state explicitly if required. This for example might be necessary to update the cell bounding boxes or to redo the sorting for region queries.
swap_layers
method descriptor
swap_layers() -> None
@brief Swap two layers
Swaps the shapes of both layers.
This method was introduced in version 0.19.
@param a The first of the layers to swap. @param b The second of the layers to swap.
technology
method descriptor
technology() -> Technology
@brief Gets the \Technology object of the technology this layout is associated with or nil if the layout is not associated with a technology This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element.
top_cell
method descriptor
top_cell() -> Cell
top_cell() -> Cell
top_cell()
@brief Returns the top cell object (const version) @return The \Cell object of the top cell If the layout has a single top cell, this method returns the top cell's \Cell object. If the layout does not have a top cell, this method returns "nil". If the layout has multiple top cells, this method raises an error.
This variant has been introduced in version 0.29.6.
top_cells
method descriptor
top_cells() -> List[Cell]
top_cells() -> List[Cell]
top_cells()
@brief Returns the top cell objects (const version) @return The \Cell objects of the top cells This method returns and array of \Cell objects representing the top cells of the layout. This array can be empty, if the layout does not have a top cell (i.e. no cell at all).
This variant has been introduced in version 0.29.6.
transform
method descriptor
transform(trans: DCplxTrans) -> None
transform(trans: DTrans) -> None
transform(trans: ICplxTrans) -> None
transform(trans: Trans) -> None
transform()
@brief Transforms the layout with the given complex integer transformation, which is in micrometer units This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a \ICplxTrans argument.
This method has been introduced in version 0.23.
under_construction
method descriptor
under_construction() -> bool
@brief Returns true if the layout object is under construction
A layout object is either under construction if a transaction is ongoing or the layout is brought into invalid state by "start_changes".
unique_cell_name
method descriptor
unique_cell_name() -> str
@brief Creates a new unique cell name from the given name @return A unique name derived from the argument
If a cell with the given name exists, a suffix will be added to make the name unique. Otherwise, the argument will be returned unchanged.
The returned name can be used to rename cells without risk of creating name clashes.
This method has been introduced in version 0.28.
update
method descriptor
update() -> None
@brief Updates the internals of the layout This method updates the internal state of the layout. Usually this is done automatically This method is provided to ensure this explicitly. This can be useful while using \start_changes and \end_changes to wrap a performance-critical operation. See \start_changes for more details.
write
method descriptor
write(filename: str) -> None
write(filename: str, gzip: bool, options: SaveLayoutOptions) -> None
write(filename: str, options: SaveLayoutOptions) -> None
write()
@brief Writes the layout to a stream file @param filename The file to which to write the layout
LayoutDiff
@brief The layout compare tool
The layout compare tool is a facility to quickly compare layouts and derive events that give details about the differences. The events are basically emitted following a certain order:
@ul @li General configuration events (database units, layers ...) @/li @li \on_begin_cell @/li @li \on_begin_inst_differences (if the instances differ) @/li @li details about instance differences (if \Verbose flag is given) @/li @li \on_end_inst_differences (if the instances differ) @/li @li \on_begin_layer @/li @li \on_begin_polygon_differences (if the polygons differ) @/li @li details about polygon differences (if \Verbose flag is given) @/li @li \on_end_polygon_differences (if the polygons differ) @/li @li other shape difference events (paths, boxes, ...) @/li @li \on_end_layer @/li @li repeated layer event groups @/li @li \on_end_cell @/li @li repeated cell event groups @/li @/ul
To use the diff facility, create a \LayoutDiff object and call the \compare_layout or \compare_cell method:
@code lya = ... # layout A lyb = ... # layout B
diff = RBA::LayoutDiff::new diff.on_polygon_in_a_only do |poly| puts "Polygon in A: #{diff.cell_a.name}@#{diff.layer_info_a.to_s}: #{poly.to_s}" end diff.on_polygon_in_b_only do |poly| puts "Polygon in A: #{diff.cell_b.name}@#{diff.layer_info_b.to_s}: #{poly.to_s}" end diff.compare(lya, lyb, RBA::LayoutDiff::Verbose + RBA::LayoutDiff::NoLayerNames) @/code
BoxesAsPolygons
class
BoxesAsPolygons: int = 64
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
DontSummarizeMissingLayers
class
DontSummarizeMissingLayers: int = 1024
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
FlattenArrayInsts
class
FlattenArrayInsts: int = 128
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
IgnoreDuplicates
class
IgnoreDuplicates: int = 4096
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
NoLayerNames
class
NoLayerNames: int = 16
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
NoProperties
class
NoProperties: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
NoTextDetails
class
NoTextDetails: int = 2048
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
NoTextOrientation
class
NoTextOrientation: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PathsAsPolygons
class
PathsAsPolygons: int = 256
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Silent
class
Silent: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SmartCellMapping
class
SmartCellMapping: int = 512
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Verbose
class
Verbose: int = 32
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
WithMetaInfo
class
WithMetaInfo: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief The layout compare tool\n\nThe layout compare tool is a facility to quickly compare layouts and derive events that give details about the differences. The events are basically emitted following a certain order:\n\n@ul\n@li General configuration events (database units, layers ...) @/li\n@li \\on_begin_cell @/li\n@li \\on_begin_inst_differences (if the instances differ) @/li\n@li details about instance differences (if \\Verbose flag is given) @/li\n@li \\on_end_inst_differences (if the instances differ) @/li\n@li \\on_begin_layer @/li\n@li \\on_begin_polygon_differences (if the polygons differ) @/li\n@li details about polygon differences (if \\Verbose flag is given) @/li\n@li \\on_end_polygon_differences (if the polygons differ) @/li\n@li other shape difference events (paths, boxes, ...) @/li\n@li \\on_end_layer @/li\n@li repeated layer event groups @/li\n@li \\on_end_cell @/li\n@li repeated cell event groups @/li\n@/ul\n\nTo use the diff facility, create a \\LayoutDiff object and call the \\compare_layout or \\compare_cell method:\n\n@code\nlya = ... # layout A\nlyb = ... # layout B\n\ndiff = RBA::LayoutDiff::new\ndiff.on_polygon_in_a_only do |poly|\n puts "Polygon in A: #{diff.cell_a.name}@#{diff.layer_info_a.to_s}: #{poly.to_s}"\nend\ndiff.on_polygon_in_b_only do |poly|\n puts "Polygon in A: #{diff.cell_b.name}@#{diff.layer_info_b.to_s}: #{poly.to_s}"\nend\ndiff.compare(lya, lyb, RBA::LayoutDiff::Verbose + RBA::LayoutDiff::NoLayerNames)\n@/code\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 64
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayoutDiff' objects>
list of weak references to the object
on_bbox_differs
class
on_bbox_differs: None = <attribute 'on_bbox_differs' of 'LayoutDiff' objects>
@brief This signal indicates a difference in the bounding boxes of two cells This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences.
@brief This signal indicates a difference in the bounding boxes of two cells This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences.
on_begin_box_differences
class
on_begin_box_differences: None = <attribute 'on_begin_box_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the boxes on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts.
@brief This signal indicates differences in the boxes on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts.
on_begin_cell
class
on_begin_cell: None = <attribute 'on_begin_cell' of 'LayoutDiff' objects>
@brief This signal indicates the sequence of events for a cell pair All cell specific events happen between \begin_cell_event and \end_cell_event signals.
@brief This signal indicates the sequence of events for a cell pair All cell specific events happen between \begin_cell_event and \end_cell_event signals.
on_begin_edge_differences
class
on_begin_edge_differences: None = <attribute 'on_begin_edge_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the edges on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts.
@brief This signal indicates differences in the edges on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts.
on_begin_edge_pair_differences
class
on_begin_edge_pair_differences: None = <attribute 'on_begin_edge_pair_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the edge pairs on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edge pairs that are different between the two layouts. This event has been introduced in version 0.28.
@brief This signal indicates differences in the edge pairs on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edge pairs that are different between the two layouts. This event has been introduced in version 0.28.
on_begin_inst_differences
class
on_begin_inst_differences: None = <attribute 'on_begin_inst_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the cell instances In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event).
@brief This signal indicates differences in the cell instances In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event).
on_begin_layer
class
on_begin_layer: None = <attribute 'on_begin_layer' of 'LayoutDiff' objects>
@brief This signal indicates differences on the given layer In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar).
@brief This signal indicates differences on the given layer In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar).
on_begin_path_differences
class
on_begin_path_differences: None = <attribute 'on_begin_path_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the paths on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts.
@brief This signal indicates differences in the paths on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts.
on_begin_polygon_differences
class
on_begin_polygon_differences: None = <attribute 'on_begin_polygon_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the polygons on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts.
@brief This signal indicates differences in the polygons on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts.
on_begin_text_differences
class
on_begin_text_differences: None = <attribute 'on_begin_text_differences' of 'LayoutDiff' objects>
@brief This signal indicates differences in the texts on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts.
@brief This signal indicates differences in the texts on the current layer The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts.
on_box_in_a_only
class
on_box_in_a_only: None = <attribute 'on_box_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates a box that is present in the first layout only
@brief This signal indicates a box that is present in the first layout only
on_box_in_b_only
class
on_box_in_b_only: None = <attribute 'on_box_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates a box that is present in the second layout only
@brief This signal indicates a box that is present in the second layout only
on_cell_in_a_only
class
on_cell_in_a_only: None = <attribute 'on_cell_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates that the given cell is only present in the first layout
@brief This signal indicates that the given cell is only present in the first layout
on_cell_in_b_only
class
on_cell_in_b_only: None = <attribute 'on_cell_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates that the given cell is only present in the second layout
@brief This signal indicates that the given cell is only present in the second layout
on_cell_meta_info_differs
class
on_cell_meta_info_differs: None = <attribute 'on_cell_meta_info_differs' of 'LayoutDiff' objects>
@brief This signal indicates that meta info between the current cells differs Meta information is only compared when \WithMetaInfo is added to the compare flags. 'a' and 'b' are the values for the first and second layout. 'nil' is passed to these values to indicate missing meta information on one side.
This event has been added in version 0.28.16.
@brief This signal indicates that meta info between the current cells differs Meta information is only compared when \WithMetaInfo is added to the compare flags. 'a' and 'b' are the values for the first and second layout. 'nil' is passed to these values to indicate missing meta information on one side.
This event has been added in version 0.28.16.
on_cell_name_differs
class
on_cell_name_differs: None = <attribute 'on_cell_name_differs' of 'LayoutDiff' objects>
@brief This signal indicates a difference in the cell names This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names.
@brief This signal indicates a difference in the cell names This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names.
on_dbu_differs
class
on_dbu_differs: None = <attribute 'on_dbu_differs' of 'LayoutDiff' objects>
@brief This signal indicates a difference in the database units of the layouts
@brief This signal indicates a difference in the database units of the layouts
on_edge_in_a_only
class
on_edge_in_a_only: None = <attribute 'on_edge_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates an edge that is present in the first layout only
@brief This signal indicates an edge that is present in the first layout only
on_edge_in_b_only
class
on_edge_in_b_only: None = <attribute 'on_edge_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates an edge that is present in the second layout only
@brief This signal indicates an edge that is present in the second layout only
on_edge_pair_in_a_only
class
on_edge_pair_in_a_only: None = <attribute 'on_edge_pair_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates an edge pair that is present in the first layout only This event has been introduced in version 0.28.
@brief This signal indicates an edge pair that is present in the first layout only This event has been introduced in version 0.28.
on_edge_pair_in_b_only
class
on_edge_pair_in_b_only: None = <attribute 'on_edge_pair_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates an edge pair that is present in the second layout only This event has been introduced in version 0.28.
@brief This signal indicates an edge pair that is present in the second layout only This event has been introduced in version 0.28.
on_end_box_differences
class
on_end_box_differences: None = <attribute 'on_end_box_differences' of 'LayoutDiff' objects>
@brief This signal indicates the end of sequence of box differences
@brief This signal indicates the end of sequence of box differences
on_end_cell
class
on_end_cell: None = <attribute 'on_end_cell' of 'LayoutDiff' objects>
@brief This signal indicates the end of a sequence of signals for a specific cell
@brief This signal indicates the end of a sequence of signals for a specific cell
on_end_edge_differences
class
on_end_edge_differences: None = <attribute 'on_end_edge_differences' of 'LayoutDiff' objects>
@brief This signal indicates the end of sequence of edge differences
@brief This signal indicates the end of sequence of edge differences
on_end_edge_pair_differences
class
on_end_edge_pair_differences: None = <attribute 'on_end_edge_pair_differences' of 'LayoutDiff' objects>
@brief This signal indicates the end of sequence of edge pair differences
This event has been introduced in version 0.28.
@brief This signal indicates the end of sequence of edge pair differences
This event has been introduced in version 0.28.
on_end_inst_differences
class
on_end_inst_differences: None = <attribute 'on_end_inst_differences' of 'LayoutDiff' objects>
@brief This signal finishes a sequence of detailed instance difference events
@brief This signal finishes a sequence of detailed instance difference events
on_end_layer
class
on_end_layer: None = <attribute 'on_end_layer' of 'LayoutDiff' objects>
@brief This signal indicates the end of a sequence of signals for a specific layer
@brief This signal indicates the end of a sequence of signals for a specific layer
on_end_path_differences
class
on_end_path_differences: None = <attribute 'on_end_path_differences' of 'LayoutDiff' objects>
@brief This signal indicates the end of sequence of path differences
@brief This signal indicates the end of sequence of path differences
on_end_polygon_differences
class
on_end_polygon_differences: None = <attribute 'on_end_polygon_differences' of 'LayoutDiff' objects>
@brief This signal indicates the end of sequence of polygon differences
@brief This signal indicates the end of sequence of polygon differences
on_end_text_differences
class
on_end_text_differences: None = <attribute 'on_end_text_differences' of 'LayoutDiff' objects>
@brief This signal indicates the end of sequence of text differences
@brief This signal indicates the end of sequence of text differences
on_instance_in_a_only
class
on_instance_in_a_only: None = <attribute 'on_instance_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates an instance that is present only in the first layout This event is only emitted in verbose mode (\Verbose flag).
@brief This signal indicates an instance that is present only in the first layout This event is only emitted in verbose mode (\Verbose flag).
on_instance_in_b_only
class
on_instance_in_b_only: None = <attribute 'on_instance_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates an instance that is present only in the second layout This event is only emitted in verbose mode (\Verbose flag).
@brief This signal indicates an instance that is present only in the second layout This event is only emitted in verbose mode (\Verbose flag).
on_layer_in_a_only
class
on_layer_in_a_only: None = <attribute 'on_layer_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates a layer that is present only in the first layout
@brief This signal indicates a layer that is present only in the first layout
on_layer_in_b_only
class
on_layer_in_b_only: None = <attribute 'on_layer_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates a layer that is present only in the second layout
@brief This signal indicates a layer that is present only in the second layout
on_layer_name_differs
class
on_layer_name_differs: None = <attribute 'on_layer_name_differs' of 'LayoutDiff' objects>
@brief This signal indicates a difference in the layer names
@brief This signal indicates a difference in the layer names
on_layout_meta_info_differs
class
on_layout_meta_info_differs: None = <attribute 'on_layout_meta_info_differs' of 'LayoutDiff' objects>
@brief This signal indicates that global meta info differs Meta information is only compared when \WithMetaInfo is added to the compare flags. 'a' and 'b' are the values for the first and second layout. 'nil' is passed to these values to indicate missing meta information on one side.
This event has been added in version 0.28.16.
@brief This signal indicates that global meta info differs Meta information is only compared when \WithMetaInfo is added to the compare flags. 'a' and 'b' are the values for the first and second layout. 'nil' is passed to these values to indicate missing meta information on one side.
This event has been added in version 0.28.16.
on_path_in_a_only
class
on_path_in_a_only: None = <attribute 'on_path_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates a path that is present in the first layout only
@brief This signal indicates a path that is present in the first layout only
on_path_in_b_only
class
on_path_in_b_only: None = <attribute 'on_path_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates a path that is present in the second layout only
@brief This signal indicates a path that is present in the second layout only
on_per_layer_bbox_differs
class
on_per_layer_bbox_differs: None = <attribute 'on_per_layer_bbox_differs' of 'LayoutDiff' objects>
@brief This signal indicates differences in the per-layer bounding boxes of the current cell
@brief This signal indicates differences in the per-layer bounding boxes of the current cell
on_polygon_in_a_only
class
on_polygon_in_a_only: None = <attribute 'on_polygon_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates a polygon that is present in the first layout only
@brief This signal indicates a polygon that is present in the first layout only
on_polygon_in_b_only
class
on_polygon_in_b_only: None = <attribute 'on_polygon_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates a polygon that is present in the second layout only
@brief This signal indicates a polygon that is present in the second layout only
on_text_in_a_only
class
on_text_in_a_only: None = <attribute 'on_text_in_a_only' of 'LayoutDiff' objects>
@brief This signal indicates a text that is present in the first layout only
@brief This signal indicates a text that is present in the first layout only
on_text_in_b_only
class
on_text_in_b_only: None = <attribute 'on_text_in_b_only' of 'LayoutDiff' objects>
@brief This signal indicates a text that is present in the second layout only
@brief This signal indicates a text that is present in the second layout only
__copy__
method descriptor
__copy__() -> LayoutDiff
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayoutDiff
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cell_a
method descriptor
cell_a() -> Cell
@brief Gets the current cell for the first layout This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell.
cell_b
method descriptor
cell_b() -> Cell
@brief Gets the current cell for the second layout This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell.
compare
method descriptor
compare(a: Cell, b: Cell, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool
compare(a: Layout, b: Layout, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool
compare()
@brief Compares two cells
Compares layer definitions, cells, instances and shapes and properties of two layout hierarchies starting from the given cells. Cells are identified by name. Only layers with valid layer and datatype are compared. Several flags can be specified as a bitwise or combination of the constants.
@param a The first top cell @param b The second top cell @param flags Flags to use for the comparison @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...)
@return True, if the cells are identical
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LayoutDiff
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layer_index_a
method descriptor
layer_index_a() -> int
@brief Gets the current layer for the first layout This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer.
layer_index_b
method descriptor
layer_index_b() -> int
@brief Gets the current layer for the second layout This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer.
layer_info_a
method descriptor
layer_info_a() -> LayerInfo
@brief Gets the current layer properties for the first layout This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer.
layer_info_b
method descriptor
layer_info_b() -> LayerInfo
@brief Gets the current layer properties for the second layout This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer.
layout_a
method descriptor
layout_a() -> Layout
@brief Gets the first layout the difference detector runs on
layout_b
method descriptor
layout_b() -> Layout
@brief Gets the second layout the difference detector runs on
new
builtin
new() -> LayoutDiff
@brief Creates a new object of this class
LayoutMetaInfo
@brief A piece of layout meta information Layout meta information is basically additional data that can be attached to a layout. Layout readers may generate meta information and some writers will add layout information to the layout object. Some writers will also read meta information to determine certain attributes.
Multiple layout meta information objects can be attached to one layout using \Layout#add_meta_info. Meta information is identified by a unique name and carries a string value plus an optional description string. The description string is for information only and is not evaluated by code.
Meta information can be attached to the layout object and to cells. It is similar to user properties. The differences are:
@ul @li Meta information is stored differently in GDS and OASIS files using the context information added by KLayout to annotated PCell or library cells too. Hence meta information does not pollute the standard user properties space. @/li @li The value of meta information can be complex serializable types such as lists, hashes and elementary objects such as \Box or \DBox. Scalar types include floats and booleans. @/li @li Meta information keys are strings and are supported also for GDS which only accepts integer number keys for user properties. @/li @/ul
Elementary (serializable) objects are: \Box, \DBox, \Edge, \DEdge, \EdgePair, \DEdgePair, \EdgePairs, \Edges, \LayerProperties, \Matrix2d, \Matrix3d, \Path, \DPath, \Point, \DPoint, \Polygon, \DPolygon, \SimplePolygon, \DSimplePolygon, \Region, \Text, \DText, \Texts, \Trans, \DTrans, \CplxTrans, \ICplxTrans, \DCplxTrans, \VCplxTrans, \Vector, \DVector (list may not be complete).
KLayout itself also generates meta information with specific keys. For disambiguation, namespaces can be established by prefixing the key strings with some unique identifier in XML fashion, like a domain name - e.g. 'example.com:key'.
@b Note: @/b only meta information marked with \is_persisted? == true is stored in GDS or OASIS files. This is not the default setting, so you need to explicitly set that flag.
See also \Layout#each_meta_info, \Layout#meta_info_value, \Layout#meta_info and \Layout#remove_meta_info as well as the corresponding \Cell methods.
An example of how to attach persisted meta information to a cell is here:
@code ly = RBA::Layout::new c1 = ly.create_cell("C1")
mi = RBA::LayoutMetaInfo::new("the-answer", 42.0) mi.persisted = true c1.add_meta_info(mi)
will now hold this piece of meta information attached to cell 'C1':
ly.write("to.gds") @/code
This class has been introduced in version 0.25 and was extended in version 0.28.8.
__doc__
class
__doc__ = '@brief A piece of layout meta information\nLayout meta information is basically additional data that can be attached to a layout. Layout readers may generate meta information and some writers will add layout information to the layout object. Some writers will also read meta information to determine certain attributes.\n\nMultiple layout meta information objects can be attached to one layout using \\Layout#add_meta_info. Meta information is identified by a unique name and carries a string value plus an optional description string. The description string is for information only and is not evaluated by code.\n\nMeta information can be attached to the layout object and to cells. It is similar to user properties. The differences are:\n\n@ul\n@li Meta information is stored differently in GDS and OASIS files using the context information added by KLayout to annotated PCell or library cells too. Hence meta information does not pollute the standard user properties space. @/li\n@li The value of meta information can be complex serializable types such as lists, hashes and elementary objects such as \\Box or \\DBox. Scalar types include floats and booleans. @/li\n@li Meta information keys are strings and are supported also for GDS which only accepts integer number keys for user properties. @/li\n@/ul\n\nElementary (serializable) objects are: \\Box, \\DBox, \\Edge, \\DEdge, \\EdgePair, \\DEdgePair, \\EdgePairs, \\Edges, \\LayerProperties, \\Matrix2d, \\Matrix3d, \\Path, \\DPath, \\Point, \\DPoint, \\Polygon, \\DPolygon, \\SimplePolygon, \\DSimplePolygon, \\Region, \\Text, \\DText, \\Texts, \\Trans, \\DTrans, \\CplxTrans, \\ICplxTrans, \\DCplxTrans, \\VCplxTrans, \\Vector, \\DVector (list may not be complete).\n\nKLayout itself also generates meta information with specific keys. For disambiguation, namespaces can be established by prefixing the key strings with some unique identifier in XML fashion, like a domain name - e.g. \'example.com:key\'.\n\n@b Note: @/b only meta information marked with \\is_persisted? == true is stored in GDS or OASIS files. This is not the default setting, so you need to explicitly set that flag.\n\nSee also \\Layout#each_meta_info, \\Layout#meta_info_value, \\Layout#meta_info and \\Layout#remove_meta_info as well as the corresponding \\Cell methods.\n\nAn example of how to attach persisted meta information to a cell is here:\n\n@code\nly = RBA::Layout::new\nc1 = ly.create_cell("C1")\n\nmi = RBA::LayoutMetaInfo::new("the-answer", 42.0)\nmi.persisted = true\nc1.add_meta_info(mi)\n\n# will now hold this piece of meta information attached to cell \'C1\':\nly.write("to.gds")\n@/code\n\nThis class has been introduced in version 0.25 and was extended in version 0.28.8.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 84
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayoutMetaInfo' objects>
list of weak references to the object
description
class
description: str = <attribute 'description' of 'LayoutMetaInfo' objects>
@brief Gets the description of the layout meta info object
@brief Sets the description of the layout meta info object
name
class
name: str = <attribute 'name' of 'LayoutMetaInfo' objects>
@brief Gets the name of the layout meta info object
@brief Sets the name of the layout meta info object
persisted
class
persisted: bool = <attribute 'persisted' of 'LayoutMetaInfo' objects>
@brief Gets a value indicating whether the meta information will be persisted This predicate was introduced in version 0.28.8.
@brief Sets a value indicating whether the meta information will be persisted This predicate was introduced in version 0.28.8.
value
class
value: Any = <attribute 'value' of 'LayoutMetaInfo' objects>
@brief Gets the value of the layout meta info object
@brief Sets the value of the layout meta info object
__copy__
method descriptor
__copy__() -> LayoutMetaInfo
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayoutMetaInfo
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a layout meta info object @param name The name @param value The value @param description An optional description text @param persisted If true, the meta information will be persisted in some file formats, like GDS2
The 'persisted' attribute has been introduced in version 0.28.8.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LayoutMetaInfo
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_persisted
method descriptor
is_persisted() -> bool
@brief Gets a value indicating whether the meta information will be persisted This predicate was introduced in version 0.28.8.
new
builtin
new() -> LayoutMetaInfo
@brief Creates a layout meta info object @param name The name @param value The value @param description An optional description text @param persisted If true, the meta information will be persisted in some file formats, like GDS2
The 'persisted' attribute has been introduced in version 0.28.8.
LayoutQuery
@brief A layout query Layout queries are the backbone of the "Search & replace" feature. Layout queries allow retrieval of data from layouts and manipulation of layouts. This object provides script binding for this feature. Layout queries are used by first creating a query object. Depending on the nature of the query, either \execute or \each can be used to execute the query. \execute will run the query and return once the query is finished. \execute is useful for running queries that don't return results such as "delete" or "with ... do" queries. \each can be used when the results of the query need to be retrieved.
The \each method will call a block a of code for every result available. It will provide a \LayoutQueryIterator object that allows accessing the results of the query. Depending on the query, different attributes of the iterator object will be available. For example, "select" queries will fill the "data" attribute with an array of values corresponding to the columns of the selection.
Here is some sample code: @code ly = RBA::CellView::active.layout q = RBA::LayoutQuery::new("select cell.name, cell.bbox from *") q.each(ly) do |iter| puts "cell name: #{iter.data[0]}, bounding box: #{iter.data[1]}" end @/code
The LayoutQuery class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief A layout query\nLayout queries are the backbone of the "Search & replace" feature. Layout queries allow retrieval of data from layouts and manipulation of layouts. This object provides script binding for this feature.\nLayout queries are used by first creating a query object. Depending on the nature of the query, either \\execute or \\each can be used to execute the query. \\execute will run the query and return once the query is finished. \\execute is useful for running queries that don\'t return results such as "delete" or "with ... do" queries.\n\\each can be used when the results of the query need to be retrieved.\n\nThe \\each method will call a block a of code for every result available. It will provide a \\LayoutQueryIterator object that allows accessing the results of the query. Depending on the query, different attributes of the iterator object will be available. For example, "select" queries will fill the "data" attribute with an array of values corresponding to the columns of the selection.\n\nHere is some sample code:\n@code\nly = RBA::CellView::active.layout\nq = RBA::LayoutQuery::new("select cell.name, cell.bbox from *")\nq.each(ly) do |iter|\n puts "cell name: #{iter.data[0]}, bounding box: #{iter.data[1]}"\nend\n@/code\n\nThe LayoutQuery class has been introduced in version 0.25.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 66
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayoutQuery' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new query object from the given query string
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
each
method descriptor
each() -> Iterator[LayoutQueryIterator]
@brief Executes the query and delivered the results iteratively. The argument to the block is a \LayoutQueryIterator object which can be asked for specific results.
The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26.
execute
method descriptor
execute() -> None
@brief Executes the query
This method can be used to execute "active" queries such as "delete" or "with ... do". It is basically equivalent to iterating over the query until it is done.
The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> LayoutQuery
@brief Creates a new query object from the given query string
property_names
method descriptor
property_names() -> List[str]
@brief Gets a list of property names available. The list of properties available from the query depends on the nature of the query. This method allows detection of the properties available. Within the query, all of these properties can be obtained from the query iterator using \LayoutQueryIterator#get.
LayoutQueryIterator
@brief Provides the results of the query
This object is used by \LayoutQuery#each to deliver the results of a query in an iterative fashion. See \LayoutQuery for a detailed description of the query interface.
The LayoutQueryIterator class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief Provides the results of the query\n\nThis object is used by \\LayoutQuery#each to deliver the results of a query in an iterative fashion. See \\LayoutQuery for a detailed description of the query interface.\n\nThe LayoutQueryIterator class has been introduced in version 0.25.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 65
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayoutQueryIterator' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
cell
method descriptor
cell() -> Any
@brief A shortcut for 'get("cell")'
cell_index
method descriptor
cell_index() -> Any
@brief A shortcut for 'get("cell_index")'
create
method descriptor
create() -> None
@brief 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.
data
method descriptor
data() -> Any
@brief A shortcut for 'get("data")'
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dtrans
method descriptor
dtrans() -> Any
@brief A shortcut for 'get("dtrans")'
get
method descriptor
get() -> Any
@brief Gets the query property with the given name The query properties available can be obtained from the query object using \LayoutQuery#property_names. Some shortcut methods are available. For example, the \data method provides a shortcut for 'get("data")'.
If a property with the given name is not available, nil will be returned.
initial_cell
method descriptor
initial_cell() -> Any
@brief A shortcut for 'get("initial_cell")'
initial_cell_index
method descriptor
initial_cell_index() -> Any
@brief A shortcut for 'get("initial_cell_index")'
inst
method descriptor
inst() -> Any
@brief A shortcut for 'get("inst")'
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layer_index
method descriptor
layer_index() -> Any
@brief A shortcut for 'get("layer_index")'
layout
method descriptor
layout() -> Layout
@brief Gets the layout the query acts on
new
builtin
new() -> LayoutQueryIterator
@brief Creates a new object of this class
parent_cell
method descriptor
parent_cell() -> Any
@brief A shortcut for 'get("parent_cell")'
parent_cell_index
method descriptor
parent_cell_index() -> Any
@brief A shortcut for 'get("parent_cell_index")'
path_dtrans
method descriptor
path_dtrans() -> Any
@brief A shortcut for 'get("path_dtrans")'
path_trans
method descriptor
path_trans() -> Any
@brief A shortcut for 'get("path_trans")'
query
method descriptor
query() -> LayoutQuery
@brief Gets the query the iterator follows on
shape
method descriptor
shape() -> Any
@brief A shortcut for 'get("shape")'
trans
method descriptor
trans() -> Any
@brief A shortcut for 'get("trans")'
LayoutToNetlist
@brief A framework for extracting netlists from layouts
This class provides a framework for extracting a netlist from a layout.
A LayoutToNetlist object extracts a netlist from an external \Layout. To do so, it keeps an internal copy with an optimized representation of the original layout. When a netlist is extracted the net geometries can be recovered from that internal layout. In addition to that layout, it keeps the extracted netlist. Netlist and internal layout form a pair and there are references between them. For example, the \Circuit objects from the netlist have an attribute \cell_index, which tells what cell from the internal layout the circuit was derived from. In the same way, subcircuit references refer to cell instances and nets keep a reference to the shapes they were derived from.
LayoutToNetlist can also operate in detached mode, when there is no external layout. In this mode, layers are created inside the internal layout only. As there is no input hierarchy, operation is necessarily flat in that case. Single \Region and \Texts shape collections can be introduced into the LayoutToNetlist objects from external sources to populate the layers from the internal layout. For detached mode, use the 'LayoutToNetlist(topcell, dbu)' constructor.
Usually, the internal layout is stored inside an internal \DeepShapeStore object, which supplies additional services such as layer lifetime management and maintains the connection to and from the external layout. However, you can also use the extractor with an existing \DeepShapeStore object. In that case, this external \DeepShapeStore object is used instead of the internal one.
The LayoutToNetlist object can be persisted into a 'Layout to netlist database' file. This database is a storage for both the netlist and the net or circuit geometries. When reading such file into a new LayoutToNetlist object, there will be no connection to any external layout, but all the essential netlist and geometry information will be available.
The LayoutToNetlist object is also the entry point for netlist-driven algorithms such as antenna checks.
The use model of the LayoutToNetlist object consists of five steps which need to be executed in this order.
@ul @li @b Configuration: @/b In this step, the LayoutToNetlist object is created and if required, configured. Methods to be used in this step are \threads=, \area_ratio= or \max_vertex_count=. The constructor for the LayoutToNetlist object receives a \RecursiveShapeIterator object which basically supplies the hierarchy and the external layout taken as input. The constructor will initialize the internal layout and connect it to the external one. @/li @li @b Preparation: @/b In this step, the device recognition and extraction layers are drawn from the framework. Derived layers can now be computed using boolean operations. Methods to use in this step are \make_layer and its variants. \make_layer will either create a new, empty layer or pull a layer from the external layout into the internal layout. Derived layers are computed using the \Region or \Texts objects representing existing layers. If derived layers are to be used in connectivity, they need to be registered using \register. This makes the LayoutToNetlist object the owner of the layer (the layer is said to be persisted then). Registered layers can or should be given a name. That helps indentifying them later. Layer preparation is not necessarily required to happen before all other steps. Layers can be computed shortly before they are required. @/li @li @b Device extraction: @/b Following the preparation, the devices can be extracted using \extract_devices. This method needs to be called for each device extractor required. Each time, a device extractor needs to be given, plus a map of device layers. The device layers are device extractor specific. Either original or derived layers may be specified here. Layer preparation may happen between calls to \extract_devices. @/li @li @b Connectivity definition: @/b Once the devices are derived, the netlist connectivity can be defined and the netlist extracted. The connectivity is defined with \connect and its flavours. The actual netlist extraction happens with \extract_netlist. @/li @li @b Netlist extraction: @/b After netlist extraction, the information is ready to be retrieved. The produced netlist is available with \netlist. The Shapes of a specific net are available with \shapes_of_net. \probe_net allows finding a net by probing a specific location. @/li @/ul
Once the extraction is done, you can persist the \LayoutToNetlist object using \write and restore it using \read. You can use the query API (see below) to analyze the LayoutToNetlist database.
The query API of the \LayoutToNetlist object consists of the following parts:
@ul @li Net shape retrieval: \build_all_nets, \build_nets, \build_net and \shapes_of_net @/li @li Layers: \layer_by_index, \layer_by_name, \layer_indexes, \layer_names, \layer_info, \layer_name @/li @li Log entries: \each_log_entry @/li @li Probing (get net from position): \probe_net @/li @li Netlist: \netlist @/li @li Internal shape storage: \internal_layout, \internal_top_cell @/li @li Helper functions: \cell_mapping_into, \const_cell_mapping_into @/li @/ul
The \LayoutToNetlist object is also the entry point for connectivity-aware DRC checks, such as antenna checks.
This class has been introduced in version 0.26.
BNH_Disconnected
class
BNH_Disconnected: BuildNetHierarchyMode = BNH_Disconnected (2)
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
BNH_Flatten
class
BNH_Flatten: BuildNetHierarchyMode = BNH_Flatten (0)
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
BNH_SubcircuitCells
class
BNH_SubcircuitCells: BuildNetHierarchyMode = BNH_SubcircuitCells (1)
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
__doc__
class
__doc__ = "@brief A framework for extracting netlists from layouts\n\nThis class provides a framework for extracting a netlist from a layout.\n\nA LayoutToNetlist object extracts a netlist from an external \\Layout. To do so, it keeps an internal copy with an optimized representation of the original layout. When a netlist is extracted the net geometries can be recovered from that internal layout. In addition to that layout, it keeps the extracted netlist. Netlist and internal layout form a pair and there are references between them. For example, the \\Circuit objects from the netlist have an attribute \\cell_index, which tells what cell from the internal layout the circuit was derived from. In the same way, subcircuit references refer to cell instances and nets keep a reference to the shapes they were derived from.\n\nLayoutToNetlist can also operate in detached mode, when there is no external layout. In this mode, layers are created inside the internal layout only. As there is no input hierarchy, operation is necessarily flat in that case. Single \\Region and \\Texts shape collections can be introduced into the LayoutToNetlist objects from external sources to populate the layers from the internal layout.\nFor detached mode, use the 'LayoutToNetlist(topcell, dbu)' constructor.\n\nUsually, the internal layout is stored inside an internal \\DeepShapeStore object, which supplies additional services such as layer lifetime management and maintains the connection to and from the external layout.\nHowever, you can also use the extractor with an existing \\DeepShapeStore object.\nIn that case, this external \\DeepShapeStore object is used instead of the internal one.\n\nThe LayoutToNetlist object can be persisted into a 'Layout to netlist database' file. This database is a storage for both the netlist and the net or circuit geometries. When reading such file into a new LayoutToNetlist object, there will be no connection to any external layout, but all the essential netlist and geometry information will be available.\n\nThe LayoutToNetlist object is also the entry point for netlist-driven algorithms such as antenna checks.\n\nThe use model of the LayoutToNetlist object consists of five steps which need to be executed in this order.\n\n@ul\n@li @b Configuration: @/b\n In this step, the LayoutToNetlist object is created and\n if required, configured. Methods to be used in this step are \\threads=,\n \\area_ratio= or \\max_vertex_count=. The constructor for the LayoutToNetlist\n object receives a \\RecursiveShapeIterator object which basically supplies the\n hierarchy and the external layout taken as input. The constructor will initialize\n the internal layout and connect it to the external one.\n@/li\n@li @b Preparation: @/b\n In this step, the device recognition and extraction layers are drawn from\n the framework. Derived layers can now be computed using boolean operations.\n Methods to use in this step are \\make_layer and its variants. \\make_layer will either create\n a new, empty layer or pull a layer from the external layout into the internal layout.\n Derived layers are computed using the \\Region or \\Texts objects representing\n existing layers. If derived layers are to be used in connectivity, they\n need to be registered using \\register. This makes the LayoutToNetlist object the owner of the layer (the layer is said to be persisted then). Registered layers can or should be given a name. That helps indentifying them later.\n Layer preparation is not necessarily required to happen before all\n other steps. Layers can be computed shortly before they are required.\n@/li\n@li @b Device extraction: @/b\n Following the preparation, the devices can be extracted using \\extract_devices.\n This method needs to be called for each device extractor required. Each time,\n a device extractor needs to be given, plus a map of device layers. The device\n layers are device extractor specific. Either original or derived layers\n may be specified here. Layer preparation may happen between calls to \\extract_devices.\n@/li\n@li @b Connectivity definition: @/b\n Once the devices are derived, the netlist connectivity can be defined and the\n netlist extracted. The connectivity is defined with \\connect and its\n flavours. The actual netlist extraction happens with \\extract_netlist.\n@/li\n@li @b Netlist extraction: @/b\n After netlist extraction, the information is ready to be retrieved.\n The produced netlist is available with \\netlist. The Shapes of a\n specific net are available with \\shapes_of_net. \\probe_net allows\n finding a net by probing a specific location.\n@/li\n@/ul\n\nOnce the extraction is done, you can persist the \\LayoutToNetlist object using \\write and restore it using \\read. You can use the query API (see below) to analyze the LayoutToNetlist database.\n\nThe query API of the \\LayoutToNetlist object consists of the following parts:\n\n@ul\n@li Net shape retrieval: \\build_all_nets, \\build_nets, \\build_net and \\shapes_of_net @/li\n@li Layers: \\layer_by_index, \\layer_by_name, \\layer_indexes, \\layer_names, \\layer_info, \\layer_name @/li\n@li Log entries: \\each_log_entry @/li\n@li Probing (get net from position): \\probe_net @/li\n@li Netlist: \\netlist @/li\n@li Internal shape storage: \\internal_layout, \\internal_top_cell @/li\n@li Helper functions: \\cell_mapping_into, \\const_cell_mapping_into @/li\n@/ul\n\nThe \\LayoutToNetlist object is also the entry point for connectivity-aware DRC checks, such as antenna checks.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 67
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayoutToNetlist' objects>
list of weak references to the object
area_ratio
class
area_ratio: float = <attribute 'area_ratio' of 'LayoutToNetlist' objects>
@brief Gets the area_ratio parameter for the hierarchical network processor See \area_ratio= for details about this attribute.
@brief Sets the area_ratio parameter for the hierarchical network processor This parameter controls splitting of large polygons in order to reduce the error made by the bounding box approximation.
description
class
description: str = <attribute 'description' of 'LayoutToNetlist' objects>
@brief Gets the description of the database
@brief Sets the description of the database
device_scaling
class
device_scaling: float = <attribute 'device_scaling' of 'LayoutToNetlist' objects>
@brief Gets the device scaling factor See \device_scaling= for details about this attribute.
@brief Sets the device scaling factor This factor will scale the physical properties of the extracted devices accordingly. The scale factor applies an isotropic shrink (<1) or expansion (>1).
generator
class
generator: str = <attribute 'generator' of 'LayoutToNetlist' objects>
@brief Gets the generator string. The generator is the script that created this database.
@brief Sets the generator string.
include_floating_subcircuits
class
include_floating_subcircuits: bool = <attribute 'include_floating_subcircuits' of 'LayoutToNetlist' objects>
@brief Gets a flag indicating whether to include floating subcircuits in the netlist. See \include_floating_subcircuits= for details.
This attribute has been introduced in version 0.27.
@brief Sets a flag indicating whether to include floating subcircuits in the netlist.
With 'include_floating_subcircuits' set to true, subcircuits with no connection to their parent circuit are still included in the circuit as floating subcircuits. Specifically on flattening this means that these subcircuits are properly propagated to their parent instead of appearing as additional top circuits.
This attribute has been introduced in version 0.27 and replaces the arguments of \extract_netlist.
make_soft_connection_diodes
class
make_soft_connection_diodes: bool = <attribute 'make_soft_connection_diodes' of 'LayoutToNetlist' objects>
@hide
@hide
max_vertex_count
class
max_vertex_count: int = <attribute 'max_vertex_count' of 'LayoutToNetlist' objects>
See \max_vertex_count= for details about this attribute.
@brief Sets the max_vertex_count parameter for the hierarchical network processor This parameter controls splitting of large polygons in order to enhance performance for very big polygons.
name
class
name: str = <attribute 'name' of 'LayoutToNetlist' objects>
@brief Gets the name of the database
@brief Sets the name of the database
original_file
class
original_file: str = <attribute 'original_file' of 'LayoutToNetlist' objects>
@brief Gets the original file name of the database The original filename is the layout file from which the netlist DB was created.
@brief Sets the original file name of the database
threads
class
threads: int = <attribute 'threads' of 'LayoutToNetlist' objects>
@brief Gets the number of threads to use for operations which support multiple threads
@brief Sets the number of threads to use for operations which support multiple threads
top_level_mode
class
top_level_mode: bool = <attribute 'top_level_mode' of 'LayoutToNetlist' objects>
@brief Gets a flag indicating whether top level mode is enabled. See \top_level_mode= for details.
This attribute has been introduced in version 0.28.13.
@brief Sets a flag indicating whether top level mode is enabled.
In top level mode, must-connect warnings are turned into errors for example. To enable top level mode, set this attribute to true. By default, top-level mode is turned off.
This attribute has been introduced in version 0.28.13.
BuildNetHierarchyMode
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
BNH_Disconnected
class
BNH_Disconnected: BuildNetHierarchyMode = BNH_Disconnected (2)
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
BNH_Flatten
class
BNH_Flatten: BuildNetHierarchyMode = BNH_Flatten (0)
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
BNH_SubcircuitCells
class
BNH_SubcircuitCells: BuildNetHierarchyMode = BNH_SubcircuitCells (1)
@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net.
__doc__
class
__doc__ = '@brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum\nThis enum is used for \\LayoutToNetlist#build_all_nets and \\LayoutToNetlist#build_net.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 68
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'BuildNetHierarchyMode' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: LayoutToNetlist.BuildNetHierarchyMode) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> LayoutToNetlist.BuildNetHierarchyMode
new(s: str) -> LayoutToNetlist.BuildNetHierarchyMode
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__init__
method descriptor
__init__() -> None
__init__(dss: DeepShapeStore, layout_index: Optional[int] = ...) -> None
__init__(iter: RecursiveShapeIterator) -> None
__init__(topcell_name: str, dbu: float) -> None
__init__()
@brief Creates a new, detached extractor object with a flat DSS @param topcell_name The name of the top cell of the internal flat layout @param dbu The database unit to use for the internal flat layout
This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers.
The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions.
Example:
@code rmetal1 = ... # an external Region object representing 'metal1' layer rvia11 = ... # an external Region object representing 'via1' layer rmetal2 = ... # an external Region object representing 'metal2' layer
l2n = RBA::LayoutToNetlist::new("TOP_CELL", 0.001)
imports the external Regions as flat ones and assigns proper names
l2n.register(rmetal1, "metal1") l2n.register(rvia1, "via1") l2n.register(rmetal2, "metal2")
intra- and inter-layer connects:
l2n.connect(metal1) l2n.connect(metal1, via1) l2n.connect(metal2) @/code
antenna_check
method descriptor
antenna_check(gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region
antenna_check(gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region
antenna_check(gate: Region, metal: Region, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region
antenna_check()
@brief Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor
This (most generic) version of the \antenna_check method allows taking the perimeter of gate or metal into account and also provides a scaling factor for the area part. The effective area is computed using:
@code Aeff = A * f + P * t @/code
Here f is the area factor and t the perimeter factor. A is the polygon area and P the polygon perimeter. A use case for this variant is to set the area factor to zero. This way, only perimeter contributions are considered.
This variant has been introduced in version 0.26.6.
build_all_nets
method descriptor
build_all_nets() -> None
@brief Builds a full hierarchical representation of the nets
This method copies all nets into cells corresponding to the circuits. It uses the 'cmap' object to determine the target cell (create it with "cell_mapping_into" or "const_cell_mapping_into"). If no mapping is provided for a specific circuit cell, the nets are copied into the next mapped parent as many times as the circuit cell appears there (circuit flattening).
If 'netname_prop' is not nil, a property with the given name is created and attached to shapes. The value of the property is the net name.
'lmap' defines which layers are to be produced. It is map, where the keys are layer indexes in the target layout and the values are Region objects indicating the layer where shapes are to be taken from. Use \layer_by_name or \layer_by_index to get the Region object corresponding to a layer stored inside the LayoutToNetlist database.
The method has three net annotation modes: @ul @li No annotation (net_cell_name_prefix == nil and netname_prop == nil): the shapes will be put into the target cell simply. @/li @li Net name property (net_cell_name_prefix == nil and netname_prop != nil): the shapes will be annotated with a property named with netname_prop and containing the net name string. @/li @li Individual subcells per net (net_cell_name_prefix != 0): for each net, a subcell is created and the net shapes will be put there (name of the subcell = net_cell_name_prefix + net name). (this mode can be combined with netname_prop too). @/li @/ul
In addition, net hierarchy is covered in three ways: @ul @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their respective circuits. The connections are not indicated. @/li @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built to accommodate the subnets (see build_net in recursive mode). @/li @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it belongs to. @/li @/ul
If a device cell name prefix is given, cells will be produced for each device abstract using a name like device_cell_name_prefix + device name. Otherwise the device shapes are treated as part of the net.
@param cmap The mapping of internal layout to target layout for the circuit mapping @param target The target layout @param lmap Target layer indexes (keys) and net regions (values) @param hier_mode See description of this method @param netname_prop An (optional) property name to which to attach the net name @param circuit_cell_name_prefix See method description @param net_cell_name_prefix See method description @param device_cell_name_prefix See above
build_net
method descriptor
build_net() -> None
@brief Builds a net representation in the given layout and cell
This method puts the shapes of a net into the given target cell using a variety of options to represent the net name and the hierarchy of the net.
If 'netname_prop' is not nil, a property with the given name is created and attached to shapes. The value of the property is the net name.
'lmap' defines which layers are to be produced. It is map, where the keys are layer indexes in the target layout and the values are Region objects indicating the layer where shapes are to be taken from. Use \layer_by_name or \layer_by_index to get the Region object corresponding to a layer stored inside the LayoutToNetlist database.
Net hierarchy is covered in three ways: @ul @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their respective circuits. The connections are not indicated. @/li @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built to accommodate the subnets (see build_net in recursive mode). @/li @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it belongs to. @/li @/ul If a device cell name prefix is given, cells will be produced for each device abstract using a name like device_cell_name_prefix + device name. Otherwise the device shapes are treated as part of the net.
@param target The target layout @param target_cell The target cell @param lmap Target layer indexes (keys) and net regions (values) @param hier_mode See description of this method @param netname_prop An (optional) property name to which to attach the net name @param cell_name_prefix Chooses recursive mode if non-null @param device_cell_name_prefix See above
build_nets
method descriptor
build_nets() -> None
@brief Like \build_all_nets, but with the ability to select some nets.
cell_mapping_into
method descriptor
cell_mapping_into(layout: Layout, cell: Cell, nets: Sequence[Net], with_device_cells: Optional[bool] = ...) -> CellMapping
cell_mapping_into(layout: Layout, cell: Cell, with_device_cells: Optional[bool] = ...) -> CellMapping
cell_mapping_into()
@brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. This version will only create cells which are required to represent the nets from the 'nets' argument.
If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. Use this option, if you want to access device terminal shapes per device.
CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it.
check_extraction_errors
method descriptor
check_extraction_errors() -> None
@brief Raises an exception if extraction errors are present
This method has been introduced in version 0.28.13.
clear_join_net_names
method descriptor
clear_join_net_names() -> None
@brief Clears all implicit net joining expressions. See \extract_netlist for more details about this feature.
This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist.
clear_join_nets
method descriptor
clear_join_nets() -> None
@brief Clears all explicit net joining expressions. See \extract_netlist for more details about this feature.
Explicit net joining has been introduced in version 0.27.
connect
method descriptor
connect(a: Region, b: Region) -> None
connect(a: Region, b: Texts) -> None
connect(a: Texts, b: Region) -> None
connect(l: Region) -> None
connect()
@brief Defines an inter-layer connection for the given layers. The conditions mentioned with intra-layer \connect apply for this method too. As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.
This variant has been introduced in version 0.27.
connect_global
method descriptor
connect_global(l: Region, global_net_name: str) -> int
connect_global(l: Texts, global_net_name: str) -> int
connect_global()
@brief Defines a connection of the given text layer with a global net. This method returns the ID of the global net. Use \global_net_name to get the name back from the ID.
This variant has been introduced in version 0.27.
const_cell_mapping_into
method descriptor
const_cell_mapping_into() -> CellMapping
@brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. This version will not create new cells in the target layout. If the required cells do not exist there yet, flatting will happen.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dss
method descriptor
dss() -> DeepShapeStore
@brief Gets a reference to the internal DSS object. See the class description for details about the DSS object used inside the LayoutToNetlist object.
dump_joined_net_names
method descriptor
dump_joined_net_names() -> str
@hide
dump_joined_net_names_per_cell
method descriptor
dump_joined_net_names_per_cell() -> str
@hide
dump_joined_nets
method descriptor
dump_joined_nets() -> str
@hide
dump_joined_nets_per_cell
method descriptor
dump_joined_nets_per_cell() -> str
@hide
each_error
method descriptor
each_error() -> Iterator[LogEntryData]
@brief Iterates over all log entries collected during device and netlist extraction. This method has been introduced in version 0.28.13.
each_log_entry
method descriptor
each_log_entry() -> Iterator[LogEntryData]
@brief Iterates over all log entries collected during device and netlist extraction. This method has been introduced in version 0.28.13.
extract_devices
method descriptor
extract_devices() -> None
@brief Extracts devices See the class description for more details. This method will run device extraction for the given extractor. The layer map is specific for the extractor and uses the Region objects derived with \make_layer and its variants or Region objects registered through \register. The layer map keys are the inputs layers defined for the specific extractor, but also the output layers where the extractor places markers for the device terminals.
In addition, derived regions can also be passed to the device extractor inside the layer map. Certain limitations apply. It is usually safe to use boolean operations for deriving layers. Other operations are applicable as long as they are capable of delivering hierarchical layers.
Example:
@code ly = ... # original Layout
l2n = RBA::LayoutToNetlist::new(RBA::RecursiveShapeIterator::new(ly, ly.top_cell, [])) rnwell = l2n.make_layer(ly.layer(1, 0), "nwell" ) ractive = l2n.make_layer(ly.layer(2, 0), "active" ) rpoly = l2n.make_layer(ly.layer(3, 0), "poly" )
rpactive = ractive & rnwell rpgate = rpactive & rpoly rpsd = rpactive - rpgate
rnactive = ractive - rnwell rngate = rnactive & rpoly rnsd = rnactive - rngate
PMOS transistor device extraction
pmos_ex = RBA::DeviceExtractorMOS3Transistor::new("PMOS") l2n.extract_devices(pmos_ex, { "SD" => rpsd, "G" => rpgate, "P" => rpoly })
NMOS transistor device extraction
nmos_ex = RBA::DeviceExtractorMOS3Transistor::new("NMOS") l2n.extract_devices(nmos_ex, { "SD" => rnsd, "G" => rngate, "P" => rpoly }) @/code
If errors occur, they will be logged inside the device extractor object and copied to the log of this LayoutToNetlist object (self).
extract_netlist
method descriptor
extract_netlist() -> None
@brief Runs the netlist extraction
See the class description for more details.
This method has been made parameter-less in version 0.27. Use \include_floating_subcircuits= and \join_net_names as substitutes for the arguments of previous versions.
filename
method descriptor
filename() -> str
@brief Gets the file name of the database The filename is the name under which the database is stored or empty if it is not associated with a file.
global_net_name
method descriptor
global_net_name() -> str
@brief Gets the global net name for the given global net ID.
internal_layout
method descriptor
internal_layout() -> Layout
@brief Gets the internal layout The internal layout is where the LayoutToNetlist database stores the shapes for the nets. Usually you do not need to access this object - you must use \build_net or \shapes_of_net to retrieve the per-net shape information. If you access the internal layout, make sure you do not modify it.
See the class description for details about the internal layout object.
internal_top_cell
method descriptor
internal_top_cell() -> Cell
@brief Gets the internal top cell Usually it should not be required to obtain the internal cell. If you need to do so, make sure not to modify the cell as the functionality of the netlist extractor depends on it.
See the class description for details about the internal layout object.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_extracted
method descriptor
is_extracted() -> bool
@brief Gets a value indicating whether the netlist has been extracted
This method has been introduced in version 0.27.1.
is_persisted
method descriptor
is_persisted(layer: Region) -> bool
is_persisted(layer: Texts) -> bool
is_persisted()
@brief Returns true, if the given layer is a persisted texts collection. Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Layers created with make_... or registered through \register are persisted. This basically applies to all layers, except intermediate layers that are potentially created as results of operations between layers and which are not registered.
The variant for Texts collections has been added in version 0.27.
join_net_names
method descriptor
join_net_names(cell_pattern: str, pattern: str) -> None
join_net_names(pattern: str) -> None
join_net_names()
@brief Specifies another pattern for implicit joining of nets for the cells from the given cell pattern. This method allows applying implicit net joining for specific cells, not only for the top cell.
This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern.
This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist.
join_nets
method descriptor
join_nets(cell_pattern: str, net_names: Sequence[str]) -> None
join_nets(net_names: Sequence[str]) -> None
join_nets()
@brief Specifies another name list for explicit joining of nets for the cells from the given cell pattern. This method allows applying explicit net joining for specific cells, not only for the top cell.
This method adds a new name list. Use \clear_join_nets to clear the registered pattern.
Explicit net joining has been introduced in version 0.27.
keep_dss
method descriptor
keep_dss() -> None
@brief Takes ownership of the DSS object if the LayoutToNetlist object was created with an external one. See the class description for details about the DSS object used inside the LayoutToNetlist object.
layer_by_index
method descriptor
layer_by_index() -> Region
@brief Gets a layer object for the given index. The returned object is a new Region object representing the layer with the given index. It will refer to a layer inside the internal layout, or more specifically inside the \DeepShapeStorage object (see \dss and \internal_layout). The method returns 'nil' if the index is not a valid layer index.
layer_by_name
method descriptor
layer_by_name() -> Region
@brief Gets a layer object for the given name. The returned object is a new Region object representing the named layer. It will refer to a layer inside the internal layout, or more specifically inside the \DeepShapeStorage object (see \dss and \internal_layout). The method returns 'nil' if the name is not a valid layer name. See \register and the make_... methods for a description of layer naming.
layer_index
method descriptor
layer_index() -> int
@brief Gets the layer index for the given data object This method is essentially identical to \layer_of, but uses \ShapeCollection, which is a polymorphic base class for a variety of shape containers.
The layer index returned is index of the corresponding layer inside the internal layout (see \internal_layout). The layer index is more handy to use for identifying a layer than a \Region of \Texts object, for example when using it as a key in hashes.
You can use \layer_by_index to retrieve the \Region object of a layer from the layer index.
This method has been introduced in version 0.29.3.
layer_indexes
method descriptor
layer_indexes() -> List[int]
@brief Returns a list of indexes of the layers kept inside the LayoutToNetlist object. You can use \layer_name to get the name from a layer index. You can use \layer_info to get the \LayerInfo object attached to a layer - if the layer is an original layer. You can use \layer_by_index to get the \Region object for the layer by index.
This method has been introduced in version 0.29.2.
layer_info
method descriptor
layer_info() -> LayerInfo
@brief Returns the LayerInfo object attached to a layer (by index). If the layer is an original layer and not a derived one, this method will return the stream layer information where the original layer was taken from. Otherwise an empty \LayerInfo object is returned.
The LayerInfo object is usually empty for derived layers - i.e. those which are computed through boolean operations for example. It is recommended to assign names to such layers for easy identification later.
This method has been introduced in version 0.29.2.
layer_name
method descriptor
layer_name(l: ShapeCollection) -> str
layer_name(l: int) -> str
layer_name()
@brief Gets the name of the given layer (by index) See \layer_index for a description of the layer index.
layer_names
method descriptor
layer_names() -> List[str]
@brief Returns a list of names of the layers kept inside the LayoutToNetlist object.
layer_of
method descriptor
layer_of(l: Region) -> int
layer_of(l: Texts) -> int
layer_of()
@brief Gets the internal layer for a given text collection This method is required to derive the internal layer index - for example for investigating the cluster tree.
The variant for Texts collections has been added in version 0.27.
make_layer
method descriptor
make_layer(layer_index: int, name: Optional[str] = ...) -> Region
make_layer(name: Optional[str] = ...) -> Region
make_layer()
@brief Creates a new hierarchical region representing an original layer 'layer_index' is the layer index of the desired layer in the original layout. This variant produces polygons and takes texts for net name annotation as special, property-annotated polygons. A variant not taking texts is \make_polygon_layer. A Variant only taking texts is \make_text_layer.
This method will basically create a copy of the original layer inside the internal layout - more specifically inside the DSS (see \dss and \internal_layout). It returns a new Region object that represents this layer copy. The new layer is already registered with the given name and can be used for \connect for example.
make_polygon_layer
method descriptor
make_polygon_layer() -> Region
@brief Creates a new region representing an original layer taking polygons only See \make_layer for details.
make_text_layer
method descriptor
make_text_layer() -> Texts
@brief Creates a new region representing an original layer taking texts only See \make_layer for details.
Starting with version 0.27, this method returns a \Texts object.
netlist
method descriptor
netlist() -> Netlist
@brief gets the netlist extracted (0 if no extraction happened yet)
new
builtin
new() -> LayoutToNetlist
new(dss: DeepShapeStore, layout_index: Optional[int] = ...) -> LayoutToNetlist
new(iter: RecursiveShapeIterator) -> LayoutToNetlist
new(topcell_name: str, dbu: float) -> LayoutToNetlist
new()
@brief Creates a new, detached extractor object with a flat DSS @param topcell_name The name of the top cell of the internal flat layout @param dbu The database unit to use for the internal flat layout
This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers.
The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions.
Example:
@code rmetal1 = ... # an external Region object representing 'metal1' layer rvia11 = ... # an external Region object representing 'via1' layer rmetal2 = ... # an external Region object representing 'metal2' layer
l2n = RBA::LayoutToNetlist::new("TOP_CELL", 0.001)
imports the external Regions as flat ones and assigns proper names
l2n.register(rmetal1, "metal1") l2n.register(rvia1, "via1") l2n.register(rmetal2, "metal2")
intra- and inter-layer connects:
l2n.connect(metal1) l2n.connect(metal1, via1) l2n.connect(metal2) @/code
probe_net
method descriptor
probe_net(of_layer: Region, point: DPoint, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net
probe_net(of_layer: Region, point: Point, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net
probe_net()
@brief Finds the net by probing a specific location on the given layer See the description of the other \probe_net variant. This variant accepts a database-unit location. The location is given in the coordinate space of the initial cell.
The \sc_path_out and \initial_circuit parameters have been added in version 0.27.
read
method descriptor
read() -> None
@brief Reads the extracted netlist from the file. This method employs the native format of KLayout.
read_l2n
method descriptor
read_l2n() -> None
@brief Reads the extracted netlist from the file. This method employs the native format of KLayout.
register
method descriptor
register() -> int
@brief Names the given layer @return The index of the layer registered 'l' must be a \Region or \Texts object. Flat regions or text collections must be registered with this function, before they can be used in \connect. Registering will copy the shapes into the LayoutToNetlist object in this step to enable netlist extraction.
External \Region or \Texts objects that are registered are persisted. This means the LayoutToNetlist object becomes owner of them and they are not discarded when the Region or Text object is destroyed.
Naming a layer allows allows retrieving the layer later, for example after the LayoutToNetlist object has been written to a file and restored from that file (during this process, the layer indexes will change).
If no name is given, the system will assign a name automatically. It is recommended to specify a name if it is required to identify the layer later - for example for retrieving shapes from it.
This method has been generalized in version 0.27. Starting with version 0.29.3, the index of the layer is returned.
reset_extracted
method descriptor
reset_extracted() -> None
@brief Resets the extracted netlist and enables re-extraction This method is implicitly called when using \connect or \connect_global after a netlist has been extracted. This enables incremental connect with re-extraction.
This method has been introduced in version 0.27.1.
shapes_of_net
method descriptor
shapes_of_net(net: Net, of_layer: Region, recursive: Optional[bool] = ..., trans: Optional[ICplxTrans] = ...) -> Region
shapes_of_net(net: Net, of_layer: Region, recursive: bool, to: Shapes, propid: Optional[int] = ..., trans: Optional[ICplxTrans] = ...) -> None
shapes_of_net()
@brief Sends all shapes of a specific net and layer to the given Shapes container. If 'recursive'' is true, the returned region will contain the shapes of all subcircuits too. "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. The optional 'trans' parameter allows applying a transformation to all shapes. It has been introduced in version 0.28.4.
shapes_of_pin
method descriptor
shapes_of_pin() -> Dict[int, Region]
@brief Returns all shapes of the given subcircuit pin that make a connection to the net the pin lives in. This will return all shapes from the subcircuit attached by the given pin that interact with the net the pin lives in. This method returns a \Region object with the shapes per layer where interactions are found. The layers are given as layer indexes.
The returned shapes are already transformed into the coordinate system of the net (see \shapes_of_net for example). An additional transformation can be applied using the optional \trans argument.
Note, that this method only considers interations between net shapes and subcircuits on every level below, but not between subcircuits. It can be used for example for digital nets connecting gate cells. In the general case however, nets may be formed also by touching subcircuits. In that case, the nets do not have shapes of their own and this function cannot detect the pin shapes.
The call of this method may not be cheap, specificially if large nets are involved.
This method has been introduced in version 0.29.2.
shapes_of_terminal
method descriptor
shapes_of_terminal() -> Dict[int, Region]
@brief Returns all shapes of the given device terminal that make a connection to the net the terminal lives in. This will return all shapes from the device attached by the given terminal that interact with the net the terminal lives in. This method returns a \Region object with the shapes per layer where interactions are found. The layers are given as layer indexes.
The returned shapes are already transformed into the coordinate system of the net (see \shapes_of_net for example). An additional transformation can be applied using the optional \trans argument.
Note, that this method only considers interations between net shapes and the device connected by the terminal, but not between subcircuits on the net and the device. It can be used for example for flat-extracted, transistor-level netlists. In the general case however, nets may be formed also by subcircuits touching devices. In that case, the nets do not have shapes of their own and this function cannot detect the terminal shapes.
The call of this method may not be cheap, specificially if large nets are involved.
This method has been introduced in version 0.29.2.
soft_connect
method descriptor
soft_connect(a: Region, b: Region) -> None
soft_connect(a: Region, b: Texts) -> None
soft_connect(a: Texts, b: Region) -> None
soft_connect()
@brief Defines an inter-layer connection for the given layers in soft mode. Connects two layers through a soft connection. Soft connections cannot make connections between two different nets. These are directional connections where 'b' is the 'lower' layer (typically high-ohmic substrate or diffusion). As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons.
Soft connections have been introduced in version 0.29.
soft_connect_global
method descriptor
soft_connect_global(l: Region, global_net_name: str) -> int
soft_connect_global(l: Texts, global_net_name: str) -> int
soft_connect_global()
@brief Defines a connection of the given text layer with a global net in soft mode. This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. Soft connections are directional, where the global net is the 'lower' layer (typically high-ohmic substrate or diffusion).
Soft connections have been introduced in version 0.29.
write
method descriptor
write() -> None
@brief Writes the extracted netlist to a file. This method employs the native format of KLayout.
write_l2n
method descriptor
write_l2n() -> None
@brief Writes the extracted netlist to a file. This method employs the native format of KLayout.
LayoutVsSchematic
Bases: klayout.dbcore.LayoutToNetlist
@brief A generic framework for doing LVS (layout vs. schematic)
This class extends the concept of the netlist extraction from a layout to LVS verification. It does so by adding these concepts to the \LayoutToNetlist class:
@ul @li A reference netlist. This will be the netlist against which the layout-derived netlist is compared against. See \reference and \reference=. @/li @li A compare step. During the compare the layout-derived netlist and the reference netlists are compared. The compare results are captured in the cross-reference object. See \compare and \NetlistComparer for the comparer object. @/li @li A cross-reference. This object (of class \NetlistCrossReference) will keep the relations between the objects of the two netlists. It also lists the differences between the netlists. See \xref about how to access this object.@/li @/ul
The LVS object can be persisted to and from a file in a specific format, so it is sometimes referred to as the "LVS database".
LVS objects can be attached to layout views with \LayoutView#add_lvsdb so they become available in the netlist database browser.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief A generic framework for doing LVS (layout vs. schematic)\n\nThis class extends the concept of the netlist extraction from a layout to LVS verification. It does so by adding these concepts to the \\LayoutToNetlist class:\n\n@ul\n@li A reference netlist. This will be the netlist against which the layout-derived netlist is compared against. See \\reference and \\reference=.\n@/li\n@li A compare step. During the compare the layout-derived netlist and the reference netlists are compared. The compare results are captured in the cross-reference object. See \\compare and \\NetlistComparer for the comparer object.\n@/li\n@li A cross-reference. This object (of class \\NetlistCrossReference) will keep the relations between the objects of the two netlists. It also lists the differences between the netlists. See \\xref about how to access this object.@/li\n@/ul\n\nThe LVS object can be persisted to and from a file in a specific format, so it is sometimes referred to as the "LVS database".\n\nLVS objects can be attached to layout views with \\LayoutView#add_lvsdb so they become available in the netlist database browser.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 69
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
reference
class
reference: Netlist = <attribute 'reference' of 'LayoutVsSchematic' objects>
@brief Gets the reference netlist.
@brief Sets the reference netlist. This will set the reference netlist used inside \compare as the second netlist to compare against the layout-extracted netlist.
The LVS object will take ownership over the netlist - i.e. if it goes out of scope, the reference netlist is deleted.
__init__
method descriptor
__init__() -> None
__init__(dss: DeepShapeStore) -> None
__init__(dss: DeepShapeStore, layout_index: int) -> None
__init__(iter: RecursiveShapeIterator) -> None
__init__(topcell_name: str, dbu: float) -> None
__init__()
@brief Creates a new LVS object with the extractor object taking a flat DSS See the corresponding constructor of the \LayoutToNetlist object for more details.
compare
method descriptor
compare() -> bool
@brief Compare the layout-extracted netlist against the reference netlist using the given netlist comparer.
new
builtin
new() -> LayoutVsSchematic
new(dss: DeepShapeStore) -> LayoutVsSchematic
new(dss: DeepShapeStore, layout_index: int) -> LayoutVsSchematic
new(iter: RecursiveShapeIterator) -> LayoutVsSchematic
new(topcell_name: str, dbu: float) -> LayoutVsSchematic
new()
@brief Creates a new LVS object with the extractor object taking a flat DSS See the corresponding constructor of the \LayoutToNetlist object for more details.
read
method descriptor
read() -> None
@brief Reads the LVS object from the file. This method employs the native format of KLayout.
read_l2n
method descriptor
read_l2n() -> None
@brief Reads the \LayoutToNetlist part of the object from a file. This method employs the native format of KLayout.
write
method descriptor
write() -> None
@brief Writes the LVS object to a file. This method employs the native format of KLayout.
write_l2n
method descriptor
write_l2n() -> None
@brief Writes the \LayoutToNetlist part of the object to a file. This method employs the native format of KLayout.
xref
method descriptor
xref() -> NetlistCrossReference
@brief Gets the cross-reference object The cross-reference object is created while comparing the layout-extracted netlist against the reference netlist - i.e. during \compare. Before \compare is called, this object is nil. It holds the results of the comparison - a cross-reference between the nets and other objects in the match case and a listing of non-matching nets and other objects for the non-matching cases. See \NetlistCrossReference for more details.
Library
@brief A Library
A library is basically a wrapper around a layout object. The layout object provides cells and potentially PCells that can be imported into other layouts.
The library provides a name which is used to identify the library and a description which is used for identifying the library in a user interface.
After a library is created and the layout is filled, it must be registered using the register method.
This class has been introduced in version 0.22.
__doc__
class
__doc__ = '@brief A Library \n\nA library is basically a wrapper around a layout object. The layout object\nprovides cells and potentially PCells that can be imported into other layouts.\n\nThe library provides a name which is used to identify the library and a description\nwhich is used for identifying the library in a user interface. \n\nAfter a library is created and the layout is filled, it must be registered using the register method.\n\nThis class has been introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 70
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Library' objects>
list of weak references to the object
description
class
description: str = <attribute 'description' of 'Library' objects>
@brief Returns the libraries' description text
@brief Sets the libraries' description text
technology
class
technology: str = <attribute 'technology' of 'Library' objects>
@brief Returns name of the technology the library is associated with If this attribute is a non-empty string, this library is only offered for selection if the current layout uses this technology.
This attribute has been introduced in version 0.25. In version 0.27 this attribute is deprecated as a library can now be associated with multiple technologies.
@brief sets the name of the technology the library is associated with
See \technology for details. This attribute has been introduced in version 0.25. In version 0.27, a library can be associated with multiple technologies and this method will revert the selection to a single one. Passing an empty string is equivalent to \clear_technologies.
__copy__
method descriptor
__copy__() -> Library
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Library
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new, empty library
add_technology
method descriptor
add_technology() -> None
@brief Additionally associates the library with the given technology. See also \clear_technologies.
This method has been introduced in version 0.27
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear_technologies
method descriptor
clear_technologies() -> None
@brief Clears the list of technologies the library is associated with. See also \add_technology.
This method has been introduced in version 0.27
create
method descriptor
create() -> None
@brief 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.
delete
method descriptor
delete() -> None
@brief Deletes the library
This method will delete the library object. Library proxies pointing to this library will become invalid and the library object cannot be used any more after calling this method.
This method has been introduced in version 0.25.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Library
@brief Creates a copy of self
for_technologies
method descriptor
for_technologies() -> bool
@brief Returns a value indicating whether the library is associated with any technology. This method has been introduced in version 0.27
id
method descriptor
id() -> int
@brief Returns the library's ID The ID is set when the library is registered and cannot be changed
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_for_technology
method descriptor
is_for_technology() -> bool
@brief Returns a value indicating whether the library is associated with the given technology. The method is equivalent to checking whether the \technologies list is empty.
This method has been introduced in version 0.27
layout
method descriptor
layout() -> Layout
@brief The layout object where the cells reside that this library defines
layout_const
method descriptor
layout_const() -> Layout
@brief The layout object where the cells reside that this library defines (const version)
library_by_id
builtin
library_by_id() -> Library
@brief Gets the library object for the given ID If the ID is not valid, nil is returned.
This method has been introduced in version 0.27.
library_by_name
builtin
library_by_name() -> Library
@brief Gets a library by name Returns the library object for the given name. If the name is not a valid library name, nil is returned.
Different libraries can be registered under the same names for different technologies. When a technology name is given in 'for_technologies', the first library matching this technology is returned. If no technology is given, the first library is returned.
The technology selector has been introduced in version 0.27.
library_ids
builtin
library_ids() -> List[int]
@brief Returns a list of valid library IDs. See \library_names for the reasoning behind this method. This method has been introduced in version 0.27.
library_names
builtin
library_names() -> List[str]
@brief Returns a list of the names of all libraries registered in the system.
NOTE: starting with version 0.27, the name of a library does not need to be unique if libraries are associated with specific technologies. This method will only return the names and it's not possible not unambiguously derive the library object. It is recommended to use \library_ids and \library_by_id to obtain the library unambiguously.
name
method descriptor
name() -> str
@brief Returns the libraries' name The name is set when the library is registered and cannot be changed
new
builtin
new() -> Library
@brief Creates a new, empty library
refresh
method descriptor
refresh() -> None
@brief Updates all layouts using this library. This method will retire cells or update layouts in the attached clients. It will also recompute the PCells inside the library. This method has been introduced in version 0.27.8.
register
method descriptor
register() -> None
@brief Registers the library with the given name
This method can be called in the constructor to register the library after the layout object has been filled with content. If a library with that name already exists for the same technologies, it will be replaced with this library.
This method will set the libraries' name.
The technology specific behaviour has been introduced in version 0.27.
technologies
method descriptor
technologies() -> List[str]
@brief Gets the list of technologies this library is associated with. This method has been introduced in version 0.27
LoadLayoutOptions
@brief Layout reader options
This object describes various layer reader options used for loading layouts.
This class has been introduced in version 0.18.
AddToCell
class
AddToCell: CellConflictResolution = AddToCell (0)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
OverwriteCell
class
OverwriteCell: CellConflictResolution = OverwriteCell (1)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
RenameCell
class
RenameCell: CellConflictResolution = RenameCell (3)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
SkipNewCell
class
SkipNewCell: CellConflictResolution = SkipNewCell (2)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
__doc__
class
__doc__ = '@brief Layout reader options\n\nThis object describes various layer reader options used for loading layouts.\n\nThis class has been introduced in version 0.18.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 157
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LoadLayoutOptions' objects>
list of weak references to the object
cell_conflict_resolution
class
cell_conflict_resolution: CellConflictResolution = <attribute 'cell_conflict_resolution' of 'LoadLayoutOptions' objects>
@brief Gets the cell conflict resolution mode
Multiple layout files can be collected into a single Layout object by reading file after file into the Layout object. Cells with same names are considered a conflict. This mode indicates how such conflicts are resolved. See \LoadLayoutOptions::CellConflictResolution for the values allowed. The default mode is \LoadLayoutOptions::CellConflictResolution#AddToCell.
This option has been introduced in version 0.27.
@brief Sets the cell conflict resolution mode
See \cell_conflict_resolution for details about this option.
This option has been introduced in version 0.27.
cif_create_other_layers
class
cif_create_other_layers: bool = <attribute 'cif_create_other_layers' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether other layers shall be created @return True, if other layers will be created. This attribute acts together with a layer map (see \cif_layer_map=). Layers not listed in this map are created as well when \cif_create_other_layers? is true. Otherwise they are ignored.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
@brief Specifies whether other layers shall be created @param create True, if other layers will be created. See \cif_create_other_layers? for a description of this attribute.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
cif_dbu
class
cif_dbu: float = <attribute 'cif_dbu' of 'LoadLayoutOptions' objects>
@brief Specifies the database unit which the reader uses and produces See \cif_dbu= method for a description of this property. This property has been added in version 0.21.
@brief Specifies the database unit which the reader uses and produces
This property has been added in version 0.21.
cif_keep_layer_names
class
cif_keep_layer_names: bool = <attribute 'cif_keep_layer_names' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether layer names are kept @return True, if layer names are kept.
When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15.
This method has been added in version 0.25.3.
@brief Gets a value indicating whether layer names are kept @param keep True, if layer names are to be kept.
See \cif_keep_layer_names? for a description of this property.
This method has been added in version 0.25.3.
cif_layer_map
class
cif_layer_map: LayerMap = <attribute 'cif_layer_map' of 'LoadLayoutOptions' objects>
@brief Gets the layer map @return A reference to the layer map
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
Python note: this method has been turned into a property in version 0.26.
@brief Sets the layer map This sets a layer mapping for the reader. Unlike \cif_set_layer_map, the 'create_other_layers' flag is not changed. @param map The layer map to set.
This convenience method has been added in version 0.26.
cif_wire_mode
class
cif_wire_mode: int = <attribute 'cif_wire_mode' of 'LoadLayoutOptions' objects>
@brief Specifies how to read 'W' objects See \cif_wire_mode= method for a description of this mode. This property has been added in version 0.21 and was renamed to cif_wire_mode in 0.25.
@brief How to read 'W' objects
This property specifies how to read 'W' (wire) objects. Allowed values are 0 (as square ended paths), 1 (as flush ended paths), 2 (as round paths)
This property has been added in version 0.21.
create_other_layers
class
create_other_layers: bool = <attribute 'create_other_layers' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether other layers shall be created @return True, if other layers should be created. This attribute acts together with a layer map (see \layer_map=). Layers not listed in this map are created as well when \create_other_layers? is true. Otherwise they are ignored.
Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
@brief Specifies whether other layers shall be created @param create True, if other layers should be created. See \create_other_layers? for a description of this attribute.
Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
dxf_circle_accuracy
class
dxf_circle_accuracy: float = <attribute 'dxf_circle_accuracy' of 'LoadLayoutOptions' objects>
@brief Gets the accuracy of the circle approximation
This property has been added in version 0.24.9.
@brief Specifies the accuracy of the circle approximation
In addition to the number of points per circle, the circle accuracy can be specified. If set to a value larger than the database unit, the number of points per circle will be chosen such that the deviation from the ideal circle becomes less than this value.
The actual number of points will not become bigger than the points specified through \dxf_circle_points=. The accuracy value is given in the DXF file units (see \dxf_unit) which is usually micrometers.
\dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles.
This property has been added in version 0.24.9.
dxf_circle_points
class
dxf_circle_points: int = <attribute 'dxf_circle_points' of 'LoadLayoutOptions' objects>
@brief Gets the number of points used per full circle for arc interpolation
This property has been added in version 0.21.6.
@brief Specifies the number of points used per full circle for arc interpolation See also \dxf_circle_accuracy for how to specify the number of points based on an approximation accuracy.
\dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles.
This property has been added in version 0.21.6.
dxf_contour_accuracy
class
dxf_contour_accuracy: float = <attribute 'dxf_contour_accuracy' of 'LoadLayoutOptions' objects>
@brief Gets the accuracy for contour closing
This property has been added in version 0.25.3.
@brief Specifies the accuracy for contour closing
When polylines need to be connected or closed, this value is used to indicate the accuracy. This is the value (in DXF units) by which points may be separated and still be considered connected. The default is 0.0 which implies exact (within one DBU) closing.
This value is effective in polyline mode 3 and 4.
This property has been added in version 0.25.3.
dxf_create_other_layers
class
dxf_create_other_layers: bool = <attribute 'dxf_create_other_layers' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether other layers shall be created @return True, if other layers will be created. This attribute acts together with a layer map (see \dxf_layer_map=). Layers not listed in this map are created as well when \dxf_create_other_layers? is true. Otherwise they are ignored.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
@brief Specifies whether other layers shall be created @param create True, if other layers will be created. See \dxf_create_other_layers? for a description of this attribute.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
dxf_dbu
class
dxf_dbu: float = <attribute 'dxf_dbu' of 'LoadLayoutOptions' objects>
@brief Specifies the database unit which the reader uses and produces
This property has been added in version 0.21.
@brief Specifies the database unit which the reader uses and produces
This property has been added in version 0.21.
dxf_keep_layer_names
class
dxf_keep_layer_names: bool = <attribute 'dxf_keep_layer_names' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether layer names are kept @return True, if layer names are kept.
When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15.
This method has been added in version 0.25.3.
@brief Gets a value indicating whether layer names are kept @param keep True, if layer names are to be kept.
See \cif_keep_layer_names? for a description of this property.
This method has been added in version 0.25.3.
dxf_keep_other_cells
class
dxf_keep_other_cells: bool = <attribute 'dxf_keep_other_cells' of 'LoadLayoutOptions' objects>
@brief If this option is true, all cells are kept, not only the top cell and its children
This property has been added in version 0.21.15.
@brief If this option is set to true, all cells are kept, not only the top cell and its children
This property has been added in version 0.21.15.
dxf_layer_map
class
dxf_layer_map: LayerMap = <attribute 'dxf_layer_map' of 'LoadLayoutOptions' objects>
@brief Gets the layer map @return A reference to the layer map
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. Python note: this method has been turned into a property in version 0.26.
@brief Sets the layer map This sets a layer mapping for the reader. Unlike \dxf_set_layer_map, the 'create_other_layers' flag is not changed. @param map The layer map to set.
This convenience method has been added in version 0.26.
dxf_polyline_mode
class
dxf_polyline_mode: int = <attribute 'dxf_polyline_mode' of 'LoadLayoutOptions' objects>
@brief Specifies whether closed POLYLINE and LWPOLYLINE entities with width 0 are converted to polygons. See \dxf_polyline_mode= for a description of this property.
This property has been added in version 0.21.3.
@brief Specifies how to treat POLYLINE/LWPOLYLINE entities. The mode is 0 (automatic), 1 (keep lines), 2 (create polygons from closed polylines with width = 0), 3 (merge all lines with width = 0 into polygons), 4 (as 3 plus auto-close open contours).
This property has been added in version 0.21.3.
dxf_render_texts_as_polygons
class
dxf_render_texts_as_polygons: bool = <attribute 'dxf_render_texts_as_polygons' of 'LoadLayoutOptions' objects>
@brief If this option is true, text objects are rendered as polygons
This property has been added in version 0.21.15.
@brief If this option is set to true, text objects are rendered as polygons
This property has been added in version 0.21.15.
dxf_text_scaling
class
dxf_text_scaling: float = <attribute 'dxf_text_scaling' of 'LoadLayoutOptions' objects>
@brief Gets the text scaling factor (see \dxf_text_scaling=)
This property has been added in version 0.21.20.
@brief Specifies the text scaling in percent of the default scaling
The default value 100, meaning that the letter pitch is roughly 92 percent of the specified text height. Decrease this value to get smaller fonts and increase it to get larger fonts.
This property has been added in version 0.21.20.
dxf_unit
class
dxf_unit: float = <attribute 'dxf_unit' of 'LoadLayoutOptions' objects>
@brief Specifies the unit in which the DXF file is drawn
This property has been added in version 0.21.3.
@brief Specifies the unit in which the DXF file is drawn.
This property has been added in version 0.21.3.
gds2_allow_big_records
class
gds2_allow_big_records: bool = <attribute 'gds2_allow_big_records' of 'LoadLayoutOptions' objects>
@brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. See \gds2_allow_big_records= method for a description of this property. This property has been added in version 0.18.
@brief Allows big records with more than 32767 bytes
Setting this property to true allows larger records by treating the record length as unsigned short, which for example allows larger polygons (~8000 points rather than ~4000 points) without using multiple XY records. For strict compatibility with the standard, this property should be set to false. The default is true.
This property has been added in version 0.18.
gds2_allow_multi_xy_records
class
gds2_allow_multi_xy_records: bool = <attribute 'gds2_allow_multi_xy_records' of 'LoadLayoutOptions' objects>
@brief Gets a value specifying whether to allow big polygons with multiple XY records. See \gds2_allow_multi_xy_records= method for a description of this property. This property has been added in version 0.18.
@brief Allows the use of multiple XY records in BOUNDARY elements for unlimited large polygons
Setting this property to true allows big polygons that span over multiple XY records. For strict compatibility with the standard, this property should be set to false. The default is true.
This property has been added in version 0.18.
gds2_box_mode
class
gds2_box_mode: int = <attribute 'gds2_box_mode' of 'LoadLayoutOptions' objects>
@brief Gets a value specifying how to treat BOX records See \gds2_box_mode= method for a description of this mode. This property has been added in version 0.18.
@brief Sets a value specifying how to treat BOX records This property specifies how BOX records are treated. Allowed values are 0 (ignore), 1 (treat as rectangles), 2 (treat as boundaries) or 3 (treat as errors). The default is 1.
This property has been added in version 0.18.
layer_map
class
layer_map: LayerMap = <attribute 'layer_map' of 'LoadLayoutOptions' objects>
@brief Gets the layer map @return A reference to the layer map
Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. Python note: this method has been turned into a property in version 0.26.
@brief Sets the layer map, but does not affect the "create_other_layers" flag. Use \create_other_layers? to enable or disable other layers not listed in the layer map. @param map The layer map to set. This convenience method has been introduced with version 0.26.
lefdef_config
class
lefdef_config: LEFDEFReaderConfiguration = <attribute 'lefdef_config' of 'LoadLayoutOptions' objects>
@brief Gets a copy of the LEF/DEF reader configuration The LEF/DEF reader configuration is wrapped in a separate object of class \LEFDEFReaderConfiguration. See there for details. This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified configuration with \lefdef_config=.
This method has been added in version 0.25.
@brief Sets the LEF/DEF reader configuration
This method has been added in version 0.25.
mag_create_other_layers
class
mag_create_other_layers: bool = <attribute 'mag_create_other_layers' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether other layers shall be created @return True, if other layers will be created. This attribute acts together with a layer map (see \mag_layer_map=). Layers not listed in this map are created as well when \mag_create_other_layers? is true. Otherwise they are ignored.
This method has been added in version 0.26.2.
@brief Specifies whether other layers shall be created @param create True, if other layers will be created. See \mag_create_other_layers? for a description of this attribute.
This method has been added in version 0.26.2.
mag_dbu
class
mag_dbu: float = <attribute 'mag_dbu' of 'LoadLayoutOptions' objects>
@brief Specifies the database unit which the reader uses and produces See \mag_dbu= method for a description of this property.
This property has been added in version 0.26.2.
@brief Specifies the database unit which the reader uses and produces The database unit is the final resolution of the produced layout. This physical resolution is usually defined by the layout system - GDS for example typically uses 1nm (mag_dbu=0.001). All geometry in the MAG file will first be scaled to \mag_lambda and is then brought to the database unit.
This property has been added in version 0.26.2.
mag_keep_layer_names
class
mag_keep_layer_names: bool = <attribute 'mag_keep_layer_names' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether layer names are kept @return True, if layer names are kept.
When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15.
This method has been added in version 0.26.2.
@brief Gets a value indicating whether layer names are kept @param keep True, if layer names are to be kept.
See \mag_keep_layer_names? for a description of this property.
This method has been added in version 0.26.2.
mag_lambda
class
mag_lambda: float = <attribute 'mag_lambda' of 'LoadLayoutOptions' objects>
@brief Gets the lambda value See \mag_lambda= method for a description of this attribute.
This property has been added in version 0.26.2.
@brief Specifies the lambda value to used for reading
The lambda value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. The layout read by the MAG reader will use the database unit specified by \mag_dbu, but the physical layout coordinates will be multiples of \mag_lambda.
This property has been added in version 0.26.2.
mag_layer_map
class
mag_layer_map: LayerMap = <attribute 'mag_layer_map' of 'LoadLayoutOptions' objects>
@brief Gets the layer map @return A reference to the layer map
This method has been added in version 0.26.2.
@brief Sets the layer map This sets a layer mapping for the reader. Unlike \mag_set_layer_map, the 'create_other_layers' flag is not changed. @param map The layer map to set.
This method has been added in version 0.26.2.
mag_library_paths
class
mag_library_paths: List[str] = <attribute 'mag_library_paths' of 'LoadLayoutOptions' objects>
@brief Gets the locations where to look up libraries (in this order) See \mag_library_paths= method for a description of this attribute.
This property has been added in version 0.26.2.
@brief Specifies the locations where to look up libraries (in this order)
The reader will look up library reference in these paths when it can't find them locally. Relative paths in this collection are resolved relative to the initial file's path. Expression interpolation is supported in the path strings.
This property has been added in version 0.26.2.
mag_merge
class
mag_merge: bool = <attribute 'mag_merge' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether boxes are merged into polygons @return True, if boxes are merged.
When set to true, the boxes and triangles of the Magic layout files are merged into polygons where possible.
This method has been added in version 0.26.2.
@brief Sets a value indicating whether boxes are merged into polygons @param merge True, if boxes and triangles will be merged into polygons.
See \mag_merge? for a description of this property.
This method has been added in version 0.26.2.
mebes_boundary_datatype
instance-attribute
mebes_boundary_datatype: int
Getter: @brief Gets the datatype number of the boundary layer to produce See \mebes_produce_boundary= for a description of this attribute.
This property has been added in version 0.23.10.
Setter: @brief Sets the datatype number of the boundary layer to produce See \mebes_produce_boundary= for a description of this attribute.
This property has been added in version 0.23.10.
mebes_boundary_layer
instance-attribute
mebes_boundary_layer: int
Getter: @brief Gets the layer number of the boundary layer to produce See \mebes_produce_boundary= for a description of this attribute.
This property has been added in version 0.23.10.
Setter: @brief Sets the layer number of the boundary layer to produce See \mebes_produce_boundary= for a description of this attribute.
This property has been added in version 0.23.10.
mebes_boundary_name
instance-attribute
mebes_boundary_name: str
Getter: @brief Gets the name of the boundary layer to produce See \mebes_produce_boundary= for a description of this attribute.
This property has been added in version 0.23.10.
Setter: @brief Sets the name of the boundary layer to produce See \mebes_produce_boundary= for a description of this attribute.
This property has been added in version 0.23.10.
mebes_create_other_layers
instance-attribute
mebes_create_other_layers: bool
Getter: @brief Gets a value indicating whether other layers shall be created @return True, if other layers will be created. This attribute acts together with a layer map (see \mebes_layer_map=). Layers not listed in this map are created as well when \mebes_create_other_layers? is true. Otherwise they are ignored.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. Setter: @brief Specifies whether other layers shall be created @param create True, if other layers will be created. See \mebes_create_other_layers? for a description of this attribute.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
mebes_data_datatype
instance-attribute
mebes_data_datatype: int
Getter: @brief Gets the datatype number of the data layer to produce
This property has been added in version 0.23.10.
Setter: @brief Sets the datatype number of the data layer to produce
This property has been added in version 0.23.10.
mebes_data_layer
instance-attribute
mebes_data_layer: int
Getter: @brief Gets the layer number of the data layer to produce
This property has been added in version 0.23.10.
Setter: @brief Sets the layer number of the data layer to produce
This property has been added in version 0.23.10.
mebes_data_name
instance-attribute
mebes_data_name: str
Getter: @brief Gets the name of the data layer to produce
This property has been added in version 0.23.10.
Setter: @brief Sets the name of the data layer to produce
This property has been added in version 0.23.10.
mebes_invert
instance-attribute
mebes_invert: bool
Getter: @brief Gets a value indicating whether to invert the MEBES pattern If this property is set to true, the pattern will be inverted.
This property has been added in version 0.22.
Setter: @brief Specify whether to invert the MEBES pattern If this property is set to true, the pattern will be inverted.
This property has been added in version 0.22.
mebes_layer_map
instance-attribute
mebes_layer_map: LayerMap
Getter: @brief Gets the layer map @return The layer map.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. Setter: @brief Sets the layer map This sets a layer mapping for the reader. Unlike \mebes_set_layer_map, the 'create_other_layers' flag is not changed. @param map The layer map to set.
This convenience method has been added in version 0.26.2.
mebes_num_shapes_per_cell
instance-attribute
mebes_num_shapes_per_cell: int
Getter: @brief Gets the number of stripes collected per cell See \mebes_num_stripes_per_cell= for details about this property.
This property has been added in version 0.24.5.
Setter: @brief Specify the number of stripes collected per cell See \mebes_num_stripes_per_cell= for details about this property.
This property has been added in version 0.24.5.
mebes_num_stripes_per_cell
instance-attribute
mebes_num_stripes_per_cell: int
Getter: @brief Gets the number of stripes collected per cell See \mebes_num_stripes_per_cell= for details about this property.
This property has been added in version 0.23.10.
Setter: @brief Specify the number of stripes collected per cell This property specifies how many stripes will be collected into one cell. A smaller value means less but bigger cells. The default value is 64. New cells will be formed whenever more than this number of stripes has been read or a new segment is started and the number of shapes given by \mebes_num_shapes_per_cell is exceeded.
This property has been added in version 0.23.10.
mebes_produce_boundary
instance-attribute
mebes_produce_boundary: bool
Getter: @brief Gets a value indicating whether a boundary layer will be produced See \mebes_produce_boundary= for details about this property.
This property has been added in version 0.23.10.
Setter: @brief Specify whether to produce a boundary layer If this property is set to true, the pattern boundary will be written to the layer and datatype specified with \mebes_boundary_name, \mebes_boundary_layer and \mebes_boundary_datatype. By default, the boundary layer is produced.
This property has been added in version 0.23.10.
mebes_subresolution
instance-attribute
mebes_subresolution: bool
Getter: @brief Gets a value indicating whether to invert the MEBES pattern See \subresolution= for details about this property.
This property has been added in version 0.23.10.
Setter: @brief Specify whether subresolution trapezoids are supported If this property is set to true, subresolution trapezoid vertices are supported. In order to implement support, the reader will create magnified instances with a magnification of 1/16. By default this property is enabled.
This property has been added in version 0.23.10.
mebes_top_cell_index
instance-attribute
mebes_top_cell_index: int
Getter: @brief Gets the cell index for the top cell to use See \mebes_top_cell_index= for a description of this property.
This property has been added in version 0.23.10.
Setter: @brief Specify the cell index for the top cell to use If this property is set to a valid cell index, the MEBES reader will put the subcells and shapes into this cell.
This property has been added in version 0.23.10.
oasis_expect_strict_mode
class
oasis_expect_strict_mode: int = <attribute 'oasis_expect_strict_mode' of 'LoadLayoutOptions' objects>
@hide
@hide
oasis_read_all_properties
class
oasis_read_all_properties: int = <attribute 'oasis_read_all_properties' of 'LoadLayoutOptions' objects>
@hide
@hide
properties_enabled
class
properties_enabled: bool = <attribute 'properties_enabled' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether properties shall be read @return True, if properties should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
@brief Specifies whether properties should be read @param enabled True, if properties should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
text_enabled
class
text_enabled: bool = <attribute 'text_enabled' of 'LoadLayoutOptions' objects>
@brief Gets a value indicating whether text objects shall be read @return True, if text objects should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
@brief Specifies whether text objects shall be read @param enabled True, if text objects should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
warn_level
class
warn_level: int = <attribute 'warn_level' of 'LoadLayoutOptions' objects>
@brief Sets the warning level. See \warn_level= for details about this attribute.
This attribute has been added in version 0.28.
@brief Sets the warning level. The warning level is a reader-specific setting which enables or disables warnings on specific levels. Level 0 is always "warnings off". The default level is 1 which means "reasonable warnings emitted".
This attribute has been added in version 0.28.
CellConflictResolution
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
AddToCell
class
AddToCell: CellConflictResolution = AddToCell (0)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
OverwriteCell
class
OverwriteCell: CellConflictResolution = OverwriteCell (1)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
RenameCell
class
RenameCell: CellConflictResolution = RenameCell (3)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
SkipNewCell
class
SkipNewCell: CellConflictResolution = SkipNewCell (2)
@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.
Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.
If the new or existing cell is a ghost cell, both cells are merged always.
This enum was introduced in version 0.27.
__doc__
class
__doc__ = "@brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises.\nUntil version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts.\n\nProxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed.\n\nIf the new or existing cell is a ghost cell, both cells are merged always.\n\nThis enum was introduced in version 0.27.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 158
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CellConflictResolution' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: LoadLayoutOptions.CellConflictResolution) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> LoadLayoutOptions.CellConflictResolution
new(s: str) -> LoadLayoutOptions.CellConflictResolution
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__copy__
method descriptor
__copy__() -> LoadLayoutOptions
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LoadLayoutOptions
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cif_select_all_layers
method descriptor
cif_select_all_layers() -> None
@brief Selects all layers and disables the layer map
This disables any layer map and enables reading of all layers. New layers will be created when required.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
cif_set_layer_map
method descriptor
cif_set_layer_map() -> None
@brief Sets the layer map This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. @param map The layer map to set. @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LoadLayoutOptions
@brief Creates a copy of self
dxf_keep_other_cells_
method descriptor
dxf_keep_other_cells_()
@brief If this option is true, all cells are kept, not only the top cell and its children
This property has been added in version 0.21.15.
dxf_render_texts_as_polygons_
method descriptor
dxf_render_texts_as_polygons_()
@brief If this option is true, text objects are rendered as polygons
This property has been added in version 0.21.15.
dxf_select_all_layers
method descriptor
dxf_select_all_layers() -> None
@brief Selects all layers and disables the layer map
This disables any layer map and enables reading of all layers. New layers will be created when required.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
dxf_set_layer_map
method descriptor
dxf_set_layer_map() -> None
@brief Sets the layer map This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. @param map The layer map to set. @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
gds2_allow_big_records_
method descriptor
gds2_allow_big_records_()
@brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. See \gds2_allow_big_records= method for a description of this property. This property has been added in version 0.18.
gds2_allow_multi_xy_records_
method descriptor
gds2_allow_multi_xy_records_()
@brief Gets a value specifying whether to allow big polygons with multiple XY records. See \gds2_allow_multi_xy_records= method for a description of this property. This property has been added in version 0.18.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_properties_enabled
method descriptor
is_properties_enabled() -> bool
@brief Gets a value indicating whether properties shall be read @return True, if properties should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
is_text_enabled
method descriptor
is_text_enabled() -> bool
@brief Gets a value indicating whether text objects shall be read @return True, if text objects should be read. Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
mag_select_all_layers
method descriptor
mag_select_all_layers() -> None
@brief Selects all layers and disables the layer map
This disables any layer map and enables reading of all layers. New layers will be created when required.
This method has been added in version 0.26.2.
mag_set_layer_map
method descriptor
mag_set_layer_map() -> None
@brief Sets the layer map This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. @param map The layer map to set. @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map.
This method has been added in version 0.26.2.
mebes_select_all_layers
mebes_select_all_layers() -> None
@brief Selects all layers and disables the layer map
This disables any layer map and enables reading of all layers. New layers will be created when required.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
mebes_set_layer_map
mebes_set_layer_map(map: LayerMap, create_other_layers: bool) -> None
@brief Sets the layer map This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers. @param map The layer map to set. @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map.
This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion.
new
builtin
new() -> LoadLayoutOptions
@brief Creates a new object of this class
select_all_layers
method descriptor
select_all_layers() -> None
@brief Selects all layers and disables the layer map
This disables any layer map and enables reading of all layers. New layers will be created when required.
Starting with version 0.25 this method only applies to GDS2 and OASIS format. Other formats provide their own configuration.
set_layer_map
method descriptor
set_layer_map() -> None
@brief Sets the layer map This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to add a layer name. @param map The layer map to set.@param create_other_layers The flag telling whether other layer should be created as well. Set to false if just the layers in the mapping table should be read.
Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration.
LogEntryData
@brief A generic log entry This class is used for example by the device extractor (see \NetlistDeviceExtractor) to keep errors or warnings that occurred during extraction of the devices.
Other classes also make use of this object to store errors, warnings or information. The log entry object features a severity (warning, error, info), a message, an optional category name and description (good for filtering if needed) and an optional \DPolygon object for indicating some location or error marker. The original class used to be "NetlistDeviceExtractorError" which had been introduced in version 0.26. It was generalized and renamed in version 0.28.13 as it was basically not useful as a separate class.
Error
class
Error: Severity = Error (3)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Info
class
Info: Severity = Info (1)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
NoSeverity
class
NoSeverity: Severity = NoSeverity (0)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Warning
class
Warning: Severity = Warning (2)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
__doc__
class
__doc__ = '@brief A generic log entry\nThis class is used for example by the device extractor (see \\NetlistDeviceExtractor) to keep errors or warnings that occurred during extraction of the devices.\n\nOther classes also make use of this object to store errors, warnings or information. The log entry object features a severity (warning, error, info), a message, an optional category name and description (good for filtering if needed) and an optional \\DPolygon object for indicating some location or error marker.\nThe original class used to be "NetlistDeviceExtractorError" which had been introduced in version 0.26. It was generalized and renamed in version 0.28.13 as it was basically not useful as a separate class.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 77
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LogEntryData' objects>
list of weak references to the object
category_description
class
category_description: str = <attribute 'category_description' of 'LogEntryData' objects>
@brief Gets the category description. See \category_name= for details about categories.
@brief Sets the category description. See \category_name= for details about categories.
category_name
class
category_name: str = <attribute 'category_name' of 'LogEntryData' objects>
@brief Gets the category name. See \category_name= for more details.
@brief Sets the category name. The category name is optional. If given, it specifies a formal category name. Errors with the same category name are shown in that category. If in addition a category description is specified (see \category_description), this description will be displayed as the title.
cell_name
class
cell_name: str = <attribute 'cell_name' of 'LogEntryData' objects>
@brief Gets the cell name. See \cell_name= for details about this attribute.
@brief Sets the cell name. The cell (or circuit) name specifies the cell or circuit the log entry is related to. If the log entry is an error or warning generated during device extraction, the cell name is the circuit the device should have appeared in.
geometry
class
geometry: DPolygon = <attribute 'geometry' of 'LogEntryData' objects>
@brief Gets the geometry. See \geometry= for more details.
@brief Sets the geometry. The geometry is optional. If given, a marker may be shown when selecting this error.
message
class
message: str = <attribute 'message' of 'LogEntryData' objects>
@brief Gets the message text.
@brief Sets the message text.
severity
class
severity: Severity = <attribute 'severity' of 'LogEntryData' objects>
@brief Gets the severity attribute.
@brief Sets the severity attribute.
__copy__
method descriptor
__copy__() -> LogEntryData
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LogEntryData
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__repr__
method descriptor
__repr__() -> str
@brief Gets the string representation of this error or warning. This method has been introduced in version 0.28.13.
__str__
method descriptor
__str__() -> str
@brief Gets the string representation of this error or warning. This method has been introduced in version 0.28.13.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> LogEntryData
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> LogEntryData
@brief Creates a new object of this class
to_s
method descriptor
to_s() -> str
@brief Gets the string representation of this error or warning. This method has been introduced in version 0.28.13.
Manager
@brief A transaction manager class
Manager objects control layout and potentially other objects in the layout database and queue operations to form transactions. A transaction is a sequence of operations that can be undone or redone.
In order to equip a layout object with undo/redo support, instantiate the layout object with a manager attached and embrace the operations to undo/redo with transaction/commit calls.
The use of transactions is subject to certain constraints, i.e. transacted sequences may not be mixed with non-transacted ones.
This class has been introduced in version 0.19.
__doc__
class
__doc__ = '@brief A transaction manager class\n\nManager objects control layout and potentially other objects in the layout database and queue operations to form transactions. A transaction is a sequence of operations that can be undone or redone.\n\nIn order to equip a layout object with undo/redo support, instantiate the layout object with a manager attached and embrace the operations to undo/redo with transaction/commit calls.\n\nThe use of transactions is subject to certain constraints, i.e. transacted sequences may not be mixed with non-transacted ones.\n\nThis class has been introduced in version 0.19.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 79
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Manager' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Manager
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Manager
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
commit
method descriptor
commit() -> None
@brief Close a transaction.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Manager
@brief Creates a copy of self
has_redo
method descriptor
has_redo() -> bool
@brief Determine if a transaction is available for 'redo'
@return True, if a transaction is available.
has_undo
method descriptor
has_undo() -> bool
@brief Determine if a transaction is available for 'undo'
@return True, if a transaction is available.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Manager
@brief Creates a new object of this class
redo
method descriptor
redo() -> None
@brief Redo the next available transaction
The next transaction is redone with this method. The 'has_redo' method can be used to determine whether there are transactions to undo.
transaction
method descriptor
transaction(description: str) -> int
transaction(description: str, join_with: int) -> int
transaction()
@brief Begin a joined transaction
This call will open a new transaction and join if with the previous transaction. The ID of the previous transaction must be equal to the ID given with 'join_with'.
This overload was introduced in version 0.22.
@param description The description for this transaction (ignored if joined). @param description The ID of the previous transaction.
@return The ID of the new transaction (can be used to join more)
transaction_for_redo
method descriptor
transaction_for_redo() -> str
@brief Return the description of the next transaction for 'redo'
transaction_for_undo
method descriptor
transaction_for_undo() -> str
@brief Return the description of the next transaction for 'undo'
undo
method descriptor
undo() -> None
@brief Undo the current transaction
The current transaction is undone with this method. The 'has_undo' method can be used to determine whether there are transactions to undo.
Matrix2d
@brief A 2d matrix object used mainly for representing rotation and shear transformations.
This object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear.
The matrix is a generalization of the transformations and is of limited use in a layout database context. It is useful however to implement shear transformations on polygons, edges and polygon or edge collections.
This class was introduced in version 0.22.
__doc__
class
__doc__ = '@brief A 2d matrix object used mainly for representing rotation and shear transformations.\n\nThis object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear.\n\nThe matrix is a generalization of the transformations and is of limited use in a layout database context. It is useful however to implement shear transformations on polygons, edges and polygon or edge collections.\n\nThis class was introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 80
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Matrix2d' objects>
list of weak references to the object
__add__
method descriptor
__add__() -> Matrix2d
@brief Sum of two matrices. @param m The other matrix. @return The (element-wise) sum of self+m
__copy__
method descriptor
__copy__() -> Matrix2d
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Matrix2d
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
__init__(m11: float, m12: float, m21: float, m22: float) -> None
__init__(m: float) -> None
__init__(mx: float, my: float) -> None
__init__(t: DCplxTrans) -> None
__init__()
@brief Create a new Matrix2d from the four coefficients
__mul__
method descriptor
__mul__(box: DBox) -> DBox
__mul__(e: DEdge) -> DEdge
__mul__(m: Matrix2d) -> Matrix2d
__mul__(p: DPoint) -> DPoint
__mul__(p: DPolygon) -> DPolygon
__mul__(p: DSimplePolygon) -> DSimplePolygon
__mul__(v: DVector) -> DVector
__mul__()
@brief Product of two matrices. @param m The other matrix. @return The matrix product self*m
__repr__
method descriptor
__repr__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
__rmul__
method descriptor
__rmul__(box: DBox) -> DBox
__rmul__(e: DEdge) -> DEdge
__rmul__(m: Matrix2d) -> Matrix2d
__rmul__(p: DPoint) -> DPoint
__rmul__(p: DPolygon) -> DPolygon
__rmul__(p: DSimplePolygon) -> DSimplePolygon
__rmul__(v: DVector) -> DVector
__rmul__()
@brief Product of two matrices. @param m The other matrix. @return The matrix product self*m
__str__
method descriptor
__str__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
angle
method descriptor
angle() -> float
@brief Returns the rotation angle of the rotation component of this matrix. @return The angle in degree. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cplx_trans
method descriptor
cplx_trans() -> DCplxTrans
@brief Converts this matrix to a complex transformation (if possible). @return The complex transformation. This method is successful only if the matrix does not contain shear components and the magnification must be isotropic.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Matrix2d
@brief Creates a copy of self
inverted
method descriptor
inverted() -> Matrix2d
@brief The inverse of this matrix. @return The inverse of this matrix
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mirror
method descriptor
is_mirror() -> bool
@brief Returns the mirror flag of this matrix. @return True if this matrix has a mirror component. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear.
m
method descriptor
m() -> float
@brief Gets the m coefficient with the given index. @return The coefficient [i,j]
m11
method descriptor
m11() -> float
@brief Gets the m11 coefficient. @return The value of the m11 coefficient
m12
method descriptor
m12() -> float
@brief Gets the m12 coefficient. @return The value of the m12 coefficient
m21
method descriptor
m21() -> float
@brief Gets the m21 coefficient. @return The value of the m21 coefficient
m22
method descriptor
m22() -> float
@brief Gets the m22 coefficient. @return The value of the m22 coefficient
mag_x
method descriptor
mag_x() -> float
@brief Returns the x magnification of the magnification component of this matrix. @return The magnification factor. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation.
mag_y
method descriptor
mag_y() -> float
@brief Returns the y magnification of the magnification component of this matrix. @return The magnification factor. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation.
new
builtin
new() -> Matrix2d
new(m11: float, m12: float, m21: float, m22: float) -> Matrix2d
new(m: float) -> Matrix2d
new(mx: float, my: float) -> Matrix2d
new(t: DCplxTrans) -> Matrix2d
new()
@brief Create a new Matrix2d from the four coefficients
newc
builtin
newc(mag: float, rotation: float, mirror: bool) -> Matrix2d
newc(shear: float, mx: float, my: float, rotation: float, mirror: bool) -> Matrix2d
newc()
@brief Create a new Matrix2d representing a shear, anisotropic magnification, rotation and mirroring @param shear The shear angle @param mx The magnification in x direction @param my The magnification in y direction @param rotation The rotation angle (in degree) @param mirror The mirror flag (at x axis)
The order of execution of the operations is mirror, magnification, shear and rotation. This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite).
shear_angle
method descriptor
shear_angle() -> float
@brief Returns the magnitude of the shear component of this matrix. @return The shear angle in degree. The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.
to_s
method descriptor
to_s() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
trans
method descriptor
trans() -> DPoint
@brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point
Matrix3d
@brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations.
This object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion.
This class was introduced in version 0.22.
AdjustAll
class
AdjustAll: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustDisplacement
class
AdjustDisplacement: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustMagnification
class
AdjustMagnification: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustNone
class
AdjustNone: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustPerspective
class
AdjustPerspective: int = 7
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustRotation
class
AdjustRotation: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustRotationMirror
class
AdjustRotationMirror: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AdjustShear
class
AdjustShear: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations.\n\nThis object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion.\n\nThis class was introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 82
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Matrix3d' objects>
list of weak references to the object
__add__
method descriptor
__add__() -> Matrix3d
@brief Sum of two matrices. @param m The other matrix. @return The (element-wise) sum of self+m
__copy__
method descriptor
__copy__() -> Matrix3d
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Matrix3d
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
__init__(m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> None
__init__(m11: float, m12: float, m21: float, m22: float) -> None
__init__(m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None
__init__(m: float) -> None
__init__(t: DCplxTrans) -> None
__init__()
@brief Create a new Matrix3d from the nine matrix coefficients
__mul__
method descriptor
__mul__(box: DBox) -> DBox
__mul__(e: DEdge) -> DEdge
__mul__(m: Matrix3d) -> Matrix3d
__mul__(p: DPoint) -> DPoint
__mul__(p: DPolygon) -> DPolygon
__mul__(p: DSimplePolygon) -> DSimplePolygon
__mul__(v: DVector) -> DVector
__mul__()
@brief Transforms a polygon with this matrix. @param p The polygon to transform. @return The transformed polygon
__repr__
method descriptor
__repr__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
__rmul__
method descriptor
__rmul__(box: DBox) -> DBox
__rmul__(e: DEdge) -> DEdge
__rmul__(m: Matrix3d) -> Matrix3d
__rmul__(p: DPoint) -> DPoint
__rmul__(p: DPolygon) -> DPolygon
__rmul__(p: DSimplePolygon) -> DSimplePolygon
__rmul__(v: DVector) -> DVector
__rmul__()
@brief Transforms a polygon with this matrix. @param p The polygon to transform. @return The transformed polygon
__str__
method descriptor
__str__() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
adjust
method descriptor
adjust() -> None
@brief Adjust a 3d matrix to match the given set of landmarks
This function tries to adjust the matrix such, that either the matrix is changed as little as possible (if few landmarks are given) or that the "after" landmarks will match as close as possible to the "before" landmarks (if the problem is overdetermined).
@param landmarks_before The points before the transformation. @param landmarks_after The points after the transformation. @param mode Selects the adjustment mode. Must be one of the Adjust... constants. @param fixed_point The index of the fixed point (one that is definitely mapped to the target) or -1 if there is none
angle
method descriptor
angle() -> float
@brief Returns the rotation angle of the rotation component of this matrix. @return The angle in degree. See the description of this class for details about the basic transformations.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cplx_trans
method descriptor
cplx_trans() -> DCplxTrans
@brief Converts this matrix to a complex transformation (if possible). @return The complex transformation. This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
disp
method descriptor
disp() -> DVector
@brief Returns the displacement vector of this transformation.
Starting with version 0.25 this method returns a vector type instead of a point. @return The displacement vector.
dup
method descriptor
dup() -> Matrix3d
@brief Creates a copy of self
inverted
method descriptor
inverted() -> Matrix3d
@brief The inverse of this matrix. @return The inverse of this matrix
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mirror
method descriptor
is_mirror() -> bool
@brief Returns the mirror flag of this matrix. @return True if this matrix has a mirror component. See the description of this class for details about the basic transformations.
m
method descriptor
m() -> float
@brief Gets the m coefficient with the given index. @return The coefficient [i,j]
mag_x
method descriptor
mag_x() -> float
@brief Returns the x magnification of the magnification component of this matrix. @return The magnification factor.
mag_y
method descriptor
mag_y() -> float
@brief Returns the y magnification of the magnification component of this matrix. @return The magnification factor.
new
builtin
new() -> Matrix3d
new(m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> Matrix3d
new(m11: float, m12: float, m21: float, m22: float) -> Matrix3d
new(m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> Matrix3d
new(m: float) -> Matrix3d
new(t: DCplxTrans) -> Matrix3d
new()
@brief Create a new Matrix3d from the nine matrix coefficients
newc
builtin
newc(mag: float, rotation: float, mirrx: bool) -> Matrix3d
newc(shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d
newc(tx: float, ty: float, z: float, u: DVector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d
newc(u: DVector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d
newc()
@brief Create a new Matrix3d representing a perspective distortion, displacement, shear, anisotropic magnification, rotation and mirroring @param tx The perspective tilt angle x (around the y axis) @param ty The perspective tilt angle y (around the x axis) @param z The observer distance at which the tilt angles are given @param u The displacement @param shear The shear angle @param mx The magnification in x direction @param mx The magnification in y direction @param rotation The rotation angle (in degree) @param mirrx The mirror flag (at x axis)
The order of execution of the operations is mirror, magnification, rotation, shear, perspective distortion and displacement. This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite).
The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles for different observer distances. Hence, the observer distance must be given at which the tilt angles are given. If the magnitude of the tilt angle is not important, z can be set to 1.
Starting with version 0.25 the displacement is of vector type.
shear_angle
method descriptor
shear_angle() -> float
@brief Returns the magnitude of the shear component of this matrix. @return The shear angle in degree. The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.See the description of this class for details about the basic transformations.
to_s
method descriptor
to_s() -> str
@brief Convert the matrix to a string. @return The string representing this matrix
trans
method descriptor
trans() -> DPoint
@brief Transforms a point with this matrix. @param p The point to transform. @return The transformed point
tx
method descriptor
tx() -> float
@brief Returns the perspective tilt angle tx. @param z The observer distance at which the tilt angle is computed. @return The tilt angle tx. The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1.
ty
method descriptor
ty() -> float
@brief Returns the perspective tilt angle ty. @param z The observer distance at which the tilt angle is computed. @return The tilt angle ty. The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1.
Metrics
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
Euclidian
class
Euclidian: Metrics = Euclidian (1)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
Projection
class
Projection: Metrics = Projection (3)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
Square
class
Square: Metrics = Square (2)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the metrics type for \\Region#width and related checks.\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 165
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Metrics' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Metrics
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Metrics
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Metrics) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Metrics
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> Metrics
new(s: str) -> Metrics
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
Net
Bases: klayout.dbcore.NetlistObject
@brief A single net. A net connects multiple pins or terminals together. Pins are either pin or subcircuits of outgoing pins of the circuit the net lives in. Terminals are connections made to specific terminals of devices.
Net objects are created inside a circuit with \Circuit#create_net.
To connect a net to an outgoing pin of a circuit, use \Circuit#connect_pin, to disconnect a net from an outgoing pin use \Circuit#disconnect_pin. To connect a net to a pin of a subcircuit, use \SubCircuit#connect_pin, to disconnect a net from a pin of a subcircuit, use \SubCircuit#disconnect_pin. To connect a net to a terminal of a device, use \Device#connect_terminal, to disconnect a net from a terminal of a device, use \Device#disconnect_terminal.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A single net.\nA net connects multiple pins or terminals together. Pins are either pin or subcircuits of outgoing pins of the circuit the net lives in. Terminals are connections made to specific terminals of devices.\n\nNet objects are created inside a circuit with \\Circuit#create_net.\n\nTo connect a net to an outgoing pin of a circuit, use \\Circuit#connect_pin, to disconnect a net from an outgoing pin use \\Circuit#disconnect_pin. To connect a net to a pin of a subcircuit, use \\SubCircuit#connect_pin, to disconnect a net from a pin of a subcircuit, use \\SubCircuit#disconnect_pin. To connect a net to a terminal of a device, use \\Device#connect_terminal, to disconnect a net from a terminal of a device, use \\Device#disconnect_terminal.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 95
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
cluster_id
class
cluster_id: int = <attribute 'cluster_id' of 'Net' objects>
@brief Gets the cluster ID of the net. See \cluster_id= for details about the cluster ID.
@brief Sets the cluster ID of the net. The cluster ID connects the net with a layout cluster. It is set when the net is extracted from a layout.
name
class
name: str = <attribute 'name' of 'Net' objects>
@brief Gets the name of the net. See \name= for details about the name.
@brief Sets the name of the net. The name of the net is used for naming the net in schematic files for example. The name of the net has to be unique.
__repr__
method descriptor
__repr__() -> str
@brief Gets the qualified name. The qualified name is like the expanded name, but the circuit's name is preceded (i.e. 'CIRCUIT:NET') if available.
__str__
method descriptor
__str__() -> str
@brief Gets the qualified name. The qualified name is like the expanded name, but the circuit's name is preceded (i.e. 'CIRCUIT:NET') if available.
circuit
method descriptor
circuit() -> Circuit
@brief Gets the circuit the net lives in.
clear
method descriptor
clear() -> None
@brief Clears the net.
each_pin
method descriptor
each_pin() -> Iterator[NetPinRef]
each_pin() -> Iterator[NetPinRef]
each_pin()
@brief Iterates over all outgoing pins the net connects (non-const version). Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in.
This constness variant has been introduced in version 0.26.8
each_subcircuit_pin
method descriptor
each_subcircuit_pin() -> Iterator[NetSubcircuitPinRef]
each_subcircuit_pin() -> Iterator[NetSubcircuitPinRef]
each_subcircuit_pin()
@brief Iterates over all subcircuit pins the net connects (non-const version). Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits.
This constness variant has been introduced in version 0.26.8
each_terminal
method descriptor
each_terminal() -> Iterator[NetTerminalRef]
each_terminal() -> Iterator[NetTerminalRef]
each_terminal()
@brief Iterates over all terminals the net connects (non-const version). Terminals connect devices. Terminal connections are described by \NetTerminalRef objects.
This constness variant has been introduced in version 0.26.8
expanded_name
method descriptor
expanded_name() -> str
@brief Gets the expanded name of the net. The expanded name takes the name of the net. If the name is empty, the cluster ID will be used to build a name.
is_floating
method descriptor
is_floating() -> bool
@brief Returns true, if the net is floating. Floating nets are those which don't have any device or subcircuit on it and are not connected through a pin.
is_internal
method descriptor
is_internal() -> bool
@brief Returns true, if the net is an internal net. Internal nets are those which connect exactly two terminals and nothing else (pin_count = 0 and terminal_count == 2).
is_passive
method descriptor
is_passive() -> bool
@brief Returns true, if the net is passive. Passive nets don't have devices or subcircuits on it. They can be exposed through a pin. \is_floating? implies \is_passive?.
This method has been introduced in version 0.26.1.
pin_count
method descriptor
pin_count() -> int
@brief Returns the number of outgoing pins connected by this net.
qname
method descriptor
qname() -> str
@brief Gets the qualified name. The qualified name is like the expanded name, but the circuit's name is preceded (i.e. 'CIRCUIT:NET') if available.
subcircuit_pin_count
method descriptor
subcircuit_pin_count() -> int
@brief Returns the number of subcircuit pins connected by this net.
terminal_count
method descriptor
terminal_count() -> int
@brief Returns the number of terminals connected by this net.
to_s
method descriptor
to_s() -> str
@brief Gets the qualified name. The qualified name is like the expanded name, but the circuit's name is preceded (i.e. 'CIRCUIT:NET') if available.
NetElement
@brief A net element for the NetTracer net tracing facility
This object represents a piece of a net extracted by the net tracer. See the description of \NetTracer for more details about the net tracer feature.
The NetTracer object represents one shape of the net. The shape can be an original shape or a shape derived in a boolean operation. In the first case, the shape refers to a shape within a cell or a subcell of the original top cell. In the latter case, the shape is a synthesized one and outside the original layout hierarchy.
In any case, the \shape method will deliver the shape and \trans the transformation of the shape into the original top cell. To obtain a flat representation of the net, the shapes need to be transformed by this transformation.
\layer will give the layer the shape is located at, \cell_index will denote the cell that contains the shape.
This class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief A net element for the NetTracer net tracing facility\n\nThis object represents a piece of a net extracted by the net tracer. See the description of \\NetTracer for more details about the net tracer feature.\n\nThe NetTracer object represents one shape of the net. The shape can be an original shape or a shape derived in a boolean operation. In the first case, the shape refers to a shape within a cell or a subcell of the original top cell. In the latter case, the shape is a synthesized one and outside the original layout hierarchy.\n\nIn any case, the \\shape method will deliver the shape and \\trans the transformation of the shape into the original top cell. To obtain a flat representation of the net, the shapes need to be transformed by this transformation.\n\n\\layer will give the layer the shape is located at, \\cell_index will denote the cell that contains the shape.\n\nThis class has been introduced in version 0.25.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 200
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetElement' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetElement
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetElement
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Delivers the bounding box of the shape as seen from the original top cell
cell_index
method descriptor
cell_index() -> int
@brief Gets the index of the cell the shape is inside
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetElement
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layer
method descriptor
layer() -> int
@brief Gets the index of the layer the shape is on
new
builtin
new() -> NetElement
@brief Creates a new object of this class
shape
method descriptor
shape() -> Shape
@brief Gets the shape that makes up this net element See the class description for more details about this attribute.
trans
method descriptor
trans() -> ICplxTrans
@brief Gets the transformation to apply for rendering the shape in the original top cell See the class description for more details about this attribute.
NetPinRef
@brief A connection to an outgoing pin of the circuit. This object is used inside a net (see \Net) to describe the connections a net makes.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A connection to an outgoing pin of the circuit.\nThis object is used inside a net (see \\Net) to describe the connections a net makes.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 93
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetPinRef' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetPinRef
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetPinRef
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetPinRef
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
net
method descriptor
net() -> Net
net() -> Net
net()
@brief Gets the net this pin reference is attached to (non-const version).
This constness variant has been introduced in version 0.26.8
new
builtin
new() -> NetPinRef
@brief Creates a new object of this class
pin
method descriptor
pin() -> Pin
@brief Gets the \Pin object of the pin the connection is made to.
pin_id
method descriptor
pin_id() -> int
@brief Gets the ID of the pin the connection is made to.
NetSubcircuitPinRef
@brief A connection to a pin of a subcircuit. This object is used inside a net (see \Net) to describe the connections a net makes.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A connection to a pin of a subcircuit.\nThis object is used inside a net (see \\Net) to describe the connections a net makes.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 94
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetSubcircuitPinRef' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetSubcircuitPinRef
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetSubcircuitPinRef
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetSubcircuitPinRef
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
net
method descriptor
net() -> Net
net() -> Net
net()
@brief Gets the net this pin reference is attached to (non-const version).
This constness variant has been introduced in version 0.26.8
new
builtin
new() -> NetSubcircuitPinRef
@brief Creates a new object of this class
pin
method descriptor
pin() -> Pin
@brief Gets the \Pin object of the pin the connection is made to.
pin_id
method descriptor
pin_id() -> int
@brief Gets the ID of the pin the connection is made to.
subcircuit
method descriptor
subcircuit() -> SubCircuit
subcircuit() -> SubCircuit
subcircuit()
@brief Gets the subcircuit reference (non-const version). This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net.
This constness variant has been introduced in version 0.26.8
NetTerminalRef
@brief A connection to a terminal of a device. This object is used inside a net (see \Net) to describe the connections a net makes.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A connection to a terminal of a device.\nThis object is used inside a net (see \\Net) to describe the connections a net makes.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 92
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetTerminalRef' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetTerminalRef
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetTerminalRef
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
device
method descriptor
device() -> Device
device() -> Device
device()
@brief Gets the device reference (non-const version). Gets the device object that this connection is made to.
This constness variant has been introduced in version 0.26.8
device_class
method descriptor
device_class() -> DeviceClass
@brief Gets the class of the device which is addressed.
dup
method descriptor
dup() -> NetTerminalRef
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
net
method descriptor
net() -> Net
net() -> Net
net()
@brief Gets the net this terminal reference is attached to (non-const version).
This constness variant has been introduced in version 0.26.8
new
builtin
new() -> NetTerminalRef
@brief Creates a new object of this class
terminal_def
method descriptor
terminal_def() -> DeviceTerminalDefinition
@brief Gets the terminal definition of the terminal that is connected
terminal_id
method descriptor
terminal_id() -> int
@brief Gets the ID of the terminal of the device the connection is made to.
NetTracer
@brief The net tracer feature
The net tracer class provides an interface to the net tracer feature. It is accompanied by the \NetElement and \NetTracerTechnology classes. The latter will provide the technology definition for the net tracer while the \NetElement objects represent a piece of the net after it has been extracted.
The technology definition is optional. The net tracer can be used with a predefined technology as well. The basic scheme of using the net tracer is to instantiate a net tracer object and run the extraction through the \NetTracer#trace method. After this method was executed successfully, the resulting net can be obtained from the net tracer object by iterating over the \NetElement objects of the net tracer.
Here is some sample code:
@code ly = RBA::CellView::active.layout
tracer = RBA::NetTracer::new
tech = RBA::NetTracerConnectivity::new tech.connection("1/0", "2/0", "3/0")
tracer.trace(tech, ly, ly.top_cell, RBA::Point::new(7000, 1500), ly.find_layer(1, 0))
tracer.each_element do |e| puts e.shape.polygon.transformed(e.trans) end @/code
This class has been introduced in version 0.25. With version 0.28, the \NetTracerConnectivity class replaces the 'NetTracerTechnology' class.
__doc__
class
__doc__ = '@brief The net tracer feature\n\nThe net tracer class provides an interface to the net tracer feature. It is accompanied by the \\NetElement and \\NetTracerTechnology classes. The latter will provide the technology definition for the net tracer while the \\NetElement objects represent a piece of the net after it has been extracted.\n\nThe technology definition is optional. The net tracer can be used with a predefined technology as well. The basic scheme of using the net tracer is to instantiate a net tracer object and run the extraction through the \\NetTracer#trace method. After this method was executed successfully, the resulting net can be obtained from the net tracer object by iterating over the \\NetElement objects of the net tracer.\n\nHere is some sample code:\n\n@code\nly = RBA::CellView::active.layout\n\ntracer = RBA::NetTracer::new\n\ntech = RBA::NetTracerConnectivity::new\ntech.connection("1/0", "2/0", "3/0")\n\ntracer.trace(tech, ly, ly.top_cell, RBA::Point::new(7000, 1500), ly.find_layer(1, 0))\n\ntracer.each_element do |e|\n puts e.shape.polygon.transformed(e.trans)\nend\n@/code\n\nThis class has been introduced in version 0.25. With version 0.28, the \\NetTracerConnectivity class replaces the \'NetTracerTechnology\' class.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 201
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetTracer' objects>
list of weak references to the object
trace_depth
class
trace_depth: int = <attribute 'trace_depth' of 'NetTracer' objects>
@brief gets the trace depth See \trace_depth= for a description of this property.
This method has been introduced in version 0.26.4.
@brief Sets the trace depth (shape limit) Set this value to limit the maximum number of shapes delivered. Upon reaching this count, the tracer will stop and report the net as 'incomplete' (see \incomplete?). Setting a trace depth if 0 is equivalent to 'unlimited'. The actual number of shapes delivered may be a little less than the depth because of internal marker shapes which are taken into account, but are not delivered.
This method has been introduced in version 0.26.4.
__copy__
method descriptor
__copy__() -> NetTracer
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetTracer
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear
method descriptor
clear() -> None
@brief Clears the data from the last extraction
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetTracer
@brief Creates a copy of self
each_element
method descriptor
each_element() -> Iterator[NetElement]
@brief Iterates over the elements found during extraction The elements are available only after the extraction has been performed.
incomplete
method descriptor
incomplete() -> bool
@brief Returns a value indicating whether the net is incomplete A net may be incomplete if the extraction has been stopped by the user for example. This attribute is useful only after the extraction has been performed.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
name
method descriptor
name() -> str
@brief Returns the name of the net found during extraction The net name is extracted from labels found during the extraction. This attribute is useful only after the extraction has been performed.
new
builtin
new() -> NetTracer
@brief Creates a new object of this class
num_elements
method descriptor
num_elements() -> int
@brief Returns the number of elements found during extraction This attribute is useful only after the extraction has been performed.
trace
method descriptor
trace(tech: NetTracerConnectivity, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None
trace(tech: NetTracerConnectivity, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None
trace(tech: str, connectivity_name: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None
trace(tech: str, connectivity_name: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None
trace(tech: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None
trace(tech: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None
trace()
@brief Runs a path extraction taking a predefined technology This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup.This version allows specifying the name of the connecvitiy setup.
This method variant has been introduced in version 0.28.
NetTracerConnectionInfo
@brief Represents a single connection info line for the net tracer technology definition This class has been introduced in version 0.28.3.
__doc__
class
__doc__ = '@brief Represents a single connection info line for the net tracer technology definition\nThis class has been introduced in version 0.28.3.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 196
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetTracerConnectionInfo' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetTracerConnectionInfo
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetTracerConnectionInfo
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetTracerConnectionInfo
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layer_a
method descriptor
layer_a() -> str
@brief Gets the expression for the A layer
layer_b
method descriptor
layer_b() -> str
@brief Gets the expression for the B layer
new
builtin
new() -> NetTracerConnectionInfo
@brief Creates a new object of this class
via_layer
method descriptor
via_layer() -> str
@brief Gets the expression for the Via layer
NetTracerConnectivity
@brief A connectivity description for the net tracer
This object represents the technology description for the net tracer (represented by the \NetTracer class). A technology description basically consists of connection declarations. A connection is given by either two or three expressions describing two conductive materials. With two expressions, the connection describes a transition from one material to another one. With three expressions, the connection describes a transition from one material to another through a connection (a "via").
The conductive material is derived from original layers either directly or through boolean expressions. These expressions can include symbols which are defined through the \symbol method.
For details about the expressions see the description of the net tracer feature.
This class has been introduced in version 0.28 and replaces the 'NetTracerTechnology' class which has been generalized.
__doc__
class
__doc__ = '@brief A connectivity description for the net tracer\n\nThis object represents the technology description for the net tracer (represented by the \\NetTracer class).\nA technology description basically consists of connection declarations.\nA connection is given by either two or three expressions describing two conductive materials.\nWith two expressions, the connection describes a transition from one material to another one.\nWith three expressions, the connection describes a transition from one material to another through a connection (a "via").\n\nThe conductive material is derived from original layers either directly or through boolean expressions. These expressions can include symbols which are defined through the \\symbol method.\n\nFor details about the expressions see the description of the net tracer feature.\n\nThis class has been introduced in version 0.28 and replaces the \'NetTracerTechnology\' class which has been generalized.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 198
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetTracerConnectivity' objects>
list of weak references to the object
description
class
description: str = <attribute 'description' of 'NetTracerConnectivity' objects>
@brief Gets the description text of the connectivty definition The description is an optional string giving a human-readable description for this definition.
@brief Sets the description of the connectivty definition
name
class
name: str = <attribute 'name' of 'NetTracerConnectivity' objects>
@brief Gets the name of the connectivty definition The name is an optional string defining the formal name for this definition.
@brief Sets the name of the connectivty definition
__copy__
method descriptor
__copy__() -> NetTracerConnectivity
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetTracerConnectivity
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
connection
method descriptor
connection(a: str, b: str) -> None
connection(a: str, via: str, b: str) -> None
connection()
@brief Defines a connection between materials through a via See the class description for details about this method.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetTracerConnectivity
@brief Creates a copy of self
each_connection
method descriptor
each_connection() -> Iterator[NetTracerConnectionInfo]
@brief Gets the connection information. This iterator method has been introduced in version 0.28.3.
each_symbol
method descriptor
each_symbol() -> Iterator[NetTracerSymbolInfo]
@brief Gets the symbol information. This iterator method has been introduced in version 0.28.3.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetTracerConnectivity
@brief Creates a new object of this class
symbol
method descriptor
symbol() -> None
@brief Defines a symbol for use in the material expressions. Defines a sub-expression to be used in further symbols or material expressions. For the detailed notation of the expression see the description of the net tracer feature.
NetTracerSymbolInfo
@brief Represents a single symbol info line for the net tracer technology definition This class has been introduced in version 0.28.3.
__doc__
class
__doc__ = '@brief Represents a single symbol info line for the net tracer technology definition\nThis class has been introduced in version 0.28.3.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 197
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetTracerSymbolInfo' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetTracerSymbolInfo
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetTracerSymbolInfo
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetTracerSymbolInfo
@brief Creates a copy of self
expression
method descriptor
expression() -> str
@brief Gets the expression
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetTracerSymbolInfo
@brief Creates a new object of this class
symbol
method descriptor
symbol() -> str
@brief Gets the symbol
NetTracerTechnologyComponent
Bases: klayout.dbcore.TechnologyComponent
@brief Represents the technology information for the net tracer. This class has been redefined in version 0.28 and re-introduced in version 0.28.3. Since version 0.28, multiple stacks are supported and the individual stack definition is provided through a list of stacks. Use \each to iterate the stacks.
__doc__
class
__doc__ = '@brief Represents the technology information for the net tracer.\nThis class has been redefined in version 0.28 and re-introduced in version 0.28.3. Since version 0.28, multiple stacks are supported and the individual stack definition is provided through a list of stacks. Use \\each to iterate the stacks.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 199
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__copy__
method descriptor
__copy__() -> NetTracerTechnologyComponent
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetTracerTechnologyComponent
@brief Creates a copy of self
__iter__
method descriptor
__iter__() -> Iterator[NetTracerConnectivity]
@brief Gets the connectivity definitions from the net tracer technology component.
add
method descriptor
add() -> None
@brief Adds a connectivity definition. This method has been introduced in version 0.28.7
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear
method descriptor
clear() -> None
@brief Removes all connectivity definitions. This method has been introduced in version 0.28.7
dup
method descriptor
dup() -> NetTracerTechnologyComponent
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[NetTracerConnectivity]
@brief Gets the connectivity definitions from the net tracer technology component.
Netlist
@brief The netlist top-level class A netlist is a hierarchical structure of circuits. At least one circuit is the top-level circuit, other circuits may be referenced as subcircuits. Circuits are created with \create_circuit and are represented by objects of the \Circuit class.
Beside circuits, the netlist manages device classes. Device classes describe specific types of devices. Device classes are represented by objects of the \DeviceClass class and are created using \create_device_class.
The netlist class has been introduced with version 0.26.
__doc__
class
__doc__ = '@brief The netlist top-level class\nA netlist is a hierarchical structure of circuits. At least one circuit is the top-level circuit, other circuits may be referenced as subcircuits.\nCircuits are created with \\create_circuit and are represented by objects of the \\Circuit class.\n\nBeside circuits, the netlist manages device classes. Device classes describe specific types of devices. Device classes are represented by objects of the \\DeviceClass class and are created using \\create_device_class.\n\nThe netlist class has been introduced with version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 103
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Netlist' objects>
list of weak references to the object
case_sensitive
class
case_sensitive: bool = <attribute 'case_sensitive' of 'Netlist' objects>
@brief Returns a value indicating whether the netlist names are case sensitive This method has been added in version 0.27.3.
@brief Sets a value indicating whether the netlist names are case sensitive This method has been added in version 0.27.3.
__copy__
method descriptor
__copy__() -> Netlist
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Netlist
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__repr__
method descriptor
__repr__() -> str
@brief Converts the netlist to a string representation. This method is intended for test purposes mainly.
__str__
method descriptor
__str__() -> str
@brief Converts the netlist to a string representation. This method is intended for test purposes mainly.
add
method descriptor
add(circuit: Circuit) -> None
add(device_class: DeviceClass) -> None
add()
@brief Adds the device class to the netlist This method will add the given device class object to the netlist. After the device class has been added, it will be owned by the netlist.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
blank_circuit
method descriptor
blank_circuit() -> None
@brief Blanks circuits matching a certain pattern This method will erase everything from inside the circuits matching the given pattern. It will only leave pins which are not connected to any net. Hence, this method forms 'abstract' or black-box circuits which can be instantiated through subcircuits like the former ones, but are empty shells. The name pattern is a glob expression. For example, 'blank_circuit("np*")' will blank out all circuits with names starting with 'np'.
For more details see \Circuit#blank which is the corresponding method on the actual object.
circuit_by_cell_index
method descriptor
circuit_by_cell_index(cell_index: int) -> Circuit
circuit_by_cell_index(cell_index: int) -> Circuit
circuit_by_cell_index()
@brief Gets the circuit object for a given cell index (const version). If the cell index is not valid or no circuit is registered with this index, nil is returned.
This constness variant has been introduced in version 0.26.8.
circuit_by_name
method descriptor
circuit_by_name(name: str) -> Circuit
circuit_by_name(name: str) -> Circuit
circuit_by_name()
@brief Gets the circuit object for a given name (const version). If the name is not a valid circuit name, nil is returned.
This constness variant has been introduced in version 0.26.8.
circuits_by_name
method descriptor
circuits_by_name(name_pattern: str) -> List[Circuit]
circuits_by_name(name_pattern: str) -> List[Circuit]
circuits_by_name()
@brief Gets the circuit objects for a given name filter (const version). The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern.
This constness variant has been introduced in version 0.26.8.
combine_devices
method descriptor
combine_devices() -> None
@brief Combines devices where possible This method will combine devices that can be combined according to their device classes 'combine_devices' method. For example, serial or parallel resistors can be combined into a single resistor.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
device_class_by_name
method descriptor
device_class_by_name(name: str) -> DeviceClass
device_class_by_name(name: str) -> DeviceClass
device_class_by_name()
@brief Gets the device class for a given name (const version). If the name is not a valid device class name, nil is returned.
This constness variant has been introduced in version 0.26.8.
dup
method descriptor
dup() -> Netlist
@brief Creates a copy of self
each_circuit
method descriptor
each_circuit() -> Iterator[Circuit]
each_circuit() -> Iterator[Circuit]
each_circuit()
@brief Iterates over the circuits of the netlist (const version)
This constness variant has been introduced in version 0.26.8.
each_circuit_bottom_up
method descriptor
each_circuit_bottom_up() -> Iterator[Circuit]
each_circuit_bottom_up() -> Iterator[Circuit]
each_circuit_bottom_up()
@brief Iterates over the circuits bottom-up (const version) Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down.
This constness variant has been introduced in version 0.26.8.
each_circuit_top_down
method descriptor
each_circuit_top_down() -> Iterator[Circuit]
each_circuit_top_down() -> Iterator[Circuit]
each_circuit_top_down()
@brief Iterates over the circuits top-down (const version) Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits.
This constness variant has been introduced in version 0.26.8.
each_device_class
method descriptor
each_device_class() -> Iterator[DeviceClass]
each_device_class() -> Iterator[DeviceClass]
each_device_class()
@brief Iterates over the device classes of the netlist (const version)
This constness variant has been introduced in version 0.26.8.
flatten
method descriptor
flatten() -> None
@brief Flattens all circuits of the netlist After calling this method, only the top circuits will remain.
flatten_circuit
method descriptor
flatten_circuit(circuit: Circuit) -> None
flatten_circuit(pattern: str) -> None
flatten_circuit()
@brief Flattens circuits matching a certain pattern This method will substitute all instances (subcircuits) of all circuits with names matching the given name pattern. The name pattern is a glob expression. For example, 'flatten_circuit("np*")' will flatten all circuits with names starting with 'np'.
flatten_circuits
method descriptor
flatten_circuits() -> None
@brief Flattens all given circuits of the netlist This method is equivalent to calling \flatten_circuit for all given circuits, but more efficient.
This method has been introduced in version 0.26.1
from_s
method descriptor
from_s() -> None
@brief Reads the netlist from a string representation. This method is intended for test purposes mainly. It turns a string returned by \to_s back into a netlist. Note that the device classes must be created before as they are not persisted inside the string.
is_case_sensitive
method descriptor
is_case_sensitive() -> bool
@brief Returns a value indicating whether the netlist names are case sensitive This method has been added in version 0.27.3.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
make_top_level_pins
method descriptor
make_top_level_pins() -> None
@brief Creates pins for top-level circuits. This method will turn all named nets of top-level circuits (such that are not referenced by subcircuits) into pins. This method can be used before purge to avoid that purge will remove nets which are directly connecting to subcircuits.
nets_by_name
method descriptor
nets_by_name(name_pattern: str) -> List[Net]
nets_by_name(name_pattern: str) -> List[Net]
nets_by_name()
@brief Gets the net objects for a given name filter (const version). The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern.
This constness variant has been introduced in version 0.28.4.
new
builtin
new() -> Netlist
@brief Creates a new object of this class
purge
method descriptor
purge() -> None
@brief Purge unused nets, circuits and subcircuits. This method will purge all nets which return \floating == true. Circuits which don't have any nets (or only floating ones) and removed. Their subcircuits are disconnected. This method respects the \Circuit#dont_purge attribute and will never delete circuits with this flag set.
purge_circuit
method descriptor
purge_circuit() -> None
@brief Removes the given circuit object and all child circuits which are not used otherwise from the netlist After the circuit has been removed, the object becomes invalid and cannot be used further. A circuit with references (see \has_refs?) should not be removed as the subcircuits calling it would afterwards point to nothing.
purge_devices
method descriptor
purge_devices() -> None
@brief Purges invalid devices. Purges devices which are considered invalid. Such devices are for example those whose terminals are all connected to a single net.
This method has been added in version 0.29.7.
purge_nets
method descriptor
purge_nets() -> None
@brief Purges floating nets. Floating nets can be created as effect of reconnections of devices or pins. This method will eliminate all nets that make less than two connections.
read
method descriptor
read() -> None
@brief Writes the netlist to the given file using the given reader object to parse the file See \NetlistSpiceReader for an example for a parser.
remove
method descriptor
remove(circuit: Circuit) -> None
remove(device_class: DeviceClass) -> None
remove()
@brief Removes the given device class object from the netlist After the object has been removed, it becomes invalid and cannot be used further. Use this method with care as it may corrupt the internal structure of the netlist. Only use this method when device refers to this device class.
simplify
method descriptor
simplify() -> None
@brief Convenience method that combines the simplification. This method is a convenience method that runs \make_top_level_pins, \purge, \combine_devices and \purge_nets.
to_s
method descriptor
to_s() -> str
@brief Converts the netlist to a string representation. This method is intended for test purposes mainly.
top_circuit
method descriptor
top_circuit() -> Circuit
top_circuit() -> Circuit
top_circuit()
@brief Gets the top circuit (const version). This method will return nil, if there is no top circuit. It will raise an error, if there is more than a single top circuit.
This convenience method has been added in version 0.29.5.
top_circuit_count
method descriptor
top_circuit_count() -> int
@brief Gets the number of top circuits. Top circuits are those which are not referenced by other circuits via subcircuits. A well-formed netlist has a single top circuit.
top_circuits
method descriptor
top_circuits() -> List[Circuit]
top_circuits() -> List[Circuit]
top_circuits()
@brief Gets the top circuits. Returns a list of top circuits.
This convenience method has been added in version 0.29.5.
write
method descriptor
write() -> None
@brief Writes the netlist to the given file using the given writer object to format the file See \NetlistSpiceWriter for an example for a formatter. The description is an arbitrary text which will be put into the file somewhere at the beginning.
NetlistCompareLogger
@brief A base class for netlist comparer event receivers See \GenericNetlistCompareLogger for custom implementations of such receivers.
__doc__
class
__doc__ = '@brief A base class for netlist comparer event receivers\nSee \\GenericNetlistCompareLogger for custom implementations of such receivers.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 112
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistCompareLogger' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetlistCompareLogger
@brief Creates a new object of this class
NetlistComparer
@brief Compares two netlists This class performs a comparison of two netlists. It can be used with an event receiver (logger) to track the errors and net mismatches. Event receivers are derived from class \GenericNetlistCompareLogger. The netlist comparer can be configured in different ways. Specific hints can be given for nets, device classes or circuits to improve efficiency and reliability of the graph equivalence deduction algorithm. For example, objects can be marked as equivalent using \same_nets, \same_circuits etc. The compare algorithm will then use these hints to derive further equivalences. This way, ambiguities can be resolved.
Another configuration option relates to swappable pins of subcircuits. If pins are marked this way, the compare algorithm may swap them to achieve net matching. Swappable pins belong to an 'equivalence group' and can be defined with \equivalent_pins.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = "@brief Compares two netlists\nThis class performs a comparison of two netlists.\nIt can be used with an event receiver (logger) to track the errors and net mismatches. Event receivers are derived from class \\GenericNetlistCompareLogger.\nThe netlist comparer can be configured in different ways. Specific hints can be given for nets, device classes or circuits to improve efficiency and reliability of the graph equivalence deduction algorithm. For example, objects can be marked as equivalent using \\same_nets, \\same_circuits etc. The compare algorithm will then use these hints to derive further equivalences. This way, ambiguities can be resolved.\n\nAnother configuration option relates to swappable pins of subcircuits. If pins are marked this way, the compare algorithm may swap them to achieve net matching. Swappable pins belong to an 'equivalence group' and can be defined with \\equivalent_pins.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 114
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistComparer' objects>
list of weak references to the object
dont_consider_net_names
class
dont_consider_net_names: bool = <attribute 'dont_consider_net_names' of 'NetlistComparer' objects>
@brief Gets a value indicating whether net names shall not be considered See \dont_consider_net_names= for details.
@brief Sets a value indicating whether net names shall not be considered If this value is set to true, net names will not be considered when resolving ambiguities. Not considering net names usually is more expensive. The default is 'false' indicating that net names will be considered for ambiguity resolution.
This property has been introduced in version 0.26.7.
max_branch_complexity
class
max_branch_complexity: int = <attribute 'max_branch_complexity' of 'NetlistComparer' objects>
@brief Gets the maximum branch complexity See \max_branch_complexity= for details.
@brief Sets the maximum branch complexity This value limits the maximum branch complexity of the backtracking algorithm. The complexity is the accumulated number of branch options with ambiguous net matches. Backtracking will stop when the maximum number of options has been exceeded.
By default, from version 0.27 on the complexity is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation.
As the computational complexity is the square of the branch count, this value should be adjusted carefully.
max_depth
class
max_depth: int = <attribute 'max_depth' of 'NetlistComparer' objects>
@brief Gets the maximum search depth See \max_depth= for details.
@brief Sets the maximum search depth This value limits the search depth of the backtracking algorithm to the given number of jumps.
By default, from version 0.27 on the depth is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation.
max_resistance
class
max_resistance: None = <attribute 'max_resistance' of 'NetlistComparer' objects>
@brief Excludes all resistor devices with a resistance values higher than the given threshold. To reset this constraint, set this attribute to zero.
min_capacitance
class
min_capacitance: None = <attribute 'min_capacitance' of 'NetlistComparer' objects>
@brief Excludes all capacitor devices with a capacitance values less than the given threshold. To reset this constraint, set this attribute to zero.
with_log
class
with_log: bool = <attribute 'with_log' of 'NetlistComparer' objects>
@brief Gets a value indicating that log messages are generated. See \with_log= for details about this flag.
This attribute have been introduced in version 0.28.
@brief Sets a value indicating that log messages are generated. Log messages may be expensive to compute, hence they can be turned off. By default, log messages are generated.
This attribute have been introduced in version 0.28.
__init__
method descriptor
__init__() -> None
__init__(logger: GenericNetlistCompareLogger) -> None
__init__()
@brief Creates a new comparer object. The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details.
compare
method descriptor
compare(netlist_a: Netlist, netlist_b: Netlist) -> bool
compare(netlist_a: Netlist, netlist_b: Netlist, logger: NetlistCompareLogger) -> bool
compare()
@brief Compares two netlists. This method will perform the actual netlist compare using the given logger. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
equivalent_pins
method descriptor
equivalent_pins(circuit_b: Circuit, pin_id1: int, pin_id2: int) -> None
equivalent_pins(circuit_b: Circuit, pin_ids: Sequence[int]) -> None
equivalent_pins()
@brief Marks several pins of the given circuit as equivalent (i.e. they can be swapped). Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. This version is a generic variant of the two-pin version of this method.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
join_symmetric_nets
method descriptor
join_symmetric_nets() -> None
@brief Joins symmetric nodes in the given circuit.
Nodes are symmetrical if swapping them would not modify the circuit. Hence they will carry the same potential and can be connected (joined). This will simplify the circuit and can be applied before device combination to render a schematic-equivalent netlist in some cases (split gate option).
This algorithm will apply the comparer's settings to the symmetry condition (device filtering, device compare tolerances, device class equivalence etc.).
This method has been introduced in version 0.26.4.
new
builtin
new() -> NetlistComparer
new(logger: GenericNetlistCompareLogger) -> NetlistComparer
new()
@brief Creates a new comparer object. The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details.
same_circuits
method descriptor
same_circuits() -> None
@brief Marks two circuits as identical. This method makes a circuit circuit_a in netlist a identical to the corresponding circuit circuit_b in netlist b (see \compare). By default circuits with the same name are identical.
same_device_classes
method descriptor
same_device_classes() -> None
@brief Marks two device classes as identical. This makes a device class dev_cls_a in netlist a identical to the corresponding device class dev_cls_b in netlist b (see \compare). By default device classes with the same name are identical.
same_nets
method descriptor
same_nets(circuit_a: Circuit, circuit_b: Circuit, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None
same_nets(net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None
same_nets()
@brief Marks two nets as identical. This makes a net net_a in netlist a identical to the corresponding net net_b in netlist b (see \compare). Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities.
If 'must_match' is true, the nets are required to match. If they don't, an error is reported.
This variant allows specifying nil for the nets indicating the nets are mismatched by definition. with 'must_match' this will render a net mismatch error.
This variant has been added in version 0.27.3.
unmatched_circuits_a
method descriptor
unmatched_circuits_a() -> List[Circuit]
@brief Returns a list of circuits in A for which there is not corresponding circuit in B This list can be used to flatten these circuits so they do not participate in the compare process.
unmatched_circuits_b
method descriptor
unmatched_circuits_b() -> List[Circuit]
@brief Returns a list of circuits in B for which there is not corresponding circuit in A This list can be used to flatten these circuits so they do not participate in the compare process.
NetlistCrossReference
Bases: klayout.dbcore.NetlistCompareLogger
@brief Represents the identity mapping between the objects of two netlists.
The NetlistCrossReference object is a container for the results of a netlist comparison. It implemented the \NetlistCompareLogger interface, hence can be used as output for a netlist compare operation (\NetlistComparer#compare). It's purpose is to store the results of the compare. It is used in this sense inside the \LayoutVsSchematic framework.
The basic idea of the cross reference object is pairing: the netlist comparer will try to identify matching items and store them as pairs inside the cross reference object. If no match is found, a single-sided pair is generated: one item is nil in this case. Beside the items, a status is kept which gives more details about success or failure of the match operation.
Item pairing happens on different levels, reflecting the hierarchy of the netlists. On the top level there are circuits. Inside circuits nets, devices, subcircuits and pins are paired. Nets further contribute their connected items through terminals (for devices), pins (outgoing) and subcircuit pins.
This class has been introduced in version 0.26.
Match
class
Match: Status = Match (1)
@brief This class represents the NetlistCrossReference::Status enum
MatchWithWarning
class
MatchWithWarning: Status = MatchWithWarning (4)
@brief This class represents the NetlistCrossReference::Status enum
Mismatch
class
Mismatch: Status = Mismatch (5)
@brief This class represents the NetlistCrossReference::Status enum
NoMatch
class
NoMatch: Status = NoMatch (2)
@brief This class represents the NetlistCrossReference::Status enum
None_
class
None_: Status = None (0)
@brief This class represents the NetlistCrossReference::Status enum
Skipped
class
Skipped: Status = Skipped (3)
@brief This class represents the NetlistCrossReference::Status enum
__doc__
class
__doc__ = "@brief Represents the identity mapping between the objects of two netlists.\n\nThe NetlistCrossReference object is a container for the results of a netlist comparison. It implemented the \\NetlistCompareLogger interface, hence can be used as output for a netlist compare operation (\\NetlistComparer#compare). It's purpose is to store the results of the compare. It is used in this sense inside the \\LayoutVsSchematic framework.\n\nThe basic idea of the cross reference object is pairing: the netlist comparer will try to identify matching items and store them as pairs inside the cross reference object. If no match is found, a single-sided pair is generated: one item is nil in this case.\nBeside the items, a status is kept which gives more details about success or failure of the match operation.\n\nItem pairing happens on different levels, reflecting the hierarchy of the netlists. On the top level there are circuits. Inside circuits nets, devices, subcircuits and pins are paired. Nets further contribute their connected items through terminals (for devices), pins (outgoing) and subcircuit pins.\n\nThis class has been introduced in version 0.26."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 115
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
CircuitPairData
@brief A circuit match entry. This object is used to describe the relationship of two circuits in a netlist match.
Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case.
__doc__
class
__doc__ = "@brief A circuit match entry.\nThis object is used to describe the relationship of two circuits in a netlist match.\n\nUpon successful match, the \\first and \\second members are the matching objects and \\status is 'Match'.\nThis object is also used to describe non-matches or match errors. In this case, \\first or \\second may be nil and \\status further describes the case."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 120
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CircuitPairData' objects>
list of weak references to the object
first
method descriptor
first() -> Circuit
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> Circuit
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
status
method descriptor
status() -> NetlistCrossReference.Status
@brief Gets the status of the relation. This enum described the match status of the relation pair.
DevicePairData
@brief A device match entry. This object is used to describe the relationship of two devices in a netlist match.
Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case.
__doc__
class
__doc__ = "@brief A device match entry.\nThis object is used to describe the relationship of two devices in a netlist match.\n\nUpon successful match, the \\first and \\second members are the matching objects and \\status is 'Match'.\nThis object is also used to describe non-matches or match errors. In this case, \\first or \\second may be nil and \\status further describes the case."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 117
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'DevicePairData' objects>
list of weak references to the object
first
method descriptor
first() -> Device
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> Device
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
status
method descriptor
status() -> NetlistCrossReference.Status
@brief Gets the status of the relation. This enum described the match status of the relation pair.
NetPairData
@brief A net match entry. This object is used to describe the relationship of two nets in a netlist match.
Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case.
__doc__
class
__doc__ = "@brief A net match entry.\nThis object is used to describe the relationship of two nets in a netlist match.\n\nUpon successful match, the \\first and \\second members are the matching objects and \\status is 'Match'.\nThis object is also used to describe non-matches or match errors. In this case, \\first or \\second may be nil and \\status further describes the case."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 116
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetPairData' objects>
list of weak references to the object
first
method descriptor
first() -> Net
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> Net
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
status
method descriptor
status() -> NetlistCrossReference.Status
@brief Gets the status of the relation. This enum described the match status of the relation pair.
NetPinRefPair
@brief A match entry for a net pin pair. This object is used to describe the matching pin pairs or non-matching pins on a net.
Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found.
__doc__
class
__doc__ = '@brief A match entry for a net pin pair.\nThis object is used to describe the matching pin pairs or non-matching pins on a net.\n\nUpon successful match, the \\first and \\second members are the matching net objects.Otherwise, either \\first or \\second is nil and the other member is the object for which no match was found.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 122
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetPinRefPair' objects>
list of weak references to the object
first
method descriptor
first() -> NetPinRef
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> NetPinRef
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
NetSubcircuitPinRefPair
@brief A match entry for a net subcircuit pin pair. This object is used to describe the matching subcircuit pin pairs or non-matching subcircuit pins on a net.
Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found.
__doc__
class
__doc__ = '@brief A match entry for a net subcircuit pin pair.\nThis object is used to describe the matching subcircuit pin pairs or non-matching subcircuit pins on a net.\n\nUpon successful match, the \\first and \\second members are the matching net objects.Otherwise, either \\first or \\second is nil and the other member is the object for which no match was found.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 123
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetSubcircuitPinRefPair' objects>
list of weak references to the object
first
method descriptor
first() -> NetSubcircuitPinRef
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> NetSubcircuitPinRef
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
NetTerminalRefPair
@brief A match entry for a net terminal pair. This object is used to describe the matching terminal pairs or non-matching terminals on a net.
Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found.
__doc__
class
__doc__ = '@brief A match entry for a net terminal pair.\nThis object is used to describe the matching terminal pairs or non-matching terminals on a net.\n\nUpon successful match, the \\first and \\second members are the matching net objects.Otherwise, either \\first or \\second is nil and the other member is the object for which no match was found.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 121
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetTerminalRefPair' objects>
list of weak references to the object
first
method descriptor
first() -> NetTerminalRef
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> NetTerminalRef
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
PinPairData
@brief A pin match entry. This object is used to describe the relationship of two circuit pins in a netlist match.
Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case.
__doc__
class
__doc__ = "@brief A pin match entry.\nThis object is used to describe the relationship of two circuit pins in a netlist match.\n\nUpon successful match, the \\first and \\second members are the matching objects and \\status is 'Match'.\nThis object is also used to describe non-matches or match errors. In this case, \\first or \\second may be nil and \\status further describes the case."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 118
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PinPairData' objects>
list of weak references to the object
first
method descriptor
first() -> Pin
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> Pin
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
status
method descriptor
status() -> NetlistCrossReference.Status
@brief Gets the status of the relation. This enum described the match status of the relation pair.
Status
@brief This class represents the NetlistCrossReference::Status enum
Match
class
Match: Status = Match (1)
@brief This class represents the NetlistCrossReference::Status enum
MatchWithWarning
class
MatchWithWarning: Status = MatchWithWarning (4)
@brief This class represents the NetlistCrossReference::Status enum
Mismatch
class
Mismatch: Status = Mismatch (5)
@brief This class represents the NetlistCrossReference::Status enum
NoMatch
class
NoMatch: Status = NoMatch (2)
@brief This class represents the NetlistCrossReference::Status enum
None_
class
None_: Status = None (0)
@brief This class represents the NetlistCrossReference::Status enum
Skipped
class
Skipped: Status = Skipped (3)
@brief This class represents the NetlistCrossReference::Status enum
__doc__
class
__doc__ = '@brief This class represents the NetlistCrossReference::Status enum'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 124
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Status' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: NetlistCrossReference.Status) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> NetlistCrossReference.Status
new(s: str) -> NetlistCrossReference.Status
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
SubCircuitPairData
@brief A subcircuit match entry. This object is used to describe the relationship of two subcircuits in a netlist match.
Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case.
__doc__
class
__doc__ = "@brief A subcircuit match entry.\nThis object is used to describe the relationship of two subcircuits in a netlist match.\n\nUpon successful match, the \\first and \\second members are the matching objects and \\status is 'Match'.\nThis object is also used to describe non-matches or match errors. In this case, \\first or \\second may be nil and \\status further describes the case."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 119
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'SubCircuitPairData' objects>
list of weak references to the object
first
method descriptor
first() -> SubCircuit
@brief Gets the first object of the relation pair. The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found.
second
method descriptor
second() -> SubCircuit
@brief Gets the second object of the relation pair. The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found.
status
method descriptor
status() -> NetlistCrossReference.Status
@brief Gets the status of the relation. This enum described the match status of the relation pair.
circuit_count
method descriptor
circuit_count() -> int
@brief Gets the number of circuit pairs in the cross-reference object.
clear
method descriptor
clear() -> None
@hide
each_circuit_pair
method descriptor
each_circuit_pair() -> Iterator[NetlistCrossReference.CircuitPairData]
@brief Delivers the circuit pairs and their status. See the class description for details.
each_device_pair
method descriptor
each_device_pair() -> Iterator[NetlistCrossReference.DevicePairData]
@brief Delivers the device pairs and their status for the given circuit pair. See the class description for details.
each_net_pair
method descriptor
each_net_pair() -> Iterator[NetlistCrossReference.NetPairData]
@brief Delivers the net pairs and their status for the given circuit pair. See the class description for details.
each_net_pin_pair
method descriptor
each_net_pin_pair() -> Iterator[NetlistCrossReference.NetPinRefPair]
@brief Delivers the pin pairs for the given net pair. For the net pair, lists the pin pairs identified on this net.
each_net_subcircuit_pin_pair
method descriptor
each_net_subcircuit_pin_pair() -> Iterator[NetlistCrossReference.NetSubcircuitPinRefPair]
@brief Delivers the subcircuit pin pairs for the given net pair. For the net pair, lists the subcircuit pin pairs identified on this net.
each_net_terminal_pair
method descriptor
each_net_terminal_pair() -> Iterator[NetlistCrossReference.NetTerminalRefPair]
@brief Delivers the device terminal pairs for the given net pair. For the net pair, lists the device terminal pairs identified on this net.
each_pin_pair
method descriptor
each_pin_pair() -> Iterator[NetlistCrossReference.PinPairData]
@brief Delivers the pin pairs and their status for the given circuit pair. See the class description for details.
each_subcircuit_pair
method descriptor
each_subcircuit_pair() -> Iterator[NetlistCrossReference.SubCircuitPairData]
@brief Delivers the subcircuit pairs and their status for the given circuit pair. See the class description for details.
netlist_a
method descriptor
netlist_a() -> Netlist
@brief Gets the first netlist which participated in the compare. This member may be nil, if the respective netlist is no longer valid. In this case, the netlist cross-reference object cannot be used.
netlist_b
method descriptor
netlist_b() -> Netlist
@brief Gets the second netlist which participated in the compare. This member may be nil, if the respective netlist is no longer valid.In this case, the netlist cross-reference object cannot be used.
other_circuit_for
method descriptor
other_circuit_for() -> Circuit
@brief Gets the matching other circuit for a given primary circuit. The return value will be nil if no match is found. Otherwise it is the 'b' circuit for circuits from the 'a' netlist and vice versa.
This method has been introduced in version 0.27.
other_device_for
method descriptor
other_device_for() -> Device
@brief Gets the matching other device for a given primary device. The return value will be nil if no match is found. Otherwise it is the 'b' device for devices from the 'a' netlist and vice versa.
This method has been introduced in version 0.27.
other_net_for
method descriptor
other_net_for() -> Net
@brief Gets the matching other net for a given primary net. The return value will be nil if no match is found. Otherwise it is the 'b' net for nets from the 'a' netlist and vice versa.
other_pin_for
method descriptor
other_pin_for() -> Pin
@brief Gets the matching other pin for a given primary pin. The return value will be nil if no match is found. Otherwise it is the 'b' pin for pins from the 'a' netlist and vice versa.
This method has been introduced in version 0.27.
other_subcircuit_for
method descriptor
other_subcircuit_for() -> SubCircuit
@brief Gets the matching other subcircuit for a given primary subcircuit. The return value will be nil if no match is found. Otherwise it is the 'b' subcircuit for subcircuits from the 'a' netlist and vice versa.
This method has been introduced in version 0.27.
NetlistDeviceExtractorLayerDefinition
@brief Describes a layer used in the device extraction This read-only structure is used to describe a layer in the device extraction. Every device has specific layers used in the device extraction process. Layer definitions can be retrieved using \NetlistDeviceExtractor#each_layer.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Describes a layer used in the device extraction\nThis read-only structure is used to describe a layer in the device extraction.\nEvery device has specific layers used in the device extraction process.\nLayer definitions can be retrieved using \\NetlistDeviceExtractor#each_layer.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 136
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistDeviceExtractorLayerDefinition' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetlistDeviceExtractorLayerDefinition
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetlistDeviceExtractorLayerDefinition
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
description
method descriptor
description() -> str
@brief Gets the description of the layer.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetlistDeviceExtractorLayerDefinition
@brief Creates a copy of self
fallback_index
method descriptor
fallback_index() -> int
@brief Gets the index of the fallback layer. This is the index of the layer to be used when this layer isn't specified for input or (more important) output.
index
method descriptor
index() -> int
@brief Gets the index of the layer.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
name
method descriptor
name() -> str
@brief Gets the name of the layer.
new
builtin
new() -> NetlistDeviceExtractorLayerDefinition
@brief Creates a new object of this class
NetlistObject
@brief The base class for some netlist objects. The main purpose of this class is to supply user properties for netlist objects.
This class has been introduced in version 0.26.2
__doc__
class
__doc__ = '@brief The base class for some netlist objects.\nThe main purpose of this class is to supply user properties for netlist objects.\n\nThis class has been introduced in version 0.26.2'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 85
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistObject' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetlistObject
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetlistObject
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetlistObject
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetlistObject
@brief Creates a new object of this class
property
method descriptor
property() -> Any
@brief Gets the property value for the given key or nil if there is no value with this key.
property_keys
method descriptor
property_keys() -> List[Any]
@brief Gets the keys for the properties stored in this object.
set_property
method descriptor
set_property() -> None
@brief Sets the property value for the given key. Use a nil value to erase the property with this key.
NetlistReader
@brief Base class for netlist readers This class is provided as a base class for netlist readers. It is not intended for reimplementation on script level, but used internally as an interface.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Base class for netlist readers\nThis class is provided as a base class for netlist readers. It is not intended for reimplementation on script level, but used internally as an interface.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 107
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistReader' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetlistReader
@brief Creates a new object of this class
NetlistSpiceReader
Bases: klayout.dbcore.NetlistReader
@brief Implements a netlist Reader for the SPICE format. Use the SPICE reader like this:
@code reader = RBA::NetlistSpiceReader::new netlist = RBA::Netlist::new netlist.read(path, reader) @/code
The translation of SPICE elements can be tailored by providing a \NetlistSpiceReaderDelegate class. This allows translating of device parameters and mapping of some subcircuits to devices.
The following example is a delegate that turns subcircuits called HVNMOS and HVPMOS into MOS4 devices with the parameters scaled by 1.5:
@code class MyDelegate < RBA::NetlistSpiceReaderDelegate
# says we want to catch these subcircuits as devices def wants_subcircuit(name) name == "HVNMOS" || name == "HVPMOS" end
# translate the element def element(circuit, el, name, model, value, nets, params)
if el != "X"
# all other elements are left to the standard implementation
return super
end
if nets.size != 4
error("Subcircuit #{model} needs four nodes")
end
# provide a device class
cls = circuit.netlist.device_class_by_name(model)
if ! cls
cls = RBA::DeviceClassMOS4Transistor::new
cls.name = model
circuit.netlist.add(cls)
end
# create a device
device = circuit.create_device(cls, name)
# and configure the device
[ "S", "G", "D", "B" ].each_with_index do |t,index|
device.connect_terminal(t, nets[index])
end
params.each do |p,value|
device.set_parameter(p, value * 1.5)
end
end
end
usage:
mydelegate = MyDelegate::new reader = RBA::NetlistSpiceReader::new(mydelegate)
nl = RBA::Netlist::new nl.read(input_file, reader) @/code
A somewhat contrived example for using the delegate to translate net names is this:
@code class MyDelegate < RBA::NetlistSpiceReaderDelegate
# translates 'VDD' to 'VXX' and leave all other net names as is: alias translate_net_name_org translate_net_name def translate_net_name(n) return n == "VDD" ? "VXX" : translate_net_name_org(n)} end
end @/code
This class has been introduced in version 0.26. It has been extended in version 0.27.1.
__doc__
class
__doc__ = '@brief Implements a netlist Reader for the SPICE format.\nUse the SPICE reader like this:\n\n@code\nreader = RBA::NetlistSpiceReader::new\nnetlist = RBA::Netlist::new\nnetlist.read(path, reader)\n@/code\n\nThe translation of SPICE elements can be tailored by providing a \\NetlistSpiceReaderDelegate class. This allows translating of device parameters and mapping of some subcircuits to devices.\n\nThe following example is a delegate that turns subcircuits called HVNMOS and HVPMOS into MOS4 devices with the parameters scaled by 1.5:\n\n@code\nclass MyDelegate < RBA::NetlistSpiceReaderDelegate\n\n # says we want to catch these subcircuits as devices\n def wants_subcircuit(name)\n name == "HVNMOS" || name == "HVPMOS"\n end\n\n # translate the element\n def element(circuit, el, name, model, value, nets, params)\n\n if el != "X"\n # all other elements are left to the standard implementation\n return super\n end\n\n if nets.size != 4\n error("Subcircuit #{model} needs four nodes")\n end\n\n # provide a device class\n cls = circuit.netlist.device_class_by_name(model)\n if ! cls\n cls = RBA::DeviceClassMOS4Transistor::new\n cls.name = model\n circuit.netlist.add(cls)\n end\n\n # create a device\n device = circuit.create_device(cls, name)\n\n # and configure the device\n [ "S", "G", "D", "B" ].each_with_index do |t,index|\n device.connect_terminal(t, nets[index])\n end\n params.each do |p,value|\n device.set_parameter(p, value * 1.5)\n end\n\n end\n\nend\n\n# usage:\n\nmydelegate = MyDelegate::new\nreader = RBA::NetlistSpiceReader::new(mydelegate)\n\nnl = RBA::Netlist::new\nnl.read(input_file, reader)\n@/code\n\nA somewhat contrived example for using the delegate to translate net names is this:\n\n@code\nclass MyDelegate < RBA::NetlistSpiceReaderDelegate\n\n # translates \'VDD\' to \'VXX\' and leave all other net names as is:\n alias translate_net_name_org translate_net_name\n def translate_net_name(n)\n return n == "VDD" ? "VXX" : translate_net_name_org(n)}\n end\n\nend\n@/code\n\nThis class has been introduced in version 0.26. It has been extended in version 0.27.1.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 111
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__init__
method descriptor
__init__() -> None
__init__(delegate: NetlistSpiceReaderDelegate) -> None
__init__()
@brief Creates a new reader with a delegate.
new
builtin
new() -> NetlistSpiceReader
new(delegate: NetlistSpiceReaderDelegate) -> NetlistSpiceReader
new()
@brief Creates a new reader with a delegate.
NetlistSpiceReaderDelegate
@brief Provides a delegate for the SPICE reader for translating device statements Supply a customized class to provide a specialized reading scheme for devices. You need a customized class if you want to implement device reading from model subcircuits or to translate device parameters.
See \NetlistSpiceReader for more details.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Provides a delegate for the SPICE reader for translating device statements\nSupply a customized class to provide a specialized reading scheme for devices. You need a customized class if you want to implement device reading from model subcircuits or to translate device parameters.\n\nSee \\NetlistSpiceReader for more details.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 110
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistSpiceReaderDelegate' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetlistSpiceReaderDelegate
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetlistSpiceReaderDelegate
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
apply_parameter_scaling
method descriptor
apply_parameter_scaling() -> None
@brief Applies parameter scaling to the given device Applies SI scaling (according to the parameter's si_scaling attribute) and geometry scaling (according to the parameter's geo_scale_exponent attribute) to the device parameters. Use this method of finish the device when you have created a custom device yourself.
The geometry scale is taken from the '.options scale=...' control statement.
This method has been introduced in version 0.28.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
control_statement
method descriptor
control_statement() -> bool
@hide
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetlistSpiceReaderDelegate
@brief Creates a copy of self
element
method descriptor
element() -> bool
@hide
error
method descriptor
error() -> None
@brief Issues an error with the given message. Use this method to generate an error.
finish
method descriptor
finish() -> None
@hide
get_scale
method descriptor
get_scale() -> float
@brief Gets the scale factor set with '.options scale=...' This method has been introduced in version 0.28.6.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetlistSpiceReaderDelegate
@brief Creates a new object of this class
parse_element
method descriptor
parse_element() -> ParseElementData
@hide
parse_element_components
method descriptor
parse_element_components() -> ParseElementComponentsData
@brief Parses a string into string and parameter components. This method is provided to simplify the implementation of 'parse_element'. It takes a string and splits it into string arguments and parameter values. For example, 'a b c=6' renders two string arguments in 'nn' and one parameter ('C'->6.0). It returns data \ParseElementComponentsData object with the strings and parameters. The parameter names are already translated to upper case.
The variables dictionary defines named variables with the given values.
This method has been introduced in version 0.27.1. The variables argument has been added in version 0.28.6.
start
method descriptor
start() -> None
@hide
translate_net_name
method descriptor
translate_net_name() -> str
@hide
value_from_string
method descriptor
value_from_string() -> Any
@brief Translates a string into a value This function simplifies the implementation of SPICE readers by providing a translation of a unit-annotated string into double values. For example, '1k' is translated to 1000.0. In addition, simple formula evaluation is supported, e.g '(1+3)*2' is translated into 8.0.
The variables dictionary defines named variables with the given values.
This method has been introduced in version 0.27.1. The variables argument has been added in version 0.28.6.
variables
method descriptor
variables() -> Dict[str, Any]
@brief Gets the variables defined inside the SPICE file during execution of 'parse_element' In order to evaluate formulas, this method allows accessing the variables that are present during the execution of the SPICE reader.
This method has been introduced in version 0.28.6.
wants_subcircuit
method descriptor
wants_subcircuit() -> bool
@hide
NetlistSpiceWriter
Bases: klayout.dbcore.NetlistWriter
@brief Implements a netlist writer for the SPICE format. Provide a delegate for customizing the way devices are written.
Use the SPICE writer like this:
@code writer = RBA::NetlistSpiceWriter::new netlist.write(path, writer) @/code
You can give a custom description for the headline:
@code writer = RBA::NetlistSpiceWriter::new netlist.write(path, writer, "A custom description") @/code
To customize the output, you can use a device writer delegate. The delegate is an object of a class derived from \NetlistSpiceWriterDelegate which reimplements several methods to customize the following parts:
@ul @li A global header (\NetlistSpiceWriterDelegate#write_header): this method is called to print the part right after the headline @/li @li A per-device class header (\NetlistSpiceWriterDelegate#write_device_intro): this method is called for every device class and may print device-class specific headers (e.g. model definitions) @/li @li Per-device output: this method (\NetlistSpiceWriterDelegate#write_device): this method is called for every device and may print the device statement(s) in a specific way. @/li @/ul
The delegate must use \NetlistSpiceWriterDelegate#emit_line to print a line, \NetlistSpiceWriterDelegate#emit_comment to print a comment etc. For more method see \NetlistSpiceWriterDelegate.
A sample with a delegate is this:
@code class MyDelegate < RBA::NetlistSpiceWriterDelegate
def write_header emit_line("*** My special header") end
def write_device_intro(cls) emit_comment("My intro for class " + cls.name) end
def write_device(dev) if dev.device_class.name != "MYDEVICE" emit_comment("Terminal #1: " + net_to_string(dev.net_for_terminal(0))) emit_comment("Terminal #2: " + net_to_string(dev.net_for_terminal(1))) super(dev) emit_comment("After device " + dev.expanded_name) else super(dev) end end
end
write the netlist with delegate:
writer = RBA::NetlistSpiceWriter::new(MyDelegate::new) netlist.write(path, writer) @/code
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Implements a netlist writer for the SPICE format.\nProvide a delegate for customizing the way devices are written.\n\nUse the SPICE writer like this:\n\n@code\nwriter = RBA::NetlistSpiceWriter::new\nnetlist.write(path, writer)\n@/code\n\nYou can give a custom description for the headline:\n\n@code\nwriter = RBA::NetlistSpiceWriter::new\nnetlist.write(path, writer, "A custom description")\n@/code\n\nTo customize the output, you can use a device writer delegate.\nThe delegate is an object of a class derived from \\NetlistSpiceWriterDelegate which reimplements several methods to customize the following parts:\n\n@ul\n@li A global header (\\NetlistSpiceWriterDelegate#write_header): this method is called to print the part right after the headline @/li\n@li A per-device class header (\\NetlistSpiceWriterDelegate#write_device_intro): this method is called for every device class and may print device-class specific headers (e.g. model definitions) @/li\n@li Per-device output: this method (\\NetlistSpiceWriterDelegate#write_device): this method is called for every device and may print the device statement(s) in a specific way. @/li\n@/ul\n\nThe delegate must use \\NetlistSpiceWriterDelegate#emit_line to print a line, \\NetlistSpiceWriterDelegate#emit_comment to print a comment etc.\nFor more method see \\NetlistSpiceWriterDelegate.\n\nA sample with a delegate is this:\n\n@code\nclass MyDelegate < RBA::NetlistSpiceWriterDelegate\n\n def write_header\n emit_line("*** My special header")\n end\n\n def write_device_intro(cls)\n emit_comment("My intro for class " + cls.name)\n end\n\n def write_device(dev)\n if dev.device_class.name != "MYDEVICE"\n emit_comment("Terminal #1: " + net_to_string(dev.net_for_terminal(0)))\n emit_comment("Terminal #2: " + net_to_string(dev.net_for_terminal(1)))\n super(dev)\n emit_comment("After device " + dev.expanded_name)\n else\n super(dev)\n end\n end\n\nend\n\n# write the netlist with delegate:\nwriter = RBA::NetlistSpiceWriter::new(MyDelegate::new)\nnetlist.write(path, writer)\n@/code\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 106
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
use_net_names
class
use_net_names: bool = <attribute 'use_net_names' of 'NetlistSpiceWriter' objects>
@brief Gets a value indicating whether to use net names (true) or net numbers (false).
@brief Sets a value indicating whether to use net names (true) or net numbers (false). The default is to use net numbers.
with_comments
class
with_comments: bool = <attribute 'with_comments' of 'NetlistSpiceWriter' objects>
@brief Gets a value indicating whether to embed comments for position etc. (true) or not (false).
@brief Sets a value indicating whether to embed comments for position etc. (true) or not (false). The default is to embed comments.
__copy__
method descriptor
__copy__() -> NetlistSpiceWriter
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetlistSpiceWriter
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
__init__(delegate: NetlistSpiceWriterDelegate) -> None
__init__()
@brief Creates a new writer with a delegate.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
dup
method descriptor
dup() -> NetlistSpiceWriter
@brief Creates a copy of self
new
builtin
new() -> NetlistSpiceWriter
new(delegate: NetlistSpiceWriterDelegate) -> NetlistSpiceWriter
new()
@brief Creates a new writer with a delegate.
NetlistSpiceWriterDelegate
@brief Provides a delegate for the SPICE writer for doing special formatting for devices Supply a customized class to provide a specialized writing scheme for devices. You need a customized class if you want to implement special devices or you want to use subcircuits rather than the built-in devices.
See \NetlistSpiceWriter for more details.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Provides a delegate for the SPICE writer for doing special formatting for devices\nSupply a customized class to provide a specialized writing scheme for devices. You need a customized class if you want to implement special devices or you want to use subcircuits rather than the built-in devices.\n\nSee \\NetlistSpiceWriter for more details.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 104
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistSpiceWriterDelegate' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> NetlistSpiceWriterDelegate
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> NetlistSpiceWriterDelegate
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> NetlistSpiceWriterDelegate
@brief Creates a copy of self
emit_comment
method descriptor
emit_comment() -> None
@brief Writes the given comment into the file
emit_line
method descriptor
emit_line() -> None
@brief Writes the given line into the file
format_name
method descriptor
format_name() -> str
@brief Formats the given name in a SPICE-compatible way
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
net_to_string
method descriptor
net_to_string() -> str
@brief Gets the node ID for the given net The node ID is a numeric string instead of the full name of the net. Numeric IDs are used within SPICE netlist because they are usually shorter.
new
builtin
new() -> NetlistSpiceWriterDelegate
@brief Creates a new object of this class
write_device
method descriptor
write_device() -> None
@hide
write_device_intro
method descriptor
write_device_intro() -> None
@hide
write_header
method descriptor
write_header() -> None
@hide
NetlistWriter
@brief Base class for netlist writers This class is provided as a base class for netlist writers. It is not intended for reimplementation on script level, but used internally as an interface.
This class has been introduced in version 0.26.
__doc__
class
__doc__ = '@brief Base class for netlist writers\nThis class is provided as a base class for netlist writers. It is not intended for reimplementation on script level, but used internally as an interface.\n\nThis class has been introduced in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 105
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'NetlistWriter' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> NetlistWriter
@brief Creates a new object of this class
PCellDeclaration
Bases: klayout.dbcore.PCellDeclaration_Native
@brief A PCell declaration providing the parameters and code to produce the PCell
A PCell declaration is basically the recipe of how to create a PCell layout from a parameter set. The declaration includes
@ul @li Parameters: names, types, default values @/li @li Layers: the layers the PCell wants to create @/li @li Code: a production callback that is called whenever a PCell is instantiated with a certain parameter set @/li @li Display name: the name that is shown for a given PCell instance @/li @/ul
All these declarations are implemented by deriving from the PCellDeclaration class and reimplementing the specific methods. Reimplementing the \display_name method is optional. The default implementation creates a name from the PCell name plus the parameters.
By supplying the information about the layers it wants to create, KLayout is able to call the production callback with a defined set of the layer ID's which are already mapped to valid actual layout layers.
This class has been introduced in version 0.22.
__doc__
class
__doc__ = "@brief A PCell declaration providing the parameters and code to produce the PCell\n\nA PCell declaration is basically the recipe of how to create a PCell layout from\na parameter set. The declaration includes\n\n@ul\n@li Parameters: names, types, default values @/li\n@li Layers: the layers the PCell wants to create @/li\n@li Code: a production callback that is called whenever a PCell is instantiated with a certain parameter set @/li\n@li Display name: the name that is shown for a given PCell instance @/li\n@/ul\n\nAll these declarations are implemented by deriving from the PCellDeclaration class\nand reimplementing the specific methods. Reimplementing the \\display_name method is \noptional. The default implementation creates a name from the PCell name plus the \nparameters.\n\nBy supplying the information about the layers it wants to create, KLayout is able to\ncall the production callback with a defined set of the layer ID's which are already\nmapped to valid actual layout layers.\n\nThis class has been introduced in version 0.22.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 75
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
callback
method descriptor
callback() -> None
@hide
can_create_from_shape
method descriptor
can_create_from_shape() -> bool
@hide
display_text
method descriptor
display_text() -> str
@hide
get_parameters
method descriptor
get_parameters() -> List[PCellParameterDeclaration]
@hide
parameters_from_shape
method descriptor
parameters_from_shape() -> List[Any]
@hide
produce
method descriptor
produce() -> None
@hide
transformation_from_shape
method descriptor
transformation_from_shape() -> Trans
@hide
wants_lazy_evaluation
method descriptor
wants_lazy_evaluation() -> bool
@hide
PCellDeclaration_Native
@hide @alias PCellDeclaration
__doc__
class
__doc__ = '@hide\n@alias PCellDeclaration\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 71
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PCellDeclaration_Native' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> PCellDeclaration_Native
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PCellDeclaration_Native
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
callback
method descriptor
callback() -> None
can_create_from_shape
method descriptor
can_create_from_shape() -> bool
coerce_parameters
method descriptor
coerce_parameters() -> List[Any]
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
display_text
method descriptor
display_text() -> str
dup
method descriptor
dup() -> PCellDeclaration_Native
@brief Creates a copy of self
get_layers
method descriptor
get_layers() -> List[LayerInfo]
get_parameters
method descriptor
get_parameters() -> List[PCellParameterDeclaration]
id
method descriptor
id() -> int
@brief Gets the integer ID of the PCell declaration This ID is used to identify the PCell in the context of a Layout object for example
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layout
method descriptor
layout() -> Layout
@brief Gets the Layout object the PCell is registered in or nil if it is not registered yet. This attribute has been added in version 0.27.5.
name
method descriptor
name() -> str
@brief Gets the name of the PCell
new
builtin
new() -> PCellDeclaration_Native
@brief Creates a new object of this class
parameters_from_shape
method descriptor
parameters_from_shape() -> List[Any]
produce
method descriptor
produce() -> None
transformation_from_shape
method descriptor
transformation_from_shape() -> Trans
wants_lazy_evaluation
method descriptor
wants_lazy_evaluation() -> bool
PCellParameterDeclaration
@brief A PCell parameter declaration
This class declares a PCell parameter by providing a name, the type and a value and additional information like description, unit string and default value. It is used in the \PCellDeclaration class to deliver the necessary information.
This class has been introduced in version 0.22.
TypeBoolean
class
TypeBoolean: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeCallback
class
TypeCallback: int = 7
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeDouble
class
TypeDouble: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeInt
class
TypeInt: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeLayer
class
TypeLayer: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeList
class
TypeList: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeNone
class
TypeNone: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeShape
class
TypeShape: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TypeString
class
TypeString: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A PCell parameter declaration\n\nThis class declares a PCell parameter by providing a name, the type and a value \nand additional \ninformation like description, unit string and default value. It is used in the \\PCellDeclaration class to \ndeliver the necessary information.\n\nThis class has been introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 76
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PCellParameterDeclaration' objects>
list of weak references to the object
default
class
default: Any = <attribute 'default' of 'PCellParameterDeclaration' objects>
@brief Gets the default value
@brief Sets the default value If a default value is defined, it will be used to initialize the parameter value when a PCell is created.
description
class
description: str = <attribute 'description' of 'PCellParameterDeclaration' objects>
@brief Gets the description text
@brief Sets the description
hidden
class
hidden: bool = <attribute 'hidden' of 'PCellParameterDeclaration' objects>
@brief Returns true, if the parameter is a hidden parameter that should not be shown in the user interface By making a parameter hidden, it is possible to create internal parameters which cannot be edited.
@brief Makes the parameter hidden if this attribute is set to true
max_value
class
max_value: Any = <attribute 'max_value' of 'PCellParameterDeclaration' objects>
@brief Gets the maximum value allowed See \max_value= for a description of this attribute.
This attribute has been added in version 0.29.
@brief Sets the maximum value allowed The maximum value is a visual feature and limits the allowed values for numerical entry boxes. This applies to parameters of type int or double. The maximum value is not effective if choices are present.
The maximum value is not enforced - for example there is no restriction implemented when setting values programmatically.
Setting this attribute to "nil" (the default) implies "no limit".
This attribute has been added in version 0.29.
min_value
class
min_value: Any = <attribute 'min_value' of 'PCellParameterDeclaration' objects>
@brief Gets the minimum value allowed See \min_value= for a description of this attribute.
This attribute has been added in version 0.29.
@brief Sets the minimum value allowed The minimum value is a visual feature and limits the allowed values for numerical entry boxes. This applies to parameters of type int or double. The minimum value is not effective if choices are present.
The minimum value is not enforced - for example there is no restriction implemented when setting values programmatically.
Setting this attribute to "nil" (the default) implies "no limit".
This attribute has been added in version 0.29.
name
class
name: str = <attribute 'name' of 'PCellParameterDeclaration' objects>
@brief Gets the name
@brief Sets the name
readonly
class
readonly: bool = <attribute 'readonly' of 'PCellParameterDeclaration' objects>
@brief Returns true, if the parameter is a read-only parameter By making a parameter read-only, it is shown but cannot be edited.
@brief Makes the parameter read-only if this attribute is set to true
tooltip
class
tooltip: str = <attribute 'tooltip' of 'PCellParameterDeclaration' objects>
@brief Gets the tool tip text This attribute has been introduced in version 0.29.3.
@brief Sets the tool tip text This attribute has been introduced in version 0.29.3.
type
class
type: int = <attribute 'type' of 'PCellParameterDeclaration' objects>
@brief Gets the type The type is one of the T... constants.
@brief Sets the type
unit
class
unit: str = <attribute 'unit' of 'PCellParameterDeclaration' objects>
@brief Gets the unit string
@brief Sets the unit string The unit string is shown right to the edit fields for numeric parameters.
__copy__
method descriptor
__copy__() -> PCellParameterDeclaration
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PCellParameterDeclaration
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Create a new parameter declaration with the given name, type, default value and unit string @param name The parameter name @param type One of the Type... constants describing the type of the parameter @param description The description text @param default The default (initial) value @param unit The unit string
add_choice
method descriptor
add_choice() -> None
@brief Add a new value to the list of choices This method will add the given value with the given description to the list of choices. If choices are defined, KLayout will show a drop-down box instead of an entry field in the parameter user interface.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
choice_descriptions
method descriptor
choice_descriptions() -> List[str]
@brief Returns a list of choice descriptions
choice_values
method descriptor
choice_values() -> List[Any]
@brief Returns a list of choice values
clear_choices
method descriptor
clear_choices() -> None
@brief Clears the list of choices
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> PCellParameterDeclaration
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> PCellParameterDeclaration
@brief Create a new parameter declaration with the given name, type, default value and unit string @param name The parameter name @param type One of the Type... constants describing the type of the parameter @param description The description text @param default The default (initial) value @param unit The unit string
PCellParameterState
@brief Provides access to the attributes of a single parameter within \PCellParameterStates.
See \PCellParameterStates for details about this feature.
This class has been introduced in version 0.28.
ErrorIcon
class
ErrorIcon: ParameterStateIcon = ErrorIcon (2)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
InfoIcon
class
InfoIcon: ParameterStateIcon = InfoIcon (1)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
NoIcon
class
NoIcon: ParameterStateIcon = NoIcon (0)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
WarningIcon
class
WarningIcon: ParameterStateIcon = WarningIcon (3)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
__doc__
class
__doc__ = '@brief Provides access to the attributes of a single parameter within \\PCellParameterStates.\n\nSee \\PCellParameterStates for details about this feature.\n\nThis class has been introduced in version 0.28.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 72
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PCellParameterState' objects>
list of weak references to the object
enabled
class
enabled: bool = <attribute 'enabled' of 'PCellParameterState' objects>
@brief Gets a value indicating whether the parameter is enabled in the parameter form
@brief Sets a value indicating whether the parameter is enabled in the parameter form
icon
class
icon: ParameterStateIcon = <attribute 'icon' of 'PCellParameterState' objects>
@brief Gets the icon for the parameter
@brief Sets the icon for the parameter
readonly
class
readonly: bool = <attribute 'readonly' of 'PCellParameterState' objects>
@brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form
@brief Sets a value indicating whether the parameter is made read-only (not editable) in the parameter form
tooltip
class
tooltip: str = <attribute 'tooltip' of 'PCellParameterState' objects>
@brief Gets the tool tip text
@brief Sets the tool tip text
The tool tip is shown when hovering over the parameter label or edit field.
value
class
value: Any = <attribute 'value' of 'PCellParameterState' objects>
@brief Gets the value of the parameter
@brief Sets the value of the parameter
visible
class
visible: bool = <attribute 'visible' of 'PCellParameterState' objects>
@brief Gets a value indicating whether the parameter is visible in the parameter form
@brief Sets a value indicating whether the parameter is visible in the parameter form
ParameterStateIcon
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
ErrorIcon
class
ErrorIcon: ParameterStateIcon = ErrorIcon (2)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
InfoIcon
class
InfoIcon: ParameterStateIcon = InfoIcon (1)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
NoIcon
class
NoIcon: ParameterStateIcon = NoIcon (0)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
WarningIcon
class
WarningIcon: ParameterStateIcon = WarningIcon (3)
@brief This enum specifies the icon shown next to the parameter in PCell parameter list.
This enum was introduced in version 0.28.
__doc__
class
__doc__ = '@brief This enum specifies the icon shown next to the parameter in PCell parameter list.\n\nThis enum was introduced in version 0.28.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 73
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ParameterStateIcon' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: PCellParameterState.ParameterStateIcon) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> PCellParameterState.ParameterStateIcon
new(s: str) -> PCellParameterState.ParameterStateIcon
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__copy__
method descriptor
__copy__() -> PCellParameterState
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PCellParameterState
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> PCellParameterState
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_enabled
method descriptor
is_enabled() -> bool
@brief Gets a value indicating whether the parameter is enabled in the parameter form
is_readonly
method descriptor
is_readonly() -> bool
@brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form
is_visible
method descriptor
is_visible() -> bool
@brief Gets a value indicating whether the parameter is visible in the parameter form
new
builtin
new() -> PCellParameterState
@brief Creates a new object of this class
PCellParameterStates
@brief Provides access to the parameter states inside a 'callback' implementation of a PCell
Example: enables or disables a parameter 'n' based on the value:
@code n_param = states.parameter("n") n_param.enabled = n_param.value > 1.0 @/code
This class has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief Provides access to the parameter states inside a \'callback\' implementation of a PCell\n\nExample: enables or disables a parameter \'n\' based on the value:\n\n@code\nn_param = states.parameter("n")\nn_param.enabled = n_param.value > 1.0\n@/code\n\nThis class has been introduced in version 0.28.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 74
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PCellParameterStates' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> PCellParameterStates
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PCellParameterStates
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> PCellParameterStates
@brief Creates a copy of self
has_parameter
method descriptor
has_parameter() -> bool
@brief Gets a value indicating whether a parameter with that name exists
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> PCellParameterStates
@brief Creates a new object of this class
parameter
method descriptor
parameter() -> PCellParameterState
@brief Gets the parameter by name
This will return a \PCellParameterState object that can be used to manipulate the parameter state.
ParentInstArray
@brief A parent instance
A parent instance is basically an inverse instance: instead of pointing to the child cell, it is pointing to the parent cell and the transformation is representing the shift of the parent cell relative to the child cell. For memory performance, a parent instance is not stored as a instance but rather as a reference to a child instance and a reference to the cell which is the parent. The parent instance itself is computed on the fly. It is representative for a set of instances belonging to the same cell index. The special parent instance iterator takes care of producing the right sequence (\Cell#each_parent_inst).
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A parent instance\n\nA parent instance is basically an inverse instance: instead of pointing\nto the child cell, it is pointing to the parent cell and the transformation\nis representing the shift of the parent cell relative to the child cell.\nFor memory performance, a parent instance is not stored as a instance but\nrather as a reference to a child instance and a reference to the cell which\nis the parent.\nThe parent instance itself is computed on the fly. It is representative for\na set of instances belonging to the same cell index. The special parent instance\niterator takes care of producing the right sequence (\\Cell#each_parent_inst).\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 31
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ParentInstArray' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> ParentInstArray
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ParentInstArray
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
child_inst
method descriptor
child_inst() -> Instance
@brief Retrieve the child instance associated with this parent instance
Starting with version 0.15, this method returns an \Instance object rather than a \CellInstArray reference.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dinst
method descriptor
dinst() -> DCellInstArray
@brief Compute the inverse instance by which the parent is seen from the child in micrometer units
This convenience method has been introduced in version 0.28.
dup
method descriptor
dup() -> ParentInstArray
@brief Creates a copy of self
inst
method descriptor
inst() -> CellInstArray
@brief Compute the inverse instance by which the parent is seen from the child
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> ParentInstArray
@brief Creates a new object of this class
parent_cell_index
method descriptor
parent_cell_index() -> int
@brief Gets the index of the parent cell
ParseElementComponentsData
@brief Supplies the return value for \NetlistSpiceReaderDelegate#parse_element_components. This is a structure with two members: 'strings' for the string arguments and 'parameters' for the named arguments.
This helper class has been introduced in version 0.27.1. Starting with version 0.28.6, named parameters can be string types too.
__doc__
class
__doc__ = "@brief Supplies the return value for \\NetlistSpiceReaderDelegate#parse_element_components.\nThis is a structure with two members: 'strings' for the string arguments and 'parameters' for the named arguments.\n\nThis helper class has been introduced in version 0.27.1. Starting with version 0.28.6, named parameters can be string types too.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 108
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ParseElementComponentsData' objects>
list of weak references to the object
parameters
class
parameters: Dict[str, Any] = <attribute 'parameters' of 'ParseElementComponentsData' objects>
@brief Gets the (named) parameters Named parameters are typically (but not neccessarily) numerical, like 'w=0.15u'.
@brief Sets the (named) parameters
strings
class
strings: List[str] = <attribute 'strings' of 'ParseElementComponentsData' objects>
@brief Gets the (unnamed) string parameters These parameters are typically net names or model name.
@brief Sets the (unnamed) string parameters
__copy__
method descriptor
__copy__() -> ParseElementComponentsData
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ParseElementComponentsData
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ParseElementComponentsData
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> ParseElementComponentsData
@brief Creates a new object of this class
ParseElementData
@brief Supplies the return value for \NetlistSpiceReaderDelegate#parse_element. This is a structure with four members: 'model_name' for the model name, 'value' for the default numerical value, 'net_names' for the net names and 'parameters' for the named parameters.
This helper class has been introduced in version 0.27.1. Starting with version 0.28.6, named parameters can be string types too.
__doc__
class
__doc__ = "@brief Supplies the return value for \\NetlistSpiceReaderDelegate#parse_element.\nThis is a structure with four members: 'model_name' for the model name, 'value' for the default numerical value, 'net_names' for the net names and 'parameters' for the named parameters.\n\nThis helper class has been introduced in version 0.27.1. Starting with version 0.28.6, named parameters can be string types too.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 109
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ParseElementData' objects>
list of weak references to the object
model_name
class
model_name: str = <attribute 'model_name' of 'ParseElementData' objects>
@brief Gets the model name
@brief Sets the model name
net_names
class
net_names: List[str] = <attribute 'net_names' of 'ParseElementData' objects>
@brief Gets the net names
@brief Sets the net names
parameters
class
parameters: Dict[str, Any] = <attribute 'parameters' of 'ParseElementData' objects>
@brief Gets the (named) parameters
@brief Sets the (named) parameters
value
class
value: float = <attribute 'value' of 'ParseElementData' objects>
@brief Gets the value
@brief Sets the value
__copy__
method descriptor
__copy__() -> ParseElementData
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ParseElementData
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ParseElementData
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> ParseElementData
@brief Creates a new object of this class
Path
@brief A path class
A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension').
A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A path class\n\nA path consists of an sequence of line segments forming the \'spine\' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the \'begin extension\') and the end point can be pulled forward somewhat (by the \'end extension\').\n\nA path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 148
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Path' objects>
list of weak references to the object
bgn_ext
class
bgn_ext: int = <attribute 'bgn_ext' of 'Path' objects>
@brief Get the begin extension
@brief Set the begin extension
end_ext
class
end_ext: int = <attribute 'end_ext' of 'Path' objects>
@brief Get the end extension
@brief Set the end extension
points
class
points: int = <attribute 'points' of 'Path' objects>
@brief Get the number of points
@brief Set the points of the path @param p An array of points to assign to the path's spine
round
class
round: bool = <attribute 'round' of 'Path' objects>
@brief Returns true, if the path has round ends
@brief Set the 'round ends' flag A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise.
width
class
width: int = <attribute 'width' of 'Path' objects>
@brief Get the width
@brief Set the width
__copy__
method descriptor
__copy__() -> Path
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Path
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test @param p The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(dpath: DPath) -> None
__init__(pts: Sequence[Point], width: int) -> None
__init__(pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> None
__init__(pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None
__init__()
@brief Constructor given the points of the path's spine, the width, the extensions and the round end flag
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path @param round If this flag is true, the path will get rounded ends
__lt__
method descriptor
__lt__() -> bool
@brief Less operator @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
__mul__
method descriptor
__mul__() -> Path
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test @param p The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Convert to a string
__rmul__
method descriptor
__rmul__() -> Path
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief Convert to a string
area
method descriptor
area() -> int
@brief Returns the approximate area of the path This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. This method was added in version 0.22.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Returns the bounding box of the path
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Path
@brief Creates a copy of self
each_point
method descriptor
each_point() -> Iterator[Point]
@brief Get the points that make up the path's spine
from_dpath
builtin
from_dpath() -> Path
@brief Creates an integer coordinate path from a floating-point coordinate path
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'.
from_s
builtin
from_s() -> Path
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_round
method descriptor
is_round() -> bool
@brief Returns true, if the path has round ends
length
method descriptor
length() -> int
@brief Returns the length of the path the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends.
This method was added in version 0.23.
move
method descriptor
move(dx: int, dy: int) -> Path
move(p: Vector) -> Path
move()
@brief Moves the path.
Moves the path by the given offset and returns the moved path. The path is overwritten.
@param dx The x distance to move the path. @param dy The y distance to move the path.
@return The moved path.
This version has been added in version 0.23.
moved
method descriptor
moved(dx: int, dy: int) -> Path
moved(p: Vector) -> Path
moved()
@brief Returns the moved path (does not change self)
Moves the path by the given offset and returns the moved path. The path is not modified.
@param dx The x distance to move the path. @param dy The y distance to move the path.
@return The moved path.
This version has been added in version 0.23.
new
builtin
new() -> Path
new(dpath: DPath) -> Path
new(pts: Sequence[Point], width: int) -> Path
new(pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path
new(pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path
new()
@brief Constructor given the points of the path's spine, the width, the extensions and the round end flag
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path @param round If this flag is true, the path will get rounded ends
new_pw
builtin
new_pw() -> Path
@brief Constructor given the points of the path's spine and the width
@param pts The points forming the spine of the path @param width The width of the path
new_pwx
builtin
new_pwx() -> Path
@brief Constructor given the points of the path's spine, the width and the extensions
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path
new_pwxr
builtin
new_pwxr() -> Path
@brief Constructor given the points of the path's spine, the width, the extensions and the round end flag
@param pts The points forming the spine of the path @param width The width of the path @param bgn_ext The begin extension of the path @param end_ext The end extension of the path @param round If this flag is true, the path will get rounded ends
num_points
method descriptor
num_points() -> int
@brief Get the number of points
perimeter
method descriptor
perimeter() -> int
@brief Returns the approximate perimeter of the path This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. This method was added in version 0.24.4.
polygon
method descriptor
polygon() -> Polygon
@brief Convert the path to a polygon The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments.
round_corners
method descriptor
round_corners() -> Path
@brief Creates a new path whose corners are interpolated with circular bends
@param radius The radius of the bends @param npoints The number of points (per full circle) used for interpolating the bends
This method has been introduced in version 0.25.
simple_polygon
method descriptor
simple_polygon() -> SimplePolygon
@brief Convert the path to a simple polygon The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments.
to_dtype
method descriptor
to_dtype() -> DPath
@brief Converts the path to a floating-point coordinate path
The database unit can be specified to translate the integer-coordinate path into a floating-point coordinate path in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Convert to a string
transformed
method descriptor
transformed(t: CplxTrans) -> DPath
transformed(t: ICplxTrans) -> Path
transformed(t: Trans) -> Path
transformed()
@brief Transform the path.
Transforms the path with the given complex transformation. Does not modify the path but returns the transformed path.
@param t The transformation to apply.
@return The transformed path.
transformed_cplx
method descriptor
transformed_cplx() -> DPath
@brief Transform the path.
Transforms the path with the given complex transformation. Does not modify the path but returns the transformed path.
@param t The transformation to apply.
@return The transformed path.
Pin
Bases: klayout.dbcore.NetlistObject
@brief A pin of a circuit. Pin objects are used to describe the outgoing pins of a circuit. To create a new pin of a circuit, use \Circuit#create_pin.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A pin of a circuit.\nPin objects are used to describe the outgoing pins of a circuit. To create a new pin of a circuit, use \\Circuit#create_pin.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 86
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
expanded_name
method descriptor
expanded_name() -> str
@brief Gets the expanded name of the pin. The expanded name is the name or a generic identifier made from the ID if the name is empty.
id
method descriptor
id() -> int
@brief Gets the ID of the pin.
name
method descriptor
name() -> str
@brief Gets the name of the pin.
Point
@brief An integer point class Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief An integer point class\nPoints represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 151
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Point' objects>
list of weak references to the object
x
class
x: int = <attribute 'x' of 'Point' objects>
@brief Accessor to the x coordinate
@brief Write accessor to the x coordinate
y
class
y: int = <attribute 'y' of 'Point' objects>
@brief Accessor to the y coordinate
@brief Write accessor to the y coordinate
__add__
method descriptor
__add__() -> Point
@brief Adds a vector to a point
Adds vector v to self by adding the coordinates.
Starting with version 0.25, this method expects a vector argument.
__copy__
method descriptor
__copy__() -> Point
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Point
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test operator
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given point. This method enables points as hash keys.
This method has been introduced in version 0.25.
__imul__
method descriptor
__imul__() -> Point
@brief Scaling by some factor
Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded.
__init__
method descriptor
__init__() -> None
__init__(dpoint: DPoint) -> None
__init__(v: Vector) -> None
__init__(x: int, y: int) -> None
__init__()
@brief Constructor for a point from two coordinate values
__itruediv__
method descriptor
__itruediv__() -> Point
@brief Division by some divisor
Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded.
__lt__
method descriptor
__lt__() -> bool
@brief "less" comparison operator
This operator is provided to establish a sorting order
__mul__
method descriptor
__mul__() -> Point
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test operator
__neg__
method descriptor
__neg__() -> Point
@brief Compute the negative of a point
Returns a new point with -x, -y.
This method has been added in version 0.23.
__repr__
method descriptor
__repr__() -> str
@brief String conversion. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__() -> Point
@brief Scaling by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief String conversion. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__sub__
method descriptor
__sub__(p: Point) -> Vector
__sub__(v: Vector) -> Point
__sub__()
@brief Subtract one vector from a point
Subtract vector v from from self by subtracting the coordinates. This renders a point.
This method has been added in version 0.27.
__truediv__
method descriptor
__truediv__() -> Point
@brief Division by some divisor
Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded.
abs
method descriptor
abs() -> float
@brief The absolute value of the point (Euclidian distance to 0,0)
The returned value is 'sqrt(xx+yy)'.
This method has been introduced in version 0.23.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
distance
method descriptor
distance() -> float
@brief The Euclidian distance to another point
@param d The other point to compute the distance to.
dup
method descriptor
dup() -> Point
@brief Creates a copy of self
from_dpoint
builtin
from_dpoint() -> Point
@brief Creates an integer coordinate point from a floating-point coordinate point
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'.
from_s
builtin
from_s() -> Point
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given point. This method enables points as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Point
new(dpoint: DPoint) -> Point
new(v: Vector) -> Point
new(x: int, y: int) -> Point
new()
@brief Constructor for a point from two coordinate values
sq_abs
method descriptor
sq_abs() -> float
@brief The square of the absolute value of the point (Euclidian distance to 0,0)
The returned value is 'xx+yy'.
This method has been introduced in version 0.23.
sq_distance
method descriptor
sq_distance() -> float
@brief The square Euclidian distance to another point
@param d The other point to compute the distance to.
to_dtype
method descriptor
to_dtype() -> DPoint
@brief Converts the point to a floating-point coordinate point
The database unit can be specified to translate the integer-coordinate point into a floating-point coordinate point in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief String conversion. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
to_v
method descriptor
to_v() -> Vector
@brief Turns the point into a vector This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25.
Polygon
@brief A polygon class
A polygon consists of an outer hull and zero to many holes. Each contour consists of several points. The point list is normalized such that the leftmost, lowest point is the first one. The orientation is normalized such that the orientation of the hull contour is clockwise, while the orientation of the holes is counterclockwise.
It is in no way checked that the contours are not overlapping. This must be ensured by the user of the object when filling the contours.
A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon.
Here's an example of how to create a polygon:
@code hull = [ RBA::Point::new(0, 0), RBA::Point::new(6000, 0), RBA::Point::new(6000, 3000), RBA::Point::new(0, 3000) ] hole1 = [ RBA::Point::new(1000, 1000), RBA::Point::new(2000, 1000), RBA::Point::new(2000, 2000), RBA::Point::new(1000, 2000) ] hole2 = [ RBA::Point::new(3000, 1000), RBA::Point::new(4000, 1000), RBA::Point::new(4000, 2000), RBA::Point::new(3000, 2000) ] poly = RBA::Polygon::new(hull) poly.insert_hole(hole1) poly.insert_hole(hole2)
ask the polygon for some properties
poly.holes # -> 2 poly.area # -> 16000000 poly.perimeter # -> 26000 poly.bbox # -> (0,0;6000,3000) @/code
The \Polygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DPolygon.
See @The Database API@ for more details about the database objects.
PO_any
class
PO_any: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PO_horizontal
class
PO_horizontal: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PO_htrapezoids
class
PO_htrapezoids: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PO_vertical
class
PO_vertical: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PO_vtrapezoids
class
PO_vtrapezoids: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TD_htrapezoids
class
TD_htrapezoids: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TD_simple
class
TD_simple: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TD_vtrapezoids
class
TD_vtrapezoids: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A polygon class\n\nA polygon consists of an outer hull and zero to many\nholes. Each contour consists of several points. The point\nlist is normalized such that the leftmost, lowest point is \nthe first one. The orientation is normalized such that\nthe orientation of the hull contour is clockwise, while\nthe orientation of the holes is counterclockwise.\n\nIt is in no way checked that the contours are not overlapping.\nThis must be ensured by the user of the object\nwhen filling the contours.\n\nA polygon can be asked for the number of holes using the \\holes method. \\each_point_hull delivers the points of the hull contour. \\each_point_hole delivers the points of a specific hole. \\each_edge delivers the edges (point-to-point connections) of both hull and holes. \\bbox delivers the bounding box, \\area the area and \\perimeter the perimeter of the polygon.\n\nHere\'s an example of how to create a polygon:\n\n@code\nhull = [ RBA::Point::new(0, 0), RBA::Point::new(6000, 0), \n RBA::Point::new(6000, 3000), RBA::Point::new(0, 3000) ]\nhole1 = [ RBA::Point::new(1000, 1000), RBA::Point::new(2000, 1000), \n RBA::Point::new(2000, 2000), RBA::Point::new(1000, 2000) ]\nhole2 = [ RBA::Point::new(3000, 1000), RBA::Point::new(4000, 1000), \n RBA::Point::new(4000, 2000), RBA::Point::new(3000, 2000) ]\npoly = RBA::Polygon::new(hull)\npoly.insert_hole(hole1)\npoly.insert_hole(hole2)\n\n# ask the polygon for some properties\npoly.holes # -> 2\npoly.area # -> 16000000\npoly.perimeter # -> 26000\npoly.bbox # -> (0,0;6000,3000)\n@/code\n\nThe \\Polygon class stores coordinates in integer format. A class that stores floating-point coordinates is \\DPolygon.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 154
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Polygon' objects>
list of weak references to the object
hull
class
hull: None = <attribute 'hull' of 'Polygon' objects>
@brief Sets the points of the hull of polygon @param p An array of points to assign to the polygon's hull The 'assign_hull' variant is provided in analogy to 'assign_hole'.
__copy__
method descriptor
__copy__() -> Polygon
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Polygon
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns a value indicating whether the polygons are equal @param p The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(box: Box) -> None
__init__(dpolygon: DPolygon) -> None
__init__(pts: Sequence[Point], raw: Optional[bool] = ...) -> None
__init__(sp: SimplePolygon) -> None
__init__()
@brief Creates a polygon from a box
@param box The box to convert to a polygon
__lt__
method descriptor
__lt__() -> bool
@brief Returns a value indicating whether self is less than p @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
__mul__
method descriptor
__mul__() -> Polygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Returns a value indicating whether the polygons are not equal @param p The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the polygon
__rmul__
method descriptor
__rmul__() -> Polygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the polygon
area
method descriptor
area() -> int
@brief Gets the area of the polygon The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases.
area2
method descriptor
area2() -> int
@brief Gets the double area of the polygon This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types.
This method has been introduced in version 0.26.1
area_upper_manhattan_bound
method descriptor
area_upper_manhattan_bound() -> int
@hide
area_upper_manhattan_bound2
method descriptor
area_upper_manhattan_bound2() -> int
@hide
assign
method descriptor
assign() -> None
@brief Assigns another object to self
assign_hole
method descriptor
assign_hole(n: int, b: Box) -> None
assign_hole(n: int, p: Sequence[Point], raw: Optional[bool] = ...) -> None
assign_hole()
@brief Sets the box as the given hole of the polygon @param n The index of the hole to which the points should be assigned @param b The box to assign to the polygon's hole If the hole index is not valid, this method does nothing. This method was introduced in version 0.23.
assign_hull
method descriptor
assign_hull() -> None
@brief Sets the points of the hull of polygon @param p An array of points to assign to the polygon's hull @param raw If true, the points won't be compressed
If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications.
Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always.
The 'assign_hull' variant is provided in analogy to 'assign_hole'.
The 'raw' argument was added in version 0.24.
bbox
method descriptor
bbox() -> Box
@brief Returns the bounding box of the polygon The bounding box is the box enclosing all points of the polygon.
break_
method descriptor
break_() -> List[Polygon]
@brief Splits the polygon into parts with a maximum vertex count and area ratio The area ratio is the ratio between the bounding box area and the polygon area. Higher values mean more 'skinny' polygons.
This method will split the input polygon into pieces having a maximum of 'max_vertex_count' vertices and an area ratio less than 'max_area_ratio'. 'max_vertex_count' can be zero. In this case the limit is ignored. Also 'max_area_ratio' can be zero, in which case it is ignored as well.
The method of splitting is unspecified. The algorithm will apply 'split' recursively until the parts satisfy the limits.
This method has been introduced in version 0.29.
compress
method descriptor
compress() -> None
@brief Compresses the polygon.
This method removes redundant points from the polygon, such as points being on a line formed by two other points. If remove_reflected is true, points are also removed if the two adjacent edges form a spike.
@param remove_reflected See description of the functionality.
This method was introduced in version 0.18.
create
method descriptor
create() -> None
@brief 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.
decompose_convex
method descriptor
decompose_convex() -> List[SimplePolygon]
@brief Decomposes the polygon into convex pieces
This method returns a decomposition of the polygon that contains convex pieces only. If the polygon was convex already, the list returned has a single element which is the original polygon.
@param preferred_orientation One of the PO_... constants
This method was introduced in version 0.25.
decompose_trapezoids
method descriptor
decompose_trapezoids() -> List[SimplePolygon]
@brief Decomposes the polygon into trapezoids
This method returns a decomposition of the polygon into trapezoid pieces. It supports different modes for various applications. See the TD_... constants for details.
@param mode One of the TD_... constants
This method was introduced in version 0.25.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Polygon
@brief Creates a copy of self
each_edge
method descriptor
each_edge() -> Iterator[Edge]
each_edge(contour: int) -> Iterator[Edge]
each_edge()
@brief Iterates over the edges of one contour of the polygon
@param contour The contour number (0 for hull, 1 for first hole ...)
This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. Hole edges are oriented counterclockwise while hull edges are oriented clockwise.
This method was introduced in version 0.24.
each_point_hole
method descriptor
each_point_hole() -> Iterator[Point]
@brief Iterates over the points that make up the nth hole The hole number must be less than the number of holes (see \holes)
each_point_hull
method descriptor
each_point_hull() -> Iterator[Point]
@brief Iterates over the points that make up the hull
ellipse
builtin
ellipse() -> Polygon
@brief Creates a simple polygon approximating an ellipse
@param box The bounding box of the ellipse @param n The number of points that will be used to approximate the ellipse
This method has been introduced in version 0.23.
extract_rad
method descriptor
extract_rad() -> List[Any]
@brief Extracts the corner radii from a rounded polygon
Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul @li The polygon with the rounded corners replaced by edgy ones @/li @li The radius of the inner corners @/li @li The radius of the outer corners @/li @li The number of points per full circle @/li @/ul
This method is based on some assumptions and may fail. In this case, an empty array is returned.
If successful, the following code will more or less render the original polygon and parameters
@code p = ... # some polygon p.round_corners(ri, ro, n) (p2, ri2, ro2, n2) = p.extract_rad
-> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits)
@/code
This method was introduced in version 0.25.
from_dpoly
builtin
from_dpoly() -> Polygon
@brief Creates an integer coordinate polygon from a floating-point coordinate polygon
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpolygon'.
from_s
builtin
from_s() -> Polygon
@brief Creates a polygon 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
holes
method descriptor
holes() -> int
@brief Returns the number of holes
insert_hole
method descriptor
insert_hole(b: Box) -> None
insert_hole(p: Sequence[Point], raw: Optional[bool] = ...) -> None
insert_hole()
@brief Inserts a hole from the given box @param b The box to insert as a new hole This method was introduced in version 0.23.
inside
method descriptor
inside() -> bool
@brief Tests, if the given point is inside the polygon If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise.
is_box
method descriptor
is_box() -> bool
@brief Returns true, if the polygon is a simple box.
A polygon is a box if it is identical to its bounding box.
@return True if the polygon is a box.
This method was introduced in version 0.23.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_convex
method descriptor
is_convex() -> bool
@brief Returns a value indicating whether the polygon is convex
This method will return true, if the polygon is convex.
This method was introduced in version 0.25.
is_empty
method descriptor
is_empty() -> bool
@brief Returns a value indicating whether the polygon is empty
is_halfmanhattan
method descriptor
is_halfmanhattan() -> bool
@brief Returns a value indicating whether the polygon is half-manhattan Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping.
This predicate was introduced in version 0.27.
is_rectilinear
method descriptor
is_rectilinear() -> bool
@brief Returns a value indicating whether the polygon is rectilinear
minkowski_sum
method descriptor
minkowski_sum(b: Box, resolve_holes: bool) -> Polygon
minkowski_sum(b: Polygon, resolve_holes: bool) -> Polygon
minkowski_sum(b: Sequence[Point], resolve_holes: bool) -> Polygon
minkowski_sum(e: Edge, resolve_holes: bool) -> Polygon
minkowski_sum()
@brief Computes the Minkowski sum of the polygon and a contour of points (a trace)
@param b The contour (a series of points forming the trace). @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull.
@return The new polygon representing the Minkowski sum of self and the contour.
This method was introduced in version 0.22.
minkowsky_sum
method descriptor
minkowsky_sum(b: Box, resolve_holes: bool) -> Polygon
minkowsky_sum(b: Polygon, resolve_holes: bool) -> Polygon
minkowsky_sum(b: Sequence[Point], resolve_holes: bool) -> Polygon
minkowsky_sum(e: Edge, resolve_holes: bool) -> Polygon
minkowsky_sum()
@brief Computes the Minkowski sum of the polygon and a contour of points (a trace)
@param b The contour (a series of points forming the trace). @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull.
@return The new polygon representing the Minkowski sum of self and the contour.
This method was introduced in version 0.22.
move
method descriptor
move(p: Vector) -> Polygon
move(x: int, y: int) -> Polygon
move()
@brief Moves the polygon.
Moves the polygon by the given offset and returns the moved polygon. The polygon is overwritten.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon (self).
moved
method descriptor
moved(p: Vector) -> Polygon
moved(x: int, y: int) -> Polygon
moved()
@brief Returns the moved polygon (does not modify self)
Moves the polygon by the given offset and returns the moved polygon. The polygon is not modified.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon.
This method has been introduced in version 0.23.
new
builtin
new() -> Polygon
new(box: Box) -> Polygon
new(dpolygon: DPolygon) -> Polygon
new(pts: Sequence[Point], raw: Optional[bool] = ...) -> Polygon
new(sp: SimplePolygon) -> Polygon
new()
@brief Creates a polygon from a box
@param box The box to convert to a polygon
num_points
method descriptor
num_points() -> int
@brief Gets the total number of points (hull plus holes) This method was introduced in version 0.18.
num_points_hole
method descriptor
num_points_hole() -> int
@brief Gets the number of points of the given hole The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes).
num_points_hull
method descriptor
num_points_hull() -> int
@brief Gets the number of points of the hull
perimeter
method descriptor
perimeter() -> int
@brief Gets the perimeter of the polygon The perimeter is sum of the lengths of all edges making up the polygon.
This method has been introduce in version 0.23.
point_hole
method descriptor
point_hole() -> Point
@brief Gets a specific point of a hole @param n The index of the hole to which the points should be assigned @param p The index of the point to get If the index of the point or of the hole is not valid, a default value is returned. This method was introduced in version 0.18.
point_hull
method descriptor
point_hull() -> Point
@brief Gets a specific point of the hull @param p The index of the point to get If the index of the point is not a valid index, a default value is returned. This method was introduced in version 0.18.
resolve_holes
method descriptor
resolve_holes() -> None
@brief Resolve holes by inserting cut lines and joining the holes with the hull
This method modifies the polygon. The out-of-place version is \resolved_holes. This method was introduced in version 0.22.
resolved_holes
method descriptor
resolved_holes() -> Polygon
@brief Returns a polygon without holes
@return The new polygon without holes.
This method does not modify the polygon but return a new polygon. This method was introduced in version 0.22.
round_corners
method descriptor
round_corners() -> Polygon
@brief Rounds the corners of the polygon
Replaces the corners of the polygon with circle segments.
@param rinner The circle radius of inner corners (in database units). @param router The circle radius of outer corners (in database units). @param n The number of points per full circle.
@return The new polygon.
This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types.
size
method descriptor
size(d: int, mode: Optional[int] = ...) -> None
size(dv: Vector, mode: Optional[int] = ...) -> None
size(dx: int, dy: int, mode: int) -> None
size()
@brief Sizes the polygon (biasing)
Shifts the contour outwards (d>0) or inwards (d<0). This method is equivalent to @code size(d, d, mode) @/code
See \size for a detailed description.
This method has been introduced in version 0.23.
sized
method descriptor
sized(d: int, mode: Optional[int] = ...) -> Polygon
sized(dv: Vector, mode: Optional[int] = ...) -> Polygon
sized(dx: int, dy: int, mode: int) -> Polygon
sized()
@brief Sizes the polygon (biasing) without modifying self
Shifts the contour outwards (d>0) or inwards (d<0). This method is equivalent to @code sized(d, d, mode) @/code
See \size and \sized for a detailed description.
smooth
method descriptor
smooth() -> Polygon
@brief Smooths a polygon
Remove vertices that deviate by more than the distance d from the average contour. The value d is basically the roughness which is removed.
@param d The smoothing "roughness". @param keep_hv If true, horizontal and vertical edges will be preserved always.
@return The smoothed polygon.
This method was introduced in version 0.23. The 'keep_hv' optional parameter was added in version 0.27.
sort_holes
method descriptor
sort_holes() -> None
@brief Brings the holes in a specific order This function is normalize the hole order so the comparison of two polygons does not depend on the order the holes were inserted. Polygons generated by KLayout's alorithms have their holes sorted.
This method has been introduced in version 0.28.8.
split
method descriptor
split() -> List[Polygon]
@brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes.
The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit.
This method has been introduced in version 0.25.3.
to_dtype
method descriptor
to_dtype() -> DPolygon
@brief Converts the polygon to a floating-point coordinate polygon
The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the polygon
to_simple_polygon
method descriptor
to_simple_polygon() -> SimplePolygon
@brief Converts a polygon to a simple polygon
@return The simple polygon.
If the polygon contains holes, these will be resolved. This operation requires a well-formed polygon. Reflecting edges, self-intersections and coincident points will be removed.
This method was introduced in version 0.22.
touches
method descriptor
touches(box: Box) -> bool
touches(edge: Edge) -> bool
touches(polygon: Polygon) -> bool
touches(simple_polygon: SimplePolygon) -> bool
touches()
@brief Returns true, if the polygon touches the other polygon. The polygons touch if they overlap or their contours share at least one point.
This method was introduced in version 0.25.1.
transform
method descriptor
transform(t: ICplxTrans) -> Polygon
transform(t: Trans) -> Polygon
transform()
@brief Transforms the polygon (in-place)
Transforms the polygon with the given transformation. Modifies self and returns self. An out-of-place version which does not modify self is \transformed.
@param t The transformation to apply.
This method has been introduced in version 0.24.
transformed
method descriptor
transformed(t: CplxTrans) -> DPolygon
transformed(t: ICplxTrans) -> Polygon
transformed(t: Trans) -> Polygon
transformed()
@brief Transforms the polygon with a complex transformation
Transforms the polygon with the given complex transformation. Does not modify the polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
transformed_cplx
method descriptor
transformed_cplx() -> DPolygon
@brief Transforms the polygon with a complex transformation
Transforms the polygon with the given complex transformation. Does not modify the polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
PolygonFilter
@brief A generic polygon filter adaptor
Polygon filters are an efficient way to filter polygons from a Region. To apply a filter, derive your own filter class and pass an instance to the \Region#filter or \Region#filtered method.
Conceptually, these methods take each polygon from the region and present it to the filter's 'selected' method. Based on the result of this evaluation, the polygon is kept or discarded.
The magic happens when deep mode regions are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using the filter.
You can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that filters triangles: @code class TriangleFilter < RBA::PolygonFilter
# Constructor def initialize self.is_isotropic_and_scale_invariant # the triangle nature is not dependent on the scale or orientation end
# Select only triangles def selected(polygon) return polygon.holes == 0 && polygon.num_points == 3 end
end
region = ... # some Region triangles_only = region.filtered(TriangleFilter::new) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic polygon filter adaptor\n\nPolygon filters are an efficient way to filter polygons from a Region. To apply a filter, derive your own filter class and pass an instance to the \\Region#filter or \\Region#filtered method.\n\nConceptually, these methods take each polygon from the region and present it to the filter's 'selected' method.\nBased on the result of this evaluation, the polygon is kept or discarded.\n\nThe magic happens when deep mode regions are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using the filter.\n\nYou can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that filters triangles:\n@code\nclass TriangleFilter < RBA::PolygonFilter\n\n # Constructor\n def initialize\n self.is_isotropic_and_scale_invariant # the triangle nature is not dependent on the scale or orientation\n end\n \n # Select only triangles\n def selected(polygon)\n return polygon.holes == 0 && polygon.num_points == 3\n end\n\nend\n\nregion = ... # some Region\ntriangles_only = region.filtered(TriangleFilter::new)\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 161
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PolygonFilter' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'PolygonFilter' objects>
@brief Gets a value indicating whether the filter needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the filter needs raw (unmerged) input This flag must be set before using this filter. It tells the filter implementation whether the filter wants to have raw input (unmerged). The default value is 'false', meaning that the filter will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'PolygonFilter' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) filters are area or perimeter filters. The area or perimeter of a polygon depends on the scale, but not on the orientation of the polygon.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) filter is the square selector. Whether a polygon is a square or not does not depend on the polygon's orientation nor scale.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) filter is the bounding box aspect ratio (height/width) filter. The definition of heigh and width depends on the orientation, but the ratio is independent on scale.
new
builtin
new() -> PolygonFilter
@brief Creates a new object of this class
PolygonOperator
@brief A generic polygon operator
Polygon processors are an efficient way to process polygons from a Region. To apply a processor, derive your own operator class and pass an instance to the \Region#process or \Region#processed method.
Conceptually, these methods take each polygon from the region and present it to the operators' 'process' method. The result of this call is a list of zero to many output polygons derived from the input polygon. The output region is the sum over all these individual results.
The magic happens when deep mode regions are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that shrinks every polygon to half of the size but does not change the position. In this example the 'position' is defined by the center of the bounding box: @code class ShrinkToHalf < RBA::PolygonOperator
# Constructor def initialize self.is_isotropic_and_scale_invariant # scale or orientation do not matter end
# Shrink to half size def process(polygon) shift = polygon.bbox.center - RBA::Point::new # shift vector return [ (polygon.moved(-shift) * 0.5).moved(shift) ] end
end
region = ... # some Region shrinked_to_half = region.processed(ShrinkToHalf::new) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic polygon operator\n\nPolygon processors are an efficient way to process polygons from a Region. To apply a processor, derive your own operator class and pass an instance to the \\Region#process or \\Region#processed method.\n\nConceptually, these methods take each polygon from the region and present it to the operators' 'process' method.\nThe result of this call is a list of zero to many output polygons derived from the input polygon.\nThe output region is the sum over all these individual results.\n\nThe magic happens when deep mode regions are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that shrinks every polygon to half of the size but does not change the position.\nIn this example the 'position' is defined by the center of the bounding box:\n@code\nclass ShrinkToHalf < RBA::PolygonOperator\n\n # Constructor\n def initialize\n self.is_isotropic_and_scale_invariant # scale or orientation do not matter\n end\n \n # Shrink to half size\n def process(polygon)\n shift = polygon.bbox.center - RBA::Point::new # shift vector\n return [ (polygon.moved(-shift) * 0.5).moved(shift) ]\n end\n\nend\n\nregion = ... # some Region\nshrinked_to_half = region.processed(ShrinkToHalf::new)\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 162
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PolygonOperator' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'PolygonOperator' objects>
@brief Gets a value indicating whether the processor needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the processor needs raw (unmerged) input This flag must be set before using this processor. It tells the processor implementation whether the processor wants to have raw input (unmerged). The default value is 'false', meaning that the processor will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
result_is_merged
class
result_is_merged: bool = <attribute 'result_is_merged' of 'PolygonOperator' objects>
@brief Gets a value indicating whether the processor delivers merged output See \result_is_merged= for details.
@brief Sets a value indicating whether the processor delivers merged output This flag must be set before using this processor. If the processor maintains the merged condition by design (output is merged if input is), it is a good idea to set this predicate to 'true'. This will avoid additional merge steps when the resulting collection is used in further operations that need merged input .
result_must_not_be_merged
class
result_must_not_be_merged: bool = <attribute 'result_must_not_be_merged' of 'PolygonOperator' objects>
@brief Gets a value indicating whether the processor's output must not be merged See \result_must_not_be_merged= for details.
@brief Sets a value indicating whether the processor's output must not be merged This flag must be set before using this processor. The processor can set this flag if it wants to deliver shapes that must not be merged - e.g. point-like edges or strange or degenerated polygons. .
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'PolygonOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> PolygonOperator
@brief Creates a new object of this class
PolygonToEdgeOperator
@brief A generic polygon-to-edge operator
Polygon processors are an efficient way to process polygons from a Region. To apply a processor, derive your own operator class and pass an instance to the \Region#processed method.
Conceptually, these methods take each polygon from the region and present it to the operator's 'process' method. The result of this call is a list of zero to many output edges derived from the input polygon. The output edge collection is the sum over all these individual results.
The magic happens when deep mode regions are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \PolygonOperator class, with the exception that this incarnation has to deliver edges.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic polygon-to-edge operator\n\nPolygon processors are an efficient way to process polygons from a Region. To apply a processor, derive your own operator class and pass an instance to the \\Region#processed method.\n\nConceptually, these methods take each polygon from the region and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output edges derived from the input polygon.\nThe output edge collection is the sum over all these individual results.\n\nThe magic happens when deep mode regions are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\PolygonOperator class, with the exception that this incarnation has to deliver edges.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 163
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PolygonToEdgeOperator' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'PolygonToEdgeOperator' objects>
@brief Gets a value indicating whether the processor needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the processor needs raw (unmerged) input This flag must be set before using this processor. It tells the processor implementation whether the processor wants to have raw input (unmerged). The default value is 'false', meaning that the processor will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
result_is_merged
class
result_is_merged: bool = <attribute 'result_is_merged' of 'PolygonToEdgeOperator' objects>
@brief Gets a value indicating whether the processor delivers merged output See \result_is_merged= for details.
@brief Sets a value indicating whether the processor delivers merged output This flag must be set before using this processor. If the processor maintains the merged condition by design (output is merged if input is), it is a good idea to set this predicate to 'true'. This will avoid additional merge steps when the resulting collection is used in further operations that need merged input .
result_must_not_be_merged
class
result_must_not_be_merged: bool = <attribute 'result_must_not_be_merged' of 'PolygonToEdgeOperator' objects>
@brief Gets a value indicating whether the processor's output must not be merged See \result_must_not_be_merged= for details.
@brief Sets a value indicating whether the processor's output must not be merged This flag must be set before using this processor. The processor can set this flag if it wants to deliver shapes that must not be merged - e.g. point-like edges or strange or degenerated polygons. .
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'PolygonToEdgeOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> PolygonToEdgeOperator
@brief Creates a new object of this class
PolygonToEdgePairOperator
@brief A generic polygon-to-edge-pair operator
Polygon processors are an efficient way to process polygons from a Region. To apply a processor, derive your own operator class and pass an instance to the \Region#processed method.
Conceptually, these methods take each polygon from the region and present it to the operator's 'process' method. The result of this call is a list of zero to many output edge pairs derived from the input polygon. The output edge pair collection is the sum over all these individual results.
The magic happens when deep mode regions are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \PolygonOperator class, with the exception that this incarnation has to deliver edge pairs.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic polygon-to-edge-pair operator\n\nPolygon processors are an efficient way to process polygons from a Region. To apply a processor, derive your own operator class and pass an instance to the \\Region#processed method.\n\nConceptually, these methods take each polygon from the region and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output edge pairs derived from the input polygon.\nThe output edge pair collection is the sum over all these individual results.\n\nThe magic happens when deep mode regions are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\PolygonOperator class, with the exception that this incarnation has to deliver edge pairs.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 164
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PolygonToEdgePairOperator' objects>
list of weak references to the object
requires_raw_input
class
requires_raw_input: bool = <attribute 'requires_raw_input' of 'PolygonToEdgePairOperator' objects>
@brief Gets a value indicating whether the processor needs raw (unmerged) input See \requires_raw_input= for details.
@brief Sets a value indicating whether the processor needs raw (unmerged) input This flag must be set before using this processor. It tells the processor implementation whether the processor wants to have raw input (unmerged). The default value is 'false', meaning that the processor will receive merged polygons ('merged semantics').
Setting this value to false potentially saves some CPU time needed for merging the polygons. Also, raw input means that strange shapes such as dot-like edges, self-overlapping polygons, empty or degenerated polygons are preserved.
result_is_merged
class
result_is_merged: bool = <attribute 'result_is_merged' of 'PolygonToEdgePairOperator' objects>
@brief Gets a value indicating whether the processor delivers merged output See \result_is_merged= for details.
@brief Sets a value indicating whether the processor delivers merged output This flag must be set before using this processor. If the processor maintains the merged condition by design (output is merged if input is), it is a good idea to set this predicate to 'true'. This will avoid additional merge steps when the resulting collection is used in further operations that need merged input .
result_must_not_be_merged
class
result_must_not_be_merged: bool = <attribute 'result_must_not_be_merged' of 'PolygonToEdgePairOperator' objects>
@brief Gets a value indicating whether the processor's output must not be merged See \result_must_not_be_merged= for details.
@brief Sets a value indicating whether the processor's output must not be merged This flag must be set before using this processor. The processor can set this flag if it wants to deliver shapes that must not be merged - e.g. point-like edges or strange or degenerated polygons. .
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'PolygonToEdgePairOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> PolygonToEdgePairOperator
@brief Creates a new object of this class
PreferredOrientation
@brief This class represents the PreferredOrientation enum used within polygon decomposition
This enum has been introduced in version 0.27.
PO_any
class
PO_any: PreferredOrientation = PO_any (0)
@brief This class represents the PreferredOrientation enum used within polygon decomposition
This enum has been introduced in version 0.27.
PO_horizontal
class
PO_horizontal: PreferredOrientation = PO_horizontal (1)
@brief This class represents the PreferredOrientation enum used within polygon decomposition
This enum has been introduced in version 0.27.
PO_htrapezoids
class
PO_htrapezoids: PreferredOrientation = PO_htrapezoids (3)
@brief This class represents the PreferredOrientation enum used within polygon decomposition
This enum has been introduced in version 0.27.
PO_vertical
class
PO_vertical: PreferredOrientation = PO_vertical (2)
@brief This class represents the PreferredOrientation enum used within polygon decomposition
This enum has been introduced in version 0.27.
PO_vtrapezoids
class
PO_vtrapezoids: PreferredOrientation = PO_vtrapezoids (4)
@brief This class represents the PreferredOrientation enum used within polygon decomposition
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the PreferredOrientation enum used within polygon decomposition\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 42
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PreferredOrientation' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> PreferredOrientation
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PreferredOrientation
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: PreferredOrientation) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> PreferredOrientation
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> PreferredOrientation
new(s: str) -> PreferredOrientation
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
PropertyConstraint
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
DifferentPropertiesConstraint
class
DifferentPropertiesConstraint: PropertyConstraint = DifferentPropertiesConstraint (4)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
DifferentPropertiesConstraintDrop
class
DifferentPropertiesConstraintDrop: PropertyConstraint = DifferentPropertiesConstraintDrop (5)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
IgnoreProperties
class
IgnoreProperties: PropertyConstraint = IgnoreProperties (0)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
NoPropertyConstraint
class
NoPropertyConstraint: PropertyConstraint = NoPropertyConstraint (1)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
SamePropertiesConstraint
class
SamePropertiesConstraint: PropertyConstraint = SamePropertiesConstraint (2)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
SamePropertiesConstraintDrop
class
SamePropertiesConstraintDrop: PropertyConstraint = SamePropertiesConstraintDrop (3)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
__doc__
class
__doc__ = '@brief This class represents the property constraint for boolean and check functions.\n\nThis enum has been introduced in version 0.28.4.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 168
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PropertyConstraint' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> PropertyConstraint
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PropertyConstraint
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: PropertyConstraint) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> PropertyConstraint
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> PropertyConstraint
new(s: str) -> PropertyConstraint
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
RecursiveInstanceIterator
@brief An iterator delivering instances recursively
The iterator can be obtained from a cell and optionally a region. It simplifies retrieval of instances while considering subcells as well. Some options can be specified in addition, i.e. the hierarchy level to which to look into. The search can be confined to instances of certain cells (see \targets=) or to certain regions. Subtrees can be selected for traversal or excluded from it (see \select_cells).
This is some sample code:
@code
prints the effective instances of cell "A" as seen from the initial cell "cell"
iter = cell.begin_instances_rec iter.targets = "A" while !iter.at_end? puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s iter.next end
or shorter:
cell.begin_instances_rec.each do |iter| puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s end @/code
Here, a target cell is specified which confines the search to instances of this particular cell. 'iter.dtrans' gives us the accumulated transformation of all parents up to the top cell. 'iter.inst_dtrans' gives us the transformation from the current instance. 'iter.inst_cell' finally gives us the target cell of the current instance (which is always 'A' in our case).
\Cell offers three methods to get these iterators: begin_instances_rec, begin_instances_rec_touching and begin_instances_rec_overlapping. \Cell#begin_instances_rec will deliver a standard recursive instance iterator which starts from the given cell and iterates over all child cells. \Cell#begin_instances_rec_touching creates a RecursiveInstanceIterator which delivers the instances whose bounding boxed touch the given search box. \Cell#begin_instances_rec_overlapping gives an iterator which delivers all instances whose bounding box overlaps the search box.
A RecursiveInstanceIterator object can also be created directly, like this:
@code iter = RBA::RecursiveInstanceIterator::new(layout, cell [, options ]) @/code
"layout" is the layout object, "cell" the \Cell object of the initial cell.
The recursive instance iterator can be confined to a maximum hierarchy depth. By using \max_depth=, the iterator will restrict the search depth to the given depth in the cell tree. In the same way, the iterator can be configured to start from a certain hierarchy depth using \min_depth=. The hierarchy depth always applies to the parent of the instances iterated.
In addition, the recursive instance iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn instance delivery on and off. The \select_cells method sets the "start delivery" flag while \unselect_cells sets the "stop delivery" flag. In effect, using \unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \select_cells. For the cells selected that way, the instances of these cells and their child cells are delivered, even if their parent was unselected.
To get instances from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again:
@code
deliver all instances inside "MACRO" and the sub-hierarchy:
iter = RBA::RecursiveInstanceIterator::new(layout, cell) iter.unselect_cells(cell.cell_index) iter.select_cells("MACRO") ... @/code
The \unselect_all_cells and \select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \unselect_all_cells and use \select_cells for a specific cell, the iterator will deliver only the instances of the selected cell, not its children. Those are still unselected by \unselect_all_cells:
@code
deliver all instance inside "MACRO" but not of child cells:
iter = RBA::RecursiveInstanceIterator::new(layout, cell) iter.unselect_all_cells iter.select_cells("MACRO") ... @/code
Cell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters.
To confine instance iteration to instances of certain cells, use the \targets feature:
@code
deliver all instance of "INV1":
iter = RBA::RecursiveInstanceIterator::new(layout, cell) iter.targets = "INV1" ... @/code
Targets can be specified either as lists of cell indexes or through a glob pattern.
Instances are always delivered depth-first with child instances before their parents. A default recursive instance iterator will first deliver leaf cells, followed by the parent of these cells.
When a search region is used, instances whose bounding box touch or overlap (depending on 'overlapping' flag) will be reported. The instance bounding box taken as reference is computed using all layers of the layout.
The iterator will deliver the individual elements of instance arrays, confined to the search region if one is given. Consequently the return value (\current_inst_element) is an \InstElement object which is basically a combination of an \Instance object and information about the current array element. \inst_cell, \inst_trans and \inst_dtrans are methods provided for convenience to access the current array member's transformation and the target cell of the current instance.
The RecursiveInstanceIterator class has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief An iterator delivering instances recursively\n\nThe iterator can be obtained from a cell and optionally a region.\nIt simplifies retrieval of instances while considering\nsubcells as well.\nSome options can be specified in addition, i.e. the hierarchy level to which to look into.\nThe search can be confined to instances of certain cells (see \\targets=) or to certain regions. Subtrees can be selected for traversal or excluded from it (see \\select_cells).\n\nThis is some sample code:\n\n@code\n# prints the effective instances of cell "A" as seen from the initial cell "cell"\niter = cell.begin_instances_rec\niter.targets = "A"\nwhile !iter.at_end?\n puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s\n iter.next\nend\n\n# or shorter:\ncell.begin_instances_rec.each do |iter|\n puts "Instance of #{iter.inst_cell.name} in #{cell.name}: " + (iter.dtrans * iter.inst_dtrans).to_s\nend\n@/code\n\nHere, a target cell is specified which confines the search to instances of this particular cell.\n\'iter.dtrans\' gives us the accumulated transformation of all parents up to the top cell. \'iter.inst_dtrans\' gives us the transformation from the current instance. \'iter.inst_cell\' finally gives us the target cell of the current instance (which is always \'A\' in our case).\n\n\\Cell offers three methods to get these iterators: begin_instances_rec, begin_instances_rec_touching and begin_instances_rec_overlapping.\n\\Cell#begin_instances_rec will deliver a standard recursive instance iterator which starts from the given cell and iterates over all child cells. \\Cell#begin_instances_rec_touching creates a RecursiveInstanceIterator which delivers the instances whose bounding boxed touch the given search box. \\Cell#begin_instances_rec_overlapping gives an iterator which delivers all instances whose bounding box overlaps the search box.\n\nA RecursiveInstanceIterator object can also be created directly, like this:\n\n@code\niter = RBA::RecursiveInstanceIterator::new(layout, cell [, options ])\n@/code\n\n"layout" is the layout object, "cell" the \\Cell object of the initial cell.\n\nThe recursive instance iterator can be confined to a maximum hierarchy depth. By using \\max_depth=, the iterator will restrict the search depth to the given depth in the cell tree.\nIn the same way, the iterator can be configured to start from a certain hierarchy depth using \\min_depth=. The hierarchy depth always applies to the parent of the instances iterated.\n\nIn addition, the recursive instance iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn instance delivery on and off. The \\select_cells method sets the "start delivery" flag while \\unselect_cells sets the "stop delivery" flag. In effect, using \\unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \\select_cells. For the cells selected that way, the instances of these cells and their child cells are delivered, even if their parent was unselected.\n\nTo get instances from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again:\n\n@code\n# deliver all instances inside "MACRO" and the sub-hierarchy:\niter = RBA::RecursiveInstanceIterator::new(layout, cell)\niter.unselect_cells(cell.cell_index)\niter.select_cells("MACRO")\n...\n@/code\n\nThe \\unselect_all_cells and \\select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \\unselect_all_cells and use \\select_cells for a specific cell, the iterator will deliver only the instances of the selected cell, not its children. Those are still unselected by \\unselect_all_cells:\n\n@code\n# deliver all instance inside "MACRO" but not of child cells:\niter = RBA::RecursiveInstanceIterator::new(layout, cell)\niter.unselect_all_cells\niter.select_cells("MACRO")\n...\n@/code\n\nCell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A*" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]*" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters.\n\nTo confine instance iteration to instances of certain cells, use the \\targets feature:\n\n@code\n# deliver all instance of "INV1":\niter = RBA::RecursiveInstanceIterator::new(layout, cell)\niter.targets = "INV1"\n...\n@/code\n\nTargets can be specified either as lists of cell indexes or through a glob pattern.\n\nInstances are always delivered depth-first with child instances before their parents. A default recursive instance iterator will first deliver leaf cells, followed by the parent of these cells.\n\nWhen a search region is used, instances whose bounding box touch or overlap (depending on \'overlapping\' flag) will be reported. The instance bounding box taken as reference is computed using all layers of the layout.\n\nThe iterator will deliver the individual elements of instance arrays, confined to the search region if one is given. Consequently the return value (\\current_inst_element) is an \\InstElement object which is basically a combination of an \\Instance object and information about the current array element.\n\\inst_cell, \\inst_trans and \\inst_dtrans are methods provided for convenience to access the current array member\'s transformation and the target cell of the current instance.\n\nThe RecursiveInstanceIterator class has been introduced in version 0.27.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 159
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'RecursiveInstanceIterator' objects>
list of weak references to the object
max_depth
class
max_depth: int = <attribute 'max_depth' of 'RecursiveInstanceIterator' objects>
@brief Gets the maximum hierarchy depth
See \max_depth= for a description of that attribute.
@brief Specifies the maximum hierarchy depth to look into
A depth of 0 instructs the iterator to deliver only instances from the initial cell. A higher depth instructs the iterator to look deeper. The depth must be specified before the instances are being retrieved.
min_depth
class
min_depth: int = <attribute 'min_depth' of 'RecursiveInstanceIterator' objects>
@brief Gets the minimum hierarchy depth
See \min_depth= for a description of that attribute.
@brief Specifies the minimum hierarchy depth to look into
A depth of 0 instructs the iterator to deliver instances from the top level. 1 instructs to deliver instances from the first child level. The minimum depth must be specified before the instances are being retrieved.
overlapping
class
overlapping: bool = <attribute 'overlapping' of 'RecursiveInstanceIterator' objects>
@brief Gets a flag indicating whether overlapping instances are selected when a region is used
@brief Sets a flag indicating whether overlapping instances are selected when a region is used
If this flag is false, instances touching the search region are returned.
region
class
region: Box = <attribute 'region' of 'RecursiveInstanceIterator' objects>
@brief Gets the basic region that this iterator is using The basic region is the overall box the region iterator iterates over. There may be an additional complex region that confines the region iterator. See \complex_region for this attribute.
@brief Sets the rectangular region that this iterator is iterating over See \region for a description of this attribute. Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence.
@brief Sets the complex region that this iterator is using See \complex_region for a description of this attribute. Setting the complex region will reset the basic region (see \region) to the bounding box of the complex region and reset the iterator to the beginning of the sequence.
targets
class
targets: List[int] = <attribute 'targets' of 'RecursiveInstanceIterator' objects>
@brief Gets the list of target cells See \targets= for a description of the target cell concept. This method returns a list of cell indexes of the selected target cells.
@brief Specifies the target cells.
If target cells are specified, only instances of these cells are delivered. This version takes a list of cell indexes for the targets. By default, no target cell list is present and the instances of all cells are delivered by the iterator. See \all_targets_enabled? and \enable_all_targets for a description of this mode. Once a target list is specified, the iteration is confined to the cells from this list. The cells are given as a list of cell indexes.
This method will also reset the iterator.
@brief Specifies the target cells.
If target cells are specified, only instances of these cells are delivered. This version takes a cell list as a glob pattern. A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A"). Use the curly-bracket notation to list different cells, e.g "{A,B,C}" for cells A, B and C.
By default, no target cell list is present and the instances of all cells are delivered by the iterator. See \all_targets_enabled? and \enable_all_targets for a description of this mode. Once a target list is specified, the iteration is confined to the cells from this list. The cells are given as a list of cell indexes.
This method will also reset the iterator.
__copy__
method descriptor
__copy__() -> RecursiveInstanceIterator
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> RecursiveInstanceIterator
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Comparison of iterators - equality
Two iterators are equal if they point to the same instance.
__init__
method descriptor
__init__(layout: Layout, cell: Cell) -> None
__init__(layout: Layout, cell: Cell, box: Box, overlapping: Optional[bool] = ...) -> None
__init__(layout: Layout, cell: Cell, region: Region, overlapping: bool) -> None
__init__()
@brief Creates a recursive instance iterator with a search region. @param layout The layout which shall be iterated @param cell The initial cell which shall be iterated (including its children) @param region The search region @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient
This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children.
The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account.
__iter__
method descriptor
__iter__() -> Iterator[RecursiveInstanceIterator]
@brief Native iteration This method enables native iteration, e.g.
@code iter = ... # RecursiveInstanceIterator iter.each do |i| ... i is the iterator itself end @/code
This is slightly more convenient than the 'at_end' .. 'next' loop.
This feature has been introduced in version 0.28.
__ne__
method descriptor
__ne__() -> bool
@brief Comparison of iterators - inequality
Two iterators are not equal if they do not point to the same instance.
all_targets_enabled
method descriptor
all_targets_enabled() -> bool
@brief Gets a value indicating whether instances of all cells are reported See \targets= for a description of the target cell concept.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
at_end
method descriptor
at_end() -> bool
@brief End of iterator predicate
Returns true, if the iterator is at the end of the sequence
cell
method descriptor
cell() -> Cell
@brief Gets the cell the current instance sits in
cell_index
method descriptor
cell_index() -> int
@brief Gets the index of the cell the current instance sits in This is equivalent to 'cell.cell_index'.
complex_region
method descriptor
complex_region() -> Region
@brief Gets the complex region that this iterator is using The complex region is the effective region (a \Region object) that the iterator is selecting from the layout. This region can be a single box or a complex region.
confine_region
method descriptor
confine_region(box_region: Box) -> None
confine_region(complex_region: Region) -> None
confine_region()
@brief Confines the region that this iterator is iterating over This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it.
create
method descriptor
create() -> None
@brief 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.
current_inst_element
method descriptor
current_inst_element() -> InstElement
@brief Gets the current instance
This is the instance/array element the iterator currently refers to. This is a \InstElement object representing the current instance and the array element the iterator currently points at.
See \inst_trans, \inst_dtrans and \inst_cell for convenience methods to access the details of the current element.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dtrans
method descriptor
dtrans() -> DCplxTrans
@brief Gets the accumulated transformation of the current instance parent cell to the top cell
This transformation represents how the current instance is seen in the top cell. This version returns the micron-unit transformation.
dup
method descriptor
dup() -> RecursiveInstanceIterator
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[RecursiveInstanceIterator]
@brief Native iteration This method enables native iteration, e.g.
@code iter = ... # RecursiveInstanceIterator iter.each do |i| ... i is the iterator itself end @/code
This is slightly more convenient than the 'at_end' .. 'next' loop.
This feature has been introduced in version 0.28.
enable_all_targets
method descriptor
enable_all_targets() -> None
@brief Enables 'all targets' mode in which instances of all cells are reported See \targets= for a description of the target cell concept.
inst_cell
method descriptor
inst_cell() -> Cell
@brief Gets the target cell of the current instance This is the cell the current instance refers to. It is one of the \targets if a target list is given.
inst_dtrans
method descriptor
inst_dtrans() -> DCplxTrans
@brief Gets the micron-unit transformation of the current instance This is the transformation of the current instance inside its parent. 'dtrans * inst_dtrans' gives the full micron-unit transformation how the current cell is seen in the top cell. See also \inst_trans and \inst_cell.
inst_trans
method descriptor
inst_trans() -> ICplxTrans
@brief Gets the integer-unit transformation of the current instance This is the transformation of the current instance inside its parent. 'trans * inst_trans' gives the full transformation how the current cell is seen in the top cell. See also \inst_dtrans and \inst_cell.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layout
method descriptor
layout() -> Layout
@brief Gets the layout this iterator is connected to
new
builtin
new(layout: Layout, cell: Cell) -> RecursiveInstanceIterator
new(layout: Layout, cell: Cell, box: Box, overlapping: Optional[bool] = ...) -> RecursiveInstanceIterator
new(layout: Layout, cell: Cell, region: Region, overlapping: bool) -> RecursiveInstanceIterator
new()
@brief Creates a recursive instance iterator with a search region. @param layout The layout which shall be iterated @param cell The initial cell which shall be iterated (including its children) @param region The search region @param overlapping If set to true, instances overlapping the search region are reported, otherwise touching is sufficient
This constructor creates a new recursive instance iterator which delivers the instances of the given cell plus its children.
The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. If "overlapping" is true, instances whose bounding box is overlapping the search region are reported. If "overlapping" is false, instances whose bounding box touches the search region are reported. The bounding box of instances is measured taking all layers of the target cell into account.
next
method descriptor
next() -> None
@brief Increments the iterator This moves the iterator to the next instance inside the search scope.
path
method descriptor
path() -> List[InstElement]
@brief Gets the instantiation path of the instance addressed currently
This attribute is a sequence of \InstElement objects describing the cell instance path from the initial cell to the current instance. The path is empty if the current instance is in the top cell.
reset
method descriptor
reset() -> None
@brief Resets the iterator to the initial state
reset_selection
method descriptor
reset_selection() -> None
@brief Resets the selection to the default state
In the initial state, the top cell and its children are selected. Child cells can be switched on and off together with their sub-hierarchy using \select_cells and \unselect_cells.
This method will also reset the iterator.
select_all_cells
method descriptor
select_all_cells() -> None
@brief Selects all cells.
This method will set the "selected" mark on all cells. The effect is that subsequent calls of \unselect_cells will unselect only the specified cells, not their children, because they are still unselected.
This method will also reset the iterator.
select_cells
method descriptor
select_cells(cells: Sequence[int]) -> None
select_cells(cells: str) -> None
select_cells()
@brief Unselects the given cells.
This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method.
The cells are given as a glob pattern. A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A").
This method will also reset the iterator.
top_cell
method descriptor
top_cell() -> Cell
@brief Gets the top cell this iterator is connected to
trans
method descriptor
trans() -> ICplxTrans
@brief Gets the accumulated transformation of the current instance parent cell to the top cell
This transformation represents how the current instance is seen in the top cell.
unselect_all_cells
method descriptor
unselect_all_cells() -> None
@brief Unselects all cells.
This method will set the "unselected" mark on all cells. The effect is that subsequent calls of \select_cells will select only the specified cells, not their children, because they are still unselected.
This method will also reset the iterator.
unselect_cells
method descriptor
unselect_cells(cells: Sequence[int]) -> None
unselect_cells(cells: str) -> None
unselect_cells()
@brief Unselects the given cells.
This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method.
The cells are given as a glob pattern. A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A").
This method will also reset the iterator.
RecursiveShapeIterator
@brief An iterator delivering shapes recursively
The iterator can be obtained from a cell, a layer and optionally a region. It simplifies retrieval of shapes from a geometrical region while considering subcells as well. Some options can be specified in addition, i.e. the level to which to look into or shape classes and shape properties. The shapes are retrieved by using the \shape method, \next moves to the next shape and \at_end tells, if the iterator has move shapes to deliver.
This is some sample code:
@code
print the polygon-like objects as seen from the initial cell "cell"
iter = cell.begin_shapes_rec(layer) while !iter.at_end? if iter.shape.renders_polygon? polygon = iter.shape.polygon.transformed(iter.itrans) puts "In cell #{iter.cell.name}: " + polygon.to_s end iter.next end
or shorter:
cell.begin_shapes_rec(layer).each do |iter| if iter.shape.renders_polygon? polygon = iter.shape.polygon.transformed(iter.itrans) puts "In cell #{iter.cell.name}: " + polygon.to_s end end @/code
\Cell offers three methods to get these iterators: begin_shapes_rec, begin_shapes_rec_touching and begin_shapes_rec_overlapping. \Cell#begin_shapes_rec will deliver a standard recursive shape iterator which starts from the given cell and iterates over all child cells. \Cell#begin_shapes_rec_touching delivers a RecursiveShapeIterator which delivers the shapes whose bounding boxed touch the given search box. \Cell#begin_shapes_rec_overlapping delivers all shapes whose bounding box overlaps the search box.
A RecursiveShapeIterator object can also be created explicitly. This allows some more options, i.e. using multiple layers. A multi-layer recursive shape iterator can be created like this:
@code iter = RBA::RecursiveShapeIterator::new(layout, cell, [ layer_index1, layer_index2 .. ]) @/code
"layout" is the layout object, "cell" the RBA::Cell object of the initial cell. layer_index1 etc. are the layer indexes of the layers to get the shapes from. While iterating, \RecursiveShapeIterator#layer delivers the layer index of the current shape.
The recursive shape iterator can be confined to a maximum hierarchy depth. By using \max_depth=, the iterator will restrict the search depth to the given depth in the cell tree.
In addition, the recursive shape iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn shape delivery on and off. The \select_cells method sets the "start delivery" flag while \unselect_cells sets the "stop delivery" flag. In effect, using \unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \select_cells. For the cells selected that way, the shapes of these cells and their child cells are delivered, even if their parent was unselected.
To get shapes from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again:
@code
deliver all shapes inside "MACRO" and the sub-hierarchy:
iter = RBA::RecursiveShapeIterator::new(layout, cell, layer) iter.unselect_cells(cell.cell_index) iter.select_cells("MACRO") @/code
Note that if "MACRO" uses library cells for example which are used otherwise as well, the iterator will only deliver the shapes for those instances belonging to "MACRO" (directly or indirectly), not those for other instances of these library cells.
The \unselect_all_cells and \select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \unselect_all_cells and use \select_cells for a specific cell, the iterator will deliver only the shapes of the selected cell, not its children. Those are still unselected by \unselect_all_cells:
@code
deliver all shapes of "MACRO" but not of child cells:
iter = RBA::RecursiveShapeIterator::new(layout, cell, layer) iter.unselect_all_cells iter.select_cells("MACRO") @/code
Cell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters.
The RecursiveShapeIterator class has been introduced in version 0.18 and has been extended substantially in 0.23.
__doc__
class
__doc__ = '@brief An iterator delivering shapes recursively\n\nThe iterator can be obtained from a cell, a layer and optionally a region.\nIt simplifies retrieval of shapes from a geometrical region while considering\nsubcells as well.\nSome options can be specified in addition, i.e. the level to which to look into or\nshape classes and shape properties. The shapes are retrieved by using the \\shape method,\n\\next moves to the next shape and \\at_end tells, if the iterator has move shapes to deliver.\n\nThis is some sample code:\n\n@code\n# print the polygon-like objects as seen from the initial cell "cell"\niter = cell.begin_shapes_rec(layer)\nwhile !iter.at_end?\n if iter.shape.renders_polygon?\n polygon = iter.shape.polygon.transformed(iter.itrans)\n puts "In cell #{iter.cell.name}: " + polygon.to_s\n end\n iter.next\nend\n\n# or shorter:\ncell.begin_shapes_rec(layer).each do |iter|\n if iter.shape.renders_polygon?\n polygon = iter.shape.polygon.transformed(iter.itrans)\n puts "In cell #{iter.cell.name}: " + polygon.to_s\n end\nend\n@/code\n\n\\Cell offers three methods to get these iterators: begin_shapes_rec, begin_shapes_rec_touching and begin_shapes_rec_overlapping.\n\\Cell#begin_shapes_rec will deliver a standard recursive shape iterator which starts from the given cell and iterates over all child cells. \\Cell#begin_shapes_rec_touching delivers a RecursiveShapeIterator which delivers the shapes whose bounding boxed touch the given search box. \\Cell#begin_shapes_rec_overlapping delivers all shapes whose bounding box overlaps the search box.\n\nA RecursiveShapeIterator object can also be created explicitly. This allows some more options, i.e. using multiple layers. A multi-layer recursive shape iterator can be created like this:\n\n@code\niter = RBA::RecursiveShapeIterator::new(layout, cell, [ layer_index1, layer_index2 .. ])\n@/code\n\n"layout" is the layout object, "cell" the RBA::Cell object of the initial cell. layer_index1 etc. are the layer indexes of the layers to get the shapes from. While iterating, \\RecursiveShapeIterator#layer delivers the layer index of the current shape.\n\nThe recursive shape iterator can be confined to a maximum hierarchy depth. By using \\max_depth=, the iterator will restrict the search depth to the given depth in the cell tree.\n\nIn addition, the recursive shape iterator supports selection and exclusion of subtrees. For that purpose it keeps flags per cell telling it for which cells to turn shape delivery on and off. The \\select_cells method sets the "start delivery" flag while \\unselect_cells sets the "stop delivery" flag. In effect, using \\unselect_cells will exclude that cell plus the subtree from delivery. Parts of that subtree can be turned on again using \\select_cells. For the cells selected that way, the shapes of these cells and their child cells are delivered, even if their parent was unselected.\n\nTo get shapes from a specific cell, i.e. "MACRO" plus its child cells, unselect the top cell first and the select the desired cell again:\n\n@code\n# deliver all shapes inside "MACRO" and the sub-hierarchy:\niter = RBA::RecursiveShapeIterator::new(layout, cell, layer)\niter.unselect_cells(cell.cell_index)\niter.select_cells("MACRO")\n@/code\n\nNote that if "MACRO" uses library cells for example which are used otherwise as well, the iterator will only deliver the shapes for those instances belonging to "MACRO" (directly or indirectly), not those for other instances of these library cells.\n\nThe \\unselect_all_cells and \\select_all_cells methods turn on the "stop" and "start" flag for all cells respectively. If you use \\unselect_all_cells and use \\select_cells for a specific cell, the iterator will deliver only the shapes of the selected cell, not its children. Those are still unselected by \\unselect_all_cells:\n\n@code\n# deliver all shapes of "MACRO" but not of child cells:\niter = RBA::RecursiveShapeIterator::new(layout, cell, layer)\niter.unselect_all_cells\niter.select_cells("MACRO")\n@/code\n\nCell selection is done using cell indexes or glob pattern. Glob pattern are equivalent to the usual file name wildcards used on various command line shells. For example "A*" matches all cells starting with an "A". The curly brace notation and character classes are supported as well. For example "C{125,512}" matches "C125" and "C512" and "[ABC]*" matches all cells starting with an "A", a "B" or "C". "[^ABC]*" matches all cells not starting with one of that letters.\n\nThe RecursiveShapeIterator class has been introduced in version 0.18 and has been extended substantially in 0.23.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 160
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'RecursiveShapeIterator' objects>
list of weak references to the object
for_merged_input
class
for_merged_input: bool = <attribute 'for_merged_input' of 'RecursiveShapeIterator' objects>
@brief Gets a flag indicating whether iterator optimizes for merged input
see \for_merged_input= for details of this attribute.
This method has been introduced in version 0.29.
@brief Sets a flag indicating whether iterator optimizes for merged input
If this flag is set to true, the iterator is allowed to skip shapes it deems irrelevant because they are covered entirely by other shapes. This allows shortcutting hierarchy traversal in some cases.
This method has been introduced in version 0.29.
global_dtrans
class
global_dtrans: DCplxTrans = <attribute 'global_dtrans' of 'RecursiveShapeIterator' objects>
@brief Gets the global transformation to apply to all shapes delivered (in micrometer units) See also \global_dtrans=.
This method has been introduced in version 0.27.
@brief Sets the global transformation to apply to all shapes delivered (transformation in micrometer units) The global transformation will be applied to all shapes delivered by biasing the "trans" attribute. The search regions apply to the coordinate space after global transformation.
This method has been introduced in version 0.27.
global_trans
class
global_trans: ICplxTrans = <attribute 'global_trans' of 'RecursiveShapeIterator' objects>
@brief Gets the global transformation to apply to all shapes delivered See also \global_trans=.
This method has been introduced in version 0.27.
@brief Sets the global transformation to apply to all shapes delivered The global transformation will be applied to all shapes delivered by biasing the "trans" attribute. The search regions apply to the coordinate space after global transformation.
This method has been introduced in version 0.27.
max_depth
class
max_depth: int = <attribute 'max_depth' of 'RecursiveShapeIterator' objects>
@brief Gets the maximum hierarchy depth
See \max_depth= for a description of that attribute.
This method has been introduced in version 0.23.
@brief Specifies the maximum hierarchy depth to look into
A depth of 0 instructs the iterator to deliver only shapes from the initial cell. The depth must be specified before the shapes are being retrieved. Setting the depth resets the iterator.
min_depth
class
min_depth: int = <attribute 'min_depth' of 'RecursiveShapeIterator' objects>
@brief Gets the minimum hierarchy depth
See \min_depth= for a description of that attribute.
This method has been introduced in version 0.27.
@brief Specifies the minimum hierarchy depth to look into
A depth of 0 instructs the iterator to deliver shapes from the top level. 1 instructs to deliver shapes from the first child level. The minimum depth must be specified before the shapes are being retrieved.
This method has been introduced in version 0.27.
overlapping
class
overlapping: bool = <attribute 'overlapping' of 'RecursiveShapeIterator' objects>
@brief Gets a flag indicating whether overlapping shapes are selected when a region is used
This method has been introduced in version 0.23.
@brief Sets a flag indicating whether overlapping shapes are selected when a region is used
If this flag is false, shapes touching the search region are returned.
This method has been introduced in version 0.23.
region
class
region: Box = <attribute 'region' of 'RecursiveShapeIterator' objects>
@brief Gets the basic region that this iterator is using The basic region is the overall box the region iterator iterates over. There may be an additional complex region that confines the region iterator. See \complex_region for this attribute.
This method has been introduced in version 0.23.
@brief Sets the rectangular region that this iterator is iterating over See \region for a description of this attribute. Setting a simple region will reset the complex region to a rectangle and reset the iterator to the beginning of the sequence. This method has been introduced in version 0.23.
@brief Sets the complex region that this iterator is using See \complex_region for a description of this attribute. Setting the complex region will reset the basic region (see \region) to the bounding box of the complex region and reset the iterator to the beginning of the sequence.
This method overload has been introduced in version 0.25.
shape_flags
class
shape_flags: int = <attribute 'shape_flags' of 'RecursiveShapeIterator' objects>
@brief Gets the shape selection flags
See \shape_flags= for a description of that property.
This getter has been introduced in version 0.28.
@brief Specifies the shape selection flags
The flags are the same then being defined in \Shapes (the default is RBA::Shapes::SAll). The flags must be specified before the shapes are being retrieved. Settings the shapes flags will reset the iterator.
__copy__
method descriptor
__copy__() -> RecursiveShapeIterator
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> RecursiveShapeIterator
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Comparison of iterators - equality
Two iterators are equal if they point to the same shape.
__init__
method descriptor
__init__(layout: Layout, cell: Cell, layer: int) -> None
__init__(layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> None
__init__(layout: Layout, cell: Cell, layer: int, region: Region, overlapping: Optional[bool] = ...) -> None
__init__(layout: Layout, cell: Cell, layers: Sequence[int]) -> None
__init__(layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> None
__init__(layout: Layout, cell: Cell, layers: Sequence[int], region: Region, overlapping: Optional[bool] = ...) -> None
__init__()
@brief Creates a recursive, multi-layer shape iterator with a region. @param layout The layout which shall be iterated @param cell The initial cell which shall be iterated (including its children) @param layers The layer indexes from which the shapes are taken @param region The search region @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient
This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. While iterating use the \layer method to retrieve the layer of the current shape.
The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported.
This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27.
__iter__
method descriptor
__iter__() -> Iterator[RecursiveShapeIterator]
@brief Native iteration This method enables native iteration, e.g.
@code iter = ... # RecursiveShapeIterator iter.each do |i| ... i is the iterator itself end @/code
This is slightly more convenient than the 'at_end' .. 'next' loop.
This feature has been introduced in version 0.28.
__ne__
method descriptor
__ne__() -> bool
@brief Comparison of iterators - inequality
Two iterators are not equal if they do not point to the same shape.
always_apply_dtrans
method descriptor
always_apply_dtrans() -> DCplxTrans
@brief Gets the global transformation if at top level, unity otherwise (micrometer-unit version) As the global transformation is only applicable on top level, use this method to transform shapes and instances into their local (cell-level) version while considering the global transformation properly.
This method has been introduced in version 0.27.
always_apply_trans
method descriptor
always_apply_trans() -> ICplxTrans
@brief Gets the global transformation if at top level, unity otherwise As the global transformation is only applicable on top level, use this method to transform shapes and instances into their local (cell-level) version while considering the global transformation properly.
This method has been introduced in version 0.27.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
at_end
method descriptor
at_end() -> bool
@brief End of iterator predicate
Returns true, if the iterator is at the end of the sequence
cell
method descriptor
cell() -> Cell
@brief Gets the current cell's object
This method has been introduced in version 0.23.
cell_index
method descriptor
cell_index() -> int
@brief Gets the current cell's index
complex_region
method descriptor
complex_region() -> Region
@brief Gets the complex region that this iterator is using The complex region is the effective region (a \Region object) that the iterator is selecting from the layout layers. This region can be a single box or a complex region.
This method has been introduced in version 0.25.
confine_region
method descriptor
confine_region(box_region: Box) -> None
confine_region(complex_region: Region) -> None
confine_region()
@brief Confines the region that this iterator is iterating over This method is similar to setting the region (see \region=), but will confine any region (complex or simple) already set. Essentially it does a logical AND operation between the existing and given region. Hence this method can only reduce a region, not extend it.
This method has been introduced in version 0.25.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dtrans
method descriptor
dtrans() -> DCplxTrans
@brief Gets the transformation into the initial cell applicable for floating point types
This transformation corresponds to the one delivered by \trans, but is applicable for the floating-point shape types in micron unit space.
This method has been introduced in version 0.25.3.
dup
method descriptor
dup() -> RecursiveShapeIterator
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[RecursiveShapeIterator]
@brief Native iteration This method enables native iteration, e.g.
@code iter = ... # RecursiveShapeIterator iter.each do |i| ... i is the iterator itself end @/code
This is slightly more convenient than the 'at_end' .. 'next' loop.
This feature has been introduced in version 0.28.
enable_properties
method descriptor
enable_properties() -> None
@brief Enables properties for the given iterator. Afer enabling properties, \prop_id will deliver the effective properties ID for the current shape. By default, properties are not enabled and \prop_id will always return 0 (no properties attached). Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key.
Note that property filters/mappers are additive and act in addition (after) the currently installed filter.
This feature has been introduced in version 0.28.4.
filter_properties
method descriptor
filter_properties() -> None
@brief Filters properties by certain keys. Calling this method will reduce the properties to values with name keys from the 'keys' list. As a side effect, this method enables properties. As with \enable_properties or \remove_properties, this filter has an effect on the value returned by \prop_id, not on the properties ID attached to the shape directly.
Note that property filters/mappers are additive and act in addition (after) the currently installed filter.
This feature has been introduced in version 0.28.4.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
itrans
method descriptor
itrans() -> ICplxTrans
@brief Gets the current transformation by which the shapes must be transformed into the initial cell
The shapes delivered are not transformed. Instead, this transformation must be applied to get the shape in the coordinate system of the top cell.
Starting with version 0.25, this transformation is a int-to-int transformation the 'itrans' method which was providing this transformation before is deprecated.
layer
method descriptor
layer() -> int
@brief Returns the layer index where the current shape is coming from.
This method has been introduced in version 0.23.
layout
method descriptor
layout() -> Layout
@brief Gets the layout this iterator is connected to
This method has been introduced in version 0.23.
map_properties
method descriptor
map_properties() -> None
@brief Maps properties by name key. Calling this method will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Property values with keys not listed in the key map will be removed. As a side effect, this method enables properties. As with \enable_properties or \remove_properties, this filter has an effect on the value returned by \prop_id, not on the properties ID attached to the shape directly.
Note that property filters/mappers are additive and act in addition (after) the currently installed filter.
This feature has been introduced in version 0.28.4.
new
builtin
new(layout: Layout, cell: Cell, layer: int) -> RecursiveShapeIterator
new(layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator
new(layout: Layout, cell: Cell, layer: int, region: Region, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator
new(layout: Layout, cell: Cell, layers: Sequence[int]) -> RecursiveShapeIterator
new(layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator
new(layout: Layout, cell: Cell, layers: Sequence[int], region: Region, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator
new()
@brief Creates a recursive, multi-layer shape iterator with a region. @param layout The layout which shall be iterated @param cell The initial cell which shall be iterated (including its children) @param layers The layer indexes from which the shapes are taken @param region The search region @param overlapping If set to true, shapes overlapping the search region are reported, otherwise touching is sufficient
This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. While iterating use the \layer method to retrieve the layer of the current shape.
The search is confined to the region given by the "region" parameter. The region needs to be a rectilinear region. If "overlapping" is true, shapes whose bounding box is overlapping the search region are reported. If "overlapping" is false, shapes whose bounding box touches the search region are reported.
This constructor has been introduced in version 0.23. The 'overlapping' parameter has been made optional in version 0.27.
next
method descriptor
next() -> None
@brief Increments the iterator This moves the iterator to the next shape inside the search scope.
path
method descriptor
path() -> List[InstElement]
@brief Gets the instantiation path of the shape addressed currently
This attribute is a sequence of \InstElement objects describing the cell instance path from the initial cell to the current cell containing the current shape.
This method has been introduced in version 0.25.
prop_id
method descriptor
prop_id() -> int
@brief Gets the effective properties ID The shape iterator supports property filtering and translation. This method will deliver the effective property ID after translation. The original property ID can be obtained from 'shape.prop_id' and is not changed by installing filters or mappers.
\prop_id is evaluated by \Region objects for example, when they are created from a shape iterator.
See \enable_properties, \filter_properties, \remove_properties and \map_properties for details on this feature.
This attribute has been introduced in version 0.28.4.
remove_properties
method descriptor
remove_properties() -> None
@brief Removes properties for the given container. This will remove all properties and \prop_id will deliver 0 always (no properties attached). Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key.
Note that property filters/mappers are additive and act in addition (after) the currently installed filter. So effectively after 'remove_properties' you cannot get them back.
This feature has been introduced in version 0.28.4.
reset
method descriptor
reset() -> None
@brief Resets the iterator to the initial state
This method has been introduced in version 0.23.
reset_selection
method descriptor
reset_selection() -> None
@brief Resets the selection to the default state
In the initial state, the top cell and its children are selected. Child cells can be switched on and off together with their sub-hierarchy using \select_cells and \unselect_cells.
This method will also reset the iterator.
This method has been introduced in version 0.23.
select_all_cells
method descriptor
select_all_cells() -> None
@brief Selects all cells.
This method will set the "selected" mark on all cells. The effect is that subsequent calls of \unselect_cells will unselect only the specified cells, not their children, because they are still unselected.
This method will also reset the iterator.
This method has been introduced in version 0.23.
select_cells
method descriptor
select_cells(cells: Sequence[int]) -> None
select_cells(cells: str) -> None
select_cells()
@brief Unselects the given cells.
This method will sets the "selected" mark on the given cells. That means that these cells or their child cells are visited, unless they are marked as "unselected" again with the \unselect_cells method.
The cells are given as a glob pattern. A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A").
This method will also reset the iterator.
This method has been introduced in version 0.23.
shape
method descriptor
shape() -> Shape
@brief Gets the current shape
Returns the shape currently referred to by the recursive iterator. This shape is not transformed yet and is located in the current cell.
top_cell
method descriptor
top_cell() -> Cell
@brief Gets the top cell this iterator is connected to
This method has been introduced in version 0.23.
trans
method descriptor
trans() -> ICplxTrans
@brief Gets the current transformation by which the shapes must be transformed into the initial cell
The shapes delivered are not transformed. Instead, this transformation must be applied to get the shape in the coordinate system of the top cell.
Starting with version 0.25, this transformation is a int-to-int transformation the 'itrans' method which was providing this transformation before is deprecated.
unselect_all_cells
method descriptor
unselect_all_cells() -> None
@brief Unselects all cells.
This method will set the "unselected" mark on all cells. The effect is that subsequent calls of \select_cells will select only the specified cells, not their children, because they are still unselected.
This method will also reset the iterator.
This method has been introduced in version 0.23.
unselect_cells
method descriptor
unselect_cells(cells: Sequence[int]) -> None
unselect_cells(cells: str) -> None
unselect_cells()
@brief Unselects the given cells.
This method will sets the "unselected" mark on the given cells. That means that these cells or their child cells will not be visited, unless they are marked as "selected" again with the \select_cells method.
The cells are given as a glob pattern. A glob pattern follows the syntax of file names on the shell (i.e. "A*" are all cells starting with a letter "A").
This method will also reset the iterator.
This method has been introduced in version 0.23.
Region
Bases: klayout.dbcore.ShapeCollection
@brief A region (a potentially complex area consisting of multiple polygons)
This class was introduced to simplify operations on polygon sets like boolean or sizing operations. Regions consist of many polygons and thus are a generalization of single polygons which describes a single coherence set of points. Regions support a variety of operations and have several states.
The region's state can be empty (does not contain anything) or box-like, i.e. the region consists of a single box. In that case, some operations can be simplified. Regions can have merged state. In merged state, regions consist of merged (non-touching, non-self overlapping) polygons. Each polygon describes one coherent area in merged state.
The preferred representation of polygons inside the region are polygons with holes.
Regions are always expressed in database units. If you want to use regions from different database unit domains, scale the regions accordingly, i.e. by using the \transformed method.
Regions provide convenient operators for the boolean operations. Hence it is often no longer required to work with the \EdgeProcessor class. For example:
@code r1 = RBA::Region::new(RBA::Box::new(0, 0, 100, 100)) r2 = RBA::Region::new(RBA::Box::new(20, 20, 80, 80))
compute the XOR:
r1_xor_r2 = r1 ^ r2 @/code
Regions can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected polygons are considered to belong together and are effectively merged. Overlapping areas are counted once in that mode. Internal edges (i.e. arising from cut lines) are not considered. In raw mode (without merged semantics), each polygon is considered as it is. Overlaps between polygons 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.
All
class
All: EdgeMode = All (0)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
AlwaysIncludeZeroDistance
class
AlwaysIncludeZeroDistance: ZeroDistanceMode = AlwaysIncludeZeroDistance (4)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
Concave
class
Concave: EdgeMode = Concave (2)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
Convex
class
Convex: EdgeMode = Convex (1)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
DifferentPropertiesConstraint
class
DifferentPropertiesConstraint: PropertyConstraint = DifferentPropertiesConstraint (4)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
DifferentPropertiesConstraintDrop
class
DifferentPropertiesConstraintDrop: PropertyConstraint = DifferentPropertiesConstraintDrop (5)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
Euclidian
class
Euclidian: Metrics = Euclidian (1)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
FourSidesAllowed
class
FourSidesAllowed: RectFilter = FourSidesAllowed (983040)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
IgnoreProperties
class
IgnoreProperties: PropertyConstraint = IgnoreProperties (0)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
IncludeZeroDistanceWhenCollinearAndTouching
class
IncludeZeroDistanceWhenCollinearAndTouching: ZeroDistanceMode = IncludeZeroDistanceWhenCollinearAndTouching (2)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenOverlapping
class
IncludeZeroDistanceWhenOverlapping: ZeroDistanceMode = IncludeZeroDistanceWhenOverlapping (3)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenTouching
class
IncludeZeroDistanceWhenTouching: ZeroDistanceMode = IncludeZeroDistanceWhenTouching (1)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
NeverIncludeZeroDistance
class
NeverIncludeZeroDistance: ZeroDistanceMode = NeverIncludeZeroDistance (0)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
NoOppositeFilter
class
NoOppositeFilter: OppositeFilter = NoOppositeFilter (0)
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
NoPropertyConstraint
class
NoPropertyConstraint: PropertyConstraint = NoPropertyConstraint (1)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
NoRectFilter
class
NoRectFilter: RectFilter = NoRectFilter (0)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
NotConcave
class
NotConcave: EdgeMode = NotConcave (7)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotConvex
class
NotConvex: EdgeMode = NotConvex (6)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotOpposite
class
NotOpposite: OppositeFilter = NotOpposite (2)
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
NotStep
class
NotStep: EdgeMode = NotStep (10)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotStepIn
class
NotStepIn: EdgeMode = NotStepIn (8)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
NotStepOut
class
NotStepOut: EdgeMode = NotStepOut (9)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
OneSideAllowed
class
OneSideAllowed: RectFilter = OneSideAllowed (1)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
OnlyOpposite
class
OnlyOpposite: OppositeFilter = OnlyOpposite (1)
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
Projection
class
Projection: Metrics = Projection (3)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
SamePropertiesConstraint
class
SamePropertiesConstraint: PropertyConstraint = SamePropertiesConstraint (2)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
SamePropertiesConstraintDrop
class
SamePropertiesConstraintDrop: PropertyConstraint = SamePropertiesConstraintDrop (3)
@brief This class represents the property constraint for boolean and check functions.
This enum has been introduced in version 0.28.4.
Square
class
Square: Metrics = Square (2)
@brief This class represents the metrics type for \Region#width and related checks.
This enum has been introduced in version 0.27.
Step
class
Step: EdgeMode = Step (5)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
StepIn
class
StepIn: EdgeMode = StepIn (3)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
StepOut
class
StepOut: EdgeMode = StepOut (4)
@brief This class represents the edge mode type for \Region#edges.
This enum has been introduced in version 0.29.
ThreeSidesAllowed
class
ThreeSidesAllowed: RectFilter = ThreeSidesAllowed (28672)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
TwoConnectedSidesAllowed
class
TwoConnectedSidesAllowed: RectFilter = TwoConnectedSidesAllowed (48)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
TwoOppositeSidesAllowed
class
TwoOppositeSidesAllowed: RectFilter = TwoOppositeSidesAllowed (1280)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
TwoSidesAllowed
class
TwoSidesAllowed: RectFilter = TwoSidesAllowed (1328)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = "@brief A region (a potentially complex area consisting of multiple polygons)\n\n\nThis class was introduced to simplify operations on polygon sets like boolean or sizing operations. Regions consist of many polygons and thus are a generalization of single polygons which describes a single coherence set of points. Regions support a variety of operations and have several states. \n\nThe region's state can be empty (does not contain anything) or box-like, i.e. the region consists of a single box. In that case, some operations can be simplified. Regions can have merged state. In merged state, regions consist of merged (non-touching, non-self overlapping) polygons. Each polygon describes one coherent area in merged state.\n\nThe preferred representation of polygons inside the region are polygons with holes.\n\nRegions are always expressed in database units. If you want to use regions from different database unit domains, scale the regions accordingly, i.e. by using the \\transformed method.\n\n\nRegions provide convenient operators for the boolean operations. Hence it is often no longer required to work with the \\EdgeProcessor class. For example:\n\n@code\nr1 = RBA::Region::new(RBA::Box::new(0, 0, 100, 100))\nr2 = RBA::Region::new(RBA::Box::new(20, 20, 80, 80))\n# compute the XOR:\nr1_xor_r2 = r1 ^ r2\n@/code\n\nRegions can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected polygons are considered to belong together and are effectively merged.\nOverlapping areas are counted once in that mode. Internal edges (i.e. arising from cut lines) are not considered.\nIn raw mode (without merged semantics), each polygon is considered as it is. Overlaps between polygons\nmay exists and merging has to be done explicitly using the \\merge method. The semantics can be\nselected using \\merged_semantics=.\n\n\nThis class has been introduced in version 0.23.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 205
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
base_verbosity
class
base_verbosity: int = <attribute 'base_verbosity' of 'Region' objects>
@brief Gets the minimum verbosity for timing reports See \base_verbosity= for details.
This method has been introduced in version 0.26.
@brief Sets the minimum verbosity for timing reports Timing reports will be given only if the verbosity is larger than this value. Detailed reports will be given when the verbosity is more than this value plus 10. In binary operations, the base verbosity of the first argument is considered.
This method has been introduced in version 0.26.
merged_semantics
class
merged_semantics: bool = <attribute 'merged_semantics' of 'Region' objects>
@brief Gets a flag indicating whether merged semantics is enabled See \merged_semantics= for a description of this attribute.
@brief Enables or disables merged semantics If merged semantics is enabled (the default), coherent polygons will be considered as single regions and artificial edges such as cut-lines will not be considered. Merged semantics thus is equivalent to considering coherent areas rather than single polygons
min_coherence
class
min_coherence: bool = <attribute 'min_coherence' of 'Region' objects>
@brief Gets a flag indicating whether minimum coherence is selected See \min_coherence= for a description of this attribute.
@brief Enable or disable minimum coherence If minimum coherence is set, the merge operations (explicit merge with \merge or implicit merge through merged_semantics) are performed using minimum coherence mode. The coherence mode determines how kissing-corner situations are resolved. If minimum coherence is selected, they are resolved such that multiple polygons are created which touch at a corner).
The default setting is maximum coherence (min_coherence = false).
strict_handling
class
strict_handling: bool = <attribute 'strict_handling' of 'Region' objects>
@brief Gets a flag indicating whether merged semantics is enabled See \strict_handling= for a description of this attribute.
This method has been introduced in version 0.23.2.
@brief Enables or disables strict handling
Strict handling means to leave away some optimizations. Specifically the output of boolean operations will be merged even if one input is empty. Without strict handling, the operation will be optimized and output won't be merged.
Strict handling is disabled by default and optimization is in place.
This method has been introduced in version 0.23.2.
OppositeFilter
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
NoOppositeFilter
class
NoOppositeFilter: OppositeFilter = NoOppositeFilter (0)
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
NotOpposite
class
NotOpposite: OppositeFilter = NotOpposite (2)
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
OnlyOpposite
class
OnlyOpposite: OppositeFilter = OnlyOpposite (1)
@brief This class represents the opposite error filter mode for \Region#separation and related checks.
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the opposite error filter mode for \\Region#separation and related checks.\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 207
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'OppositeFilter' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Region.OppositeFilter) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> Region.OppositeFilter
new(s: str) -> Region.OppositeFilter
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
RectFilter
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
FourSidesAllowed
class
FourSidesAllowed: RectFilter = FourSidesAllowed (983040)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
NoRectFilter
class
NoRectFilter: RectFilter = NoRectFilter (0)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
OneSideAllowed
class
OneSideAllowed: RectFilter = OneSideAllowed (1)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
ThreeSidesAllowed
class
ThreeSidesAllowed: RectFilter = ThreeSidesAllowed (28672)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
TwoConnectedSidesAllowed
class
TwoConnectedSidesAllowed: RectFilter = TwoConnectedSidesAllowed (48)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
TwoOppositeSidesAllowed
class
TwoOppositeSidesAllowed: RectFilter = TwoOppositeSidesAllowed (1280)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
TwoSidesAllowed
class
TwoSidesAllowed: RectFilter = TwoSidesAllowed (1328)
@brief This class represents the error filter mode on rectangles for \Region#separation and related checks.
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the error filter mode on rectangles for \\Region#separation and related checks.\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 206
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'RectFilter' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Region.RectFilter) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> Region.RectFilter
new(s: str) -> Region.RectFilter
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__add__
method descriptor
__add__() -> Region
@brief Returns the combined region of self and the other region
@return The resulting region
This operator adds the polygons of the other region to self and returns a new combined region. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged.
The 'join' alias has been introduced in version 0.28.12.
__and__
method descriptor
__and__() -> Region
@brief Returns the boolean AND between self and the other region
@return The result of the boolean AND operation
This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged.
__copy__
method descriptor
__copy__() -> Region
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Region
@brief Creates a copy of self
__getitem__
method descriptor
__getitem__() -> Polygon
@brief Returns the nth polygon of the region
This method returns nil if the index is out of range. It is available for flat regions only - i.e. those for which \has_valid_polygons? is true. Use \flatten to explicitly flatten a region. This method returns the raw polygon (not merged polygons, even if merged semantics is enabled).
The \each iterator is the more general approach to access the polygons.
__iadd__
method descriptor
__iadd__() -> Region
@brief Adds the polygons of the other region to self
@return The region after modification (self)
This operator adds the polygons of the other region to self. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
__iand__
method descriptor
__iand__() -> Region
@brief Performs the boolean AND between self and the other region in-place (modifying self)
@return The region after modification (self)
This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged.
Note that in Ruby, the '&=' operator actually does not exist, but is emulated by '&' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'and_with' instead.
__init__
method descriptor
__init__() -> None
__init__(array: Sequence[Polygon]) -> None
__init__(box: Box) -> None
__init__(path: Path) -> None
__init__(polygon: Polygon) -> None
__init__(polygon: SimplePolygon) -> None
__init__(shape_iterator: RecursiveShapeIterator) -> None
__init__(shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None
__init__(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None
__init__(shapes: Shapes) -> None
__init__(shapes: Shapes, trans: ICplxTrans) -> None
__init__()
@brief Constructor from a text set
@param shape_iterator The iterator from which to derive the texts @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. @param expr The selection string @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) This special constructor will create a deep region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available:
@code region = RBA::Region::new(iter, dss, "") # all texts region = RBA::Region::new(iter, dss, "A") # all texts starting with an 'A' region = RBA::Region::new(iter, dss, "A", false) # all texts exactly matching 'A' @/code
This variant has been introduced in version 0.26.
__ior__
method descriptor
__ior__() -> Region
@brief Performs the boolean OR between self and the other region in-place (modifying self)
@return The region after modification (self)
The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. Note that in Ruby, the '|=' operator actually does not exist, but is emulated by '|' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'or_with' instead.
The 'or_with' alias has been introduced in version 0.28.12.
__isub__
method descriptor
__isub__() -> Region
@brief Performs the boolean NOT between self and the other region in-place (modifying self)
@return The region after modification (self)
This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged.
Note that in Ruby, the '-=' operator actually does not exist, but is emulated by '-' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'not_with' instead.
__iter__
method descriptor
__iter__() -> Iterator[Polygon]
@brief Returns each polygon of the region
This returns the raw polygons (not merged polygons if merged semantics is enabled).
__ixor__
method descriptor
__ixor__() -> Region
@brief Performs the boolean XOR between self and the other region in-place (modifying self)
@return The region after modification (self)
This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged.
Note that in Ruby, the '^=' operator actually does not exist, but is emulated by '^' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'xor_with' instead.
The 'xor_with' alias has been introduced in version 0.28.12.
__len__
method descriptor
__len__() -> int
@brief Returns the (flat) number of polygons in the region
This returns the number of raw polygons (not merged polygons if merged semantics is enabled). The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated.
The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias.
__or__
method descriptor
__or__() -> Region
@brief Returns the boolean OR between self and the other region
@return The resulting region
The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. The 'or' alias has been introduced in version 0.28.12.
__repr__
method descriptor
__repr__() -> str
@brief Converts the region to a string The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter.
__str__
method descriptor
__str__() -> str
@brief Converts the region to a string The length of the output is limited to 20 polygons to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter.
__sub__
method descriptor
__sub__() -> Region
@brief Returns the boolean NOT between self and the other region
@return The result of the boolean NOT operation
This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged.
__xor__
method descriptor
__xor__() -> Region
@brief Returns the boolean XOR between self and the other region
@return The result of the boolean XOR operation
This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged.
The 'xor' alias has been introduced in version 0.28.12.
and_
method descriptor
and_() -> Region
@brief Returns the boolean AND between self and the other region
@return The result of the boolean AND operation
This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties.
This variant has been introduced in version 0.28.4.
and_with
method descriptor
and_with() -> Region
@brief Performs the boolean AND between self and the other region in-place (modifying self)
@return The region after modification (self)
This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties.
This variant has been introduced in version 0.28.4.
andnot
method descriptor
andnot() -> List[Region]
@brief Returns the boolean AND and NOT between self and the other region
@return A two-element array of regions with the first one being the AND result and the second one being the NOT result
This method will compute the boolean AND and NOT between two regions simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately.
This method has been added in version 0.27.
area
method descriptor
area() -> int
area(rect: Box) -> int
area()
@brief The area of the region (restricted to a rectangle) This version will compute the area of the shapes, restricting the computation to the given rectangle.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept) If merged semantics is not enabled, overlapping areas are counted twice.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Return the bounding box of the region The bounding box is the box enclosing all points of all polygons.
begin_merged_shapes_rec
method descriptor
begin_merged_shapes_rec() -> Any
@brief Returns a recursive shape iterator plus a transformation for the shapes constituting the merged region. It can be used like \begin_shapes_rec, but delivers shapes from the merged polygons pool.
This speciality method was introduced in version 0.29.5.
begin_shapes_rec
method descriptor
begin_shapes_rec() -> Any
@brief Returns a recursive shape iterator plus a transformation for the shapes constituting this region. This method returns a pair consisting of a \RecursiveShapeIterator plus a \ICplxTrans transformation. Both objects allow accessing the shapes (polygons) of the region in a detailed fashion. To iterate the the polygons use a code like this:
@code iter, trans = region.begin_shapes_rec iter.each do |i| polygon = trans * iter.trans * i.shape.polygon ... end @/code
This method is the most powerful way of accessing the shapes inside the region. I allows for example to obtain the properties attached to the polygons of the region. It is primarily intended for special applications like iterating net-annotated shapes.
This speciality method was introduced in version 0.29.5.
break_
method descriptor
break_() -> None
@brief Breaks the polygons of the region into smaller ones
There are two criteria for splitting a polygon: a polygon is split into parts with less then 'max_vertex_count' points and an bounding box-to-polygon area ratio less than 'max_area_ratio'. The area ratio is supposed to render polygons whose bounding box is a better approximation. This applies for example to 'L' shape polygons.
Using a value of 0 for either limit means that the respective limit isn't checked. Breaking happens by cutting the polygons into parts at 'good' locations. The algorithm does not have a specific goal to minimize the number of parts for example. The only goal is to achieve parts within the given limits.
This method has been introduced in version 0.26. The 'break_polygons' alias has been introduced in version 0.29.5 to avoid issues with reserved keywords.
break_polygons
method descriptor
break_polygons() -> None
@brief Breaks the polygons of the region into smaller ones
There are two criteria for splitting a polygon: a polygon is split into parts with less then 'max_vertex_count' points and an bounding box-to-polygon area ratio less than 'max_area_ratio'. The area ratio is supposed to render polygons whose bounding box is a better approximation. This applies for example to 'L' shape polygons.
Using a value of 0 for either limit means that the respective limit isn't checked. Breaking happens by cutting the polygons into parts at 'good' locations. The algorithm does not have a specific goal to minimize the number of parts for example. The only goal is to achieve parts within the given limits.
This method has been introduced in version 0.26. The 'break_polygons' alias has been introduced in version 0.29.5 to avoid issues with reserved keywords.
clear
method descriptor
clear() -> None
@brief Clears the region
complex_op
method descriptor
complex_op() -> Any
@brief Executes a complex operation (see \CompoundRegionOperationNode for details)
This method has been introduced in version 0.27. The 'property_constraint' parameter controls whether properties are considered: with 'SamePropertiesConstraint' the operation is only applied between shapes with identical properties. With 'DifferentPropertiesConstraint' only between shapes with different properties. This option has been introduced in version 0.28.4.
corners
method descriptor
corners() -> Region
@brief This method will select all corners whose attached edges satisfy the angle condition.
The angle values specify a range of angles: all corners whose attached edges form an angle between angle_min and angle_max will be reported boxes with 2dim x 2dim dimension. The default dimension is 2x2 DBU.
If 'include_angle_min' is true, the angle condition is >= min. angle, otherwise it is > min. angle. Same for 'include_angle_,ax' and the max. angle.
With 'absolute' set to false (the default), the angle is measured between the incoming and the outcoming edge in mathematical sense: a positive value is a turn left while a negative value is a turn right. Since polygon contours are oriented clockwise, positive angles will report concave corners while negative ones report convex ones. With the 'absolute' option set to true, there is no such distinction and angle values are always positive.
With 'inverse' set to true, the method will select corners not meeting the angle criterion.
A similar function that reports corners as point-like edges is \corners_dots.
This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. 'inverse' and 'absolute' have been added in version 0.29.1.
corners_dots
method descriptor
corners_dots() -> Edges
@brief This method will select all corners whose attached edges satisfy the angle condition.
This method is similar to \corners, but delivers an \Edges collection with dot-like edges for each corner.
This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. 'inverse' and 'absolute' have been added in version 0.29.1.
corners_edge_pairs
method descriptor
corners_edge_pairs() -> EdgePairs
@brief This method will select all corners whose attached edges satisfy the angle condition.
This method is similar to \corners, but delivers an \EdgePairs collection with an edge pairs for each corner. The first edge is the incoming edge of the corner, the second one the outgoing edge.
This method has been introduced in version 0.27.1. 'inverse' and 'absolute' have been added in version 0.29.1.
count
method descriptor
count() -> int
@brief Returns the (flat) number of polygons in the region
This returns the number of raw polygons (not merged polygons if merged semantics is enabled). The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated.
The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias.
covering
method descriptor
covering() -> Region
@brief Returns the polygons of this region which are completely covering polygons from the other region
@return A new region containing the polygons which are covering polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function.
This method has been introduced in version 0.27.
create
method descriptor
create() -> None
@brief 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.
data_id
method descriptor
data_id() -> int
@brief Returns the data ID (a unique identifier for the underlying data storage)
This method has been added in version 0.26.
decompose_convex
method descriptor
decompose_convex() -> Shapes
@brief Decomposes the region into convex pieces.
This method will return a \Shapes container that holds a decomposition of the region into convex, simple polygons. See \Polygon#decompose_convex for details. If you want \Region output, you should use \decompose_convex_to_region.
This method has been introduced in version 0.25.
decompose_convex_to_region
method descriptor
decompose_convex_to_region() -> Region
@brief Decomposes the region into convex pieces into a region.
This method is identical to \decompose_convex, but delivers a \Region object.
This method has been introduced in version 0.25.
decompose_trapezoids
method descriptor
decompose_trapezoids() -> Shapes
@brief Decomposes the region into trapezoids.
This method will return a \Shapes container that holds a decomposition of the region into trapezoids. See \Polygon#decompose_trapezoids for details. If you want \Region output, you should use \decompose_trapezoids_to_region.
This method has been introduced in version 0.25.
decompose_trapezoids_to_region
method descriptor
decompose_trapezoids_to_region() -> Region
@brief Decomposes the region into trapezoids.
This method is identical to \decompose_trapezoids, but delivers a \Region object.
This method has been introduced in version 0.25.
delaunay
method descriptor
delaunay() -> Region
delaunay(max_area: float, min_b: Optional[float] = ...) -> Region
delaunay()
@brief Computes a refined, constrained Delaunay triangulation from the given region
@return A new region holding the triangles of the refined, constrained Delaunay triangulation.
Refinement is implemented by Chew's second algorithm. A maximum area can be given. Triangles larger than this area will be split. In addition 'skinny' triangles will be resolved where possible. 'skinny' is defined in terms of shortest edge to circumcircle radius ratio (b). A minimum number for b can be given. The default of 1.0 corresponds to a minimum angle of 30 degree and is usually a good choice. The algorithm is stable up to roughly 1.2 which corresponds to a minimum angle of abouth 37 degree.
The minimum angle of the resulting triangles relates to the 'b' parameter as: @t min_angle = arcsin(B/2) @/t.
The area value is given in terms of DBU units. Picking a value of 0.0 for area and min b will make the implementation skip the refinement step. In that case, the results are identical to the standard constrained Delaunay triangulation.
Note that the result is a region in raw mode as otherwise the triangles are likely to get merged later on.
This method has been introduced in version 0.29.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
disable_progress
method descriptor
disable_progress() -> None
@brief Disable progress reporting Calling this method will disable progress reporting. See \enable_progress.
drc_hull
method descriptor
drc_hull() -> Region
@brief Computes a visualization of the forbidden region for a DRC space check
@param metrics The metrics to apply @param space The space value to apply @param n_circle The full-circle number of points for the Euclidian space visualization
@return The new polygons representing the forbidden region.
This method has been introduced in version 0.29.1.
dup
method descriptor
dup() -> Region
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[Polygon]
@brief Returns each polygon of the region
This returns the raw polygons (not merged polygons if merged semantics is enabled).
each_merged
method descriptor
each_merged() -> Iterator[Polygon]
@brief Returns each merged polygon of the region
This returns the raw polygons if merged semantics is disabled or the merged ones if merged semantics is enabled.
edges
method descriptor
edges() -> Edges
@brief Returns an edge collection representing all edges of the polygons in this region This method will decompose the polygons into the individual edges. Edges making up the hulls of the polygons are oriented clockwise while edges making up the holes are oriented counterclockwise.
The 'mode' parameter allows selecting specific edges, such as convex or concave ones. By default, all edges are selected.
The edge collection returned can be manipulated in various ways. See \Edges for a description of the features of the edge collection.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
The mode argument has been added in version 0.29.
enable_progress
method descriptor
enable_progress() -> None
@brief Enable progress reporting After calling this method, the region 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.
enable_properties
method descriptor
enable_properties() -> None
@brief Enables properties for the given container. This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key.
This method has been introduced in version 0.28.4.
enclosed_check
method descriptor
enclosed_check() -> EdgePairs
@brief Performs an inside check with options @param d The minimum distance for which the polygons are checked @param other The other region against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. The 'enclosed_check' alias was introduced in version 0.27.5. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
enclosing_check
method descriptor
enclosing_check() -> EdgePairs
@brief Performs an enclosing check with options @param d The minimum enclosing distance for which the polygons are checked @param other The other region against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the enclosure is larger or equal to the limit. This is a way to flag the parts of the first input where the enclosure vs. the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
extent_refs
method descriptor
extent_refs() -> Region
@hide This method is provided for DRC implementation.
extent_refs_edges
method descriptor
extent_refs_edges() -> Edges
@hide This method is provided for DRC implementation.
extents
method descriptor
extents() -> Region
extents(d: int) -> Region
extents(dx: int, dy: int) -> Region
extents()
@brief Returns a region with the enlarged bounding boxes of the polygons This method will return a region consisting of the bounding boxes of the polygons 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.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
fill
method descriptor
fill(in_cell: Cell, fill_cell_index: int, fc_box: Box, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None
fill(in_cell: Cell, fill_cell_index: int, fc_origin: Box, row_step: Vector, column_step: Vector, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None
fill()
@brief A mapping of \Cell#fill_region to the Region class
This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter).
This method has been introduced in version 0.27.
fill_multi
method descriptor
fill_multi() -> None
@brief A mapping of \Cell#fill_region to the Region class
This method is equivalent to \Cell#fill_region, but is based on Region (with the cell being the first parameter).
This method has been introduced in version 0.27.
filter
method descriptor
filter() -> None
@brief Applies a generic filter in place (replacing the polygons from the Region) See \PolygonFilter for a description of this feature.
This method has been introduced in version 0.29.
filter_properties
method descriptor
filter_properties() -> None
@brief Filters properties by certain keys. Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
filtered
method descriptor
filtered() -> Region
@brief Applies a generic filter and returns a filtered copy See \PolygonFilter for a description of this feature.
This method has been introduced in version 0.29.
flatten
method descriptor
flatten() -> Region
@brief Explicitly flattens a region
If the region is already flat (i.e. \has_valid_polygons? returns true), this method will not change it.
Returns 'self', so this method can be used in a dot concatenation.
This method has been introduced in version 0.26.
grid_check
method descriptor
grid_check() -> EdgePairs
@brief Returns a marker for all vertices not being on the given grid This method will return an edge pair object for every vertex whose x coordinate is not a multiple of gx or whose y coordinate is not a multiple of gy. The edge pair objects contain two edges consisting of the same single point - the original vertex.
If gx or gy is 0 or less, the grid is not checked in that direction.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
has_valid_polygons
method descriptor
has_valid_polygons() -> bool
@brief Returns true if the region is flat and individual polygons can be accessed randomly
This method has been introduced in version 0.26.
hier_count
method descriptor
hier_count() -> int
@brief Returns the (hierarchical) number of polygons in the region
This returns the number of raw polygons (not merged polygons if merged semantics is enabled). The count is computed 'hierarchical', i.e. polygons inside a cell are counted once even if the cell is instantiated multiple times.
This method has been introduced in version 0.27.
holes
method descriptor
holes() -> Region
@brief Returns the holes of the region This method returns all holes as filled polygons.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept) If merge semantics is not enabled, the holes may not be detected if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes.
hulls
method descriptor
hulls() -> Region
@brief Returns the hulls of the region This method returns all hulls as polygons. The holes will be removed (filled). Merged semantics applies for this method (see \merged_semantics= for a description of this concept) If merge semantics is not enabled, the hull may also enclose holes if the polygons are taken from a hole-less representation (i.e. GDS2 file). Use explicit merge (\merge method) in order to merge the polygons and detect holes.
in_
method descriptor
in_() -> Region
@brief Returns all polygons which are members of the other region This method returns all polygons in self which can be found in the other region as well with exactly the same geometry.
in_and_out
method descriptor
in_and_out() -> List[Region]
@brief Returns all polygons which are members and not members of the other region This method is equivalent to calling \members_of and \not_members_of, but delivers both results at the same time and is more efficient than two separate calls. The first element returned is the \members_of part, the second is the \not_members_of part.
This method has been introduced in version 0.28.
insert
method descriptor
insert(array: Sequence[Polygon]) -> None
insert(box: Box) -> None
insert(path: Path) -> None
insert(polygon: Polygon) -> None
insert(polygon: SimplePolygon) -> None
insert(region: Region) -> None
insert(shape_iterator: RecursiveShapeIterator) -> None
insert(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None
insert(shapes: Shapes) -> None
insert(shapes: Shapes, trans: ICplxTrans) -> None
insert(shapes: Shapes, trans: Trans) -> None
insert()
@brief Inserts all polygons from the shape collection into this region with complex transformation This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region after applying the given complex transformation. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored.
This method has been introduced in version 0.25.
insert_into
method descriptor
insert_into() -> None
@brief Inserts this region into the given layout, below the given cell and into the given layer. If the region is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused.
This method has been introduced in version 0.26.
inside
method descriptor
inside() -> Region
@brief Returns the polygons of this region which are completely inside polygons from the other region
@return A new region containing the polygons which are inside polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
inside_check
method descriptor
inside_check() -> EdgePairs
@brief Performs an inside check with options @param d The minimum distance for which the polygons are checked @param other The other region against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the distance is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. The 'enclosed_check' alias was introduced in version 0.27.5. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
interacting
method descriptor
interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
interacting(other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
interacting()
@brief Returns the polygons of this region which overlap or touch texts
'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon selected. A polygon is selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count).
@return A new region containing the polygons overlapping or touching texts
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27
is_box
method descriptor
is_box() -> bool
@brief Returns true, if the region is a simple box
@return True if the region is a box.
This method does not apply implicit merging if merge semantics is enabled. If the region is not merged, this method may return false even if the merged region would be a box.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_deep
method descriptor
is_deep() -> bool
@brief Returns true if the region is a deep (hierarchical) one
This method has been added in version 0.26.
is_empty
method descriptor
is_empty() -> bool
@brief Returns true if the region is empty
is_merged
method descriptor
is_merged() -> bool
@brief Returns true if the region is merged If the region is merged, polygons will not touch or overlap. You can ensure merged state by calling \merge.
isolated_check
method descriptor
isolated_check() -> EdgePairs
@brief Performs a space check between edges of different polygons with options @param d The minimum space for which the polygons are checked @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative If true, edges not violation the condition will be output as pseudo-edge pairs @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
join
method descriptor
join() -> Region
@brief Returns the combined region of self and the other region
@return The resulting region
This operator adds the polygons of the other region to self and returns a new combined region. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged.
The 'join' alias has been introduced in version 0.28.12.
join_with
method descriptor
join_with() -> Region
@brief Adds the polygons of the other region to self
@return The region after modification (self)
This operator adds the polygons of the other region to self. This usually creates unmerged regions and polygons may overlap. Use \merge if you want to ensure the result region is merged.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
map_properties
method descriptor
map_properties() -> None
@brief Maps properties by name key. Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
members_of
method descriptor
members_of() -> Region
@brief Returns all polygons which are members of the other region This method returns all polygons in self which can be found in the other region as well with exactly the same geometry.
merge
method descriptor
merge() -> Region
merge(min_coherence: bool, min_wc: int) -> Region
merge(min_wc: int) -> Region
merge()
@brief Merge the region with options
@param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence @param min_wc Overlap selection @return The region after is has been merged (self).
Merging removes overlaps and joins touching polygons. This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap.
merged
method descriptor
merged() -> Region
merged(min_coherence: bool, min_wc: int) -> Region
merged(min_wc: int) -> Region
merged()
@brief Returns the merged region (with options)
@param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence @param min_wc Overlap selection @return The region after is has been merged (self).
Merging removes overlaps and joins touching polygons. This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap.
In contrast to \merge, this method does not modify the region but returns a merged copy.
minkowski_sum
method descriptor
minkowski_sum(b: Box) -> Region
minkowski_sum(b: Sequence[Point]) -> Region
minkowski_sum(e: Edge) -> Region
minkowski_sum(p: Polygon) -> Region
minkowski_sum()
@brief Compute the Minkowski sum of the region and a contour of points (a trace)
@param b The contour (a series of points forming the trace).
@return The new polygons representing the Minkowski sum of self and the contour.
The Minkowski sum of a region and a contour basically results in the area covered when "dragging" the region along the contour. The effect is similar to drawing the contour with a pencil that has the shape of the given region.
The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
minkowsky_sum
method descriptor
minkowsky_sum(b: Box) -> Region
minkowsky_sum(b: Sequence[Point]) -> Region
minkowsky_sum(e: Edge) -> Region
minkowsky_sum(p: Polygon) -> Region
minkowsky_sum()
@brief Compute the Minkowski sum of the region and a contour of points (a trace)
@param b The contour (a series of points forming the trace).
@return The new polygons representing the Minkowski sum of self and the contour.
The Minkowski sum of a region and a contour basically results in the area covered when "dragging" the region along the contour. The effect is similar to drawing the contour with a pencil that has the shape of the given region.
The resulting polygons are not merged. In order to remove overlaps, use the \merge or \merged method.Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
move
method descriptor
move(v: Vector) -> Region
move(x: int, y: int) -> Region
move()
@brief Moves the region
Moves the region by the given offset and returns the moved region. The region is overwritten.
@param x The x distance to move the region. @param y The y distance to move the region.
@return The moved region (self).
moved
method descriptor
moved(v: Vector) -> Region
moved(x: int, y: int) -> Region
moved()
@brief Returns the moved region (does not modify self)
Moves the region by the given offset and returns the moved region. The region is not modified.
@param x The x distance to move the region. @param y The y distance to move the region.
@return The moved region.
nets
method descriptor
nets() -> Region
@brief Pulls the net shapes from a LayoutToNetlist database This method will create a new layer with the net shapes from the LayoutToNetlist database, provided that this region was an input to the netlist extraction on this database.
A (circuit name, net name) tuple will be attached as properties to the shapes if 'net_prop_name' is given and not nil. This allows generating unique properties per shape, flagging the net the shape is on. This feature is good for performing net-dependent booleans and DRC checks.
A net filter can be provided with the 'net_filter' argument. If given, only nets from this set are produced. Example:
@code connect(metal1, via1) connect(via1, metal2)
metal1_all_nets = metal1.nets @/code
This method was introduced in version 0.28.4.
new
builtin
new() -> Region
new(array: Sequence[Polygon]) -> Region
new(box: Box) -> Region
new(path: Path) -> Region
new(polygon: Polygon) -> Region
new(polygon: SimplePolygon) -> Region
new(shape_iterator: RecursiveShapeIterator) -> Region
new(shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> Region
new(shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> Region
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region
new(shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region
new(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Region
new(shapes: Shapes) -> Region
new(shapes: Shapes, trans: ICplxTrans) -> Region
new()
@brief Constructor from a text set
@param shape_iterator The iterator from which to derive the texts @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. @param expr The selection string @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) This special constructor will create a deep region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available:
@code region = RBA::Region::new(iter, dss, "") # all texts region = RBA::Region::new(iter, dss, "A") # all texts starting with an 'A' region = RBA::Region::new(iter, dss, "A", false) # all texts exactly matching 'A' @/code
This variant has been introduced in version 0.26.
non_rectangles
method descriptor
non_rectangles() -> Region
@brief Returns all polygons which are not rectangles This method returns all polygons in self which are not rectangles.Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
non_rectilinear
method descriptor
non_rectilinear() -> Region
@brief Returns all polygons which are not rectilinear This method returns all polygons in self which are not rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
non_squares
method descriptor
non_squares() -> Region
@brief Returns all polygons which are not squares This method returns all polygons in self which are not squares.Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27.
not_
method descriptor
not_() -> Region
@brief Returns the boolean NOT between self and the other region
@return The result of the boolean NOT operation
This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties.
This variant has been introduced in version 0.28.4.
not_covering
method descriptor
not_covering() -> Region
@brief Returns the polygons of this region which are not completely covering polygons from the other region
@return A new region containing the polygons which are not covering polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function.
This method has been introduced in version 0.27.
not_in
method descriptor
not_in() -> Region
@brief Returns all polygons which are not members of the other region This method returns all polygons in self which can not be found in the other region with exactly the same geometry.
not_inside
method descriptor
not_inside() -> Region
@brief Returns the polygons of this region which are not completely inside polygons from the other region
@return A new region containing the polygons which are not inside polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
not_interacting
method descriptor
not_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
not_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
not_interacting(other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
not_interacting()
@brief Returns the polygons of this region which do not overlap or touch texts
'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon not selected. A polygon is not selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count).
@return A new region containing the polygons not overlapping or touching texts
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27
not_members_of
method descriptor
not_members_of() -> Region
@brief Returns all polygons which are not members of the other region This method returns all polygons in self which can not be found in the other region with exactly the same geometry.
not_outside
method descriptor
not_outside() -> Region
@brief Returns the polygons of this region which are not completely outside polygons from the other region
@return A new region containing the polygons which are not outside polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
not_overlapping
method descriptor
not_overlapping() -> Region
@brief Returns the polygons of this region which do not overlap polygons from the other region
@return A new region containing the polygons not overlapping polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
The count options have been introduced in version 0.27.
not_with
method descriptor
not_with() -> Region
@brief Performs the boolean NOT between self and the other region in-place (modifying self)
@return The region after modification (self)
This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties.
This variant has been introduced in version 0.28.4.
notch_check
method descriptor
notch_check() -> EdgePairs
@brief Performs a space check between edges of the same polygon with options @param d The minimum space for which the polygons are checked @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param negative If true, edges not violation the condition will be output as pseudo-edge pairs @param property_constraint Specifies whether to consider only shapes with a certain property relation @param property_constraint Only \IgnoreProperties and \NoPropertyConstraint are allowed - in the last case, properties are copied from the original shapes to the output@param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded' and 'negative' options have been introduced in version 0.27. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
or_
method descriptor
or_() -> Region
@brief Returns the boolean OR between self and the other region
@return The resulting region
The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. The 'or' alias has been introduced in version 0.28.12.
or_with
method descriptor
or_with() -> Region
@brief Performs the boolean OR between self and the other region in-place (modifying self)
@return The region after modification (self)
The boolean OR is implemented by merging the polygons of both regions. To simply join the regions without merging, the + operator is more efficient. Note that in Ruby, the '|=' operator actually does not exist, but is emulated by '|' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'or_with' instead.
The 'or_with' alias has been introduced in version 0.28.12.
outside
method descriptor
outside() -> Region
@brief Returns the polygons of this region which are completely outside polygons from the other region
@return A new region containing the polygons which are outside polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
overlap_check
method descriptor
overlap_check() -> EdgePairs
@brief Performs an overlap check with options @param d The minimum overlap for which the polygons are checked @param other The other region against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the overlap is larger or equal to the limit. This is a way to flag the parts of the first input where the overlap vs. the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
overlapping
method descriptor
overlapping() -> Region
@brief Returns the polygons of this region which overlap polygons from the other region
@return A new region containing the polygons overlapping polygons from the other region
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
The count options have been introduced in version 0.27.
perimeter
method descriptor
perimeter() -> int
perimeter(rect: Box) -> int
perimeter()
@brief The total perimeter of the polygons (restricted to a rectangle) This version will compute the perimeter of the polygons, 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= for a description of this concept) If merged semantics is not enabled, internal edges are counted as well.
process
method descriptor
process() -> None
@brief Applies a generic polygon processor in place (replacing the polygons from the Region) See \PolygonProcessor for a description of this feature.
This method has been introduced in version 0.29.
processed
method descriptor
processed(processed: PolygonOperator) -> Region
processed(processed: PolygonToEdgeOperator) -> Edges
processed(processed: PolygonToEdgePairOperator) -> EdgePairs
processed()
@brief Applies a generic polygon-to-edge processor and returns an edge collection with the results See \PolygonToEdgeProcessor for a description of this feature.
This method has been introduced in version 0.29.
pull_inside
method descriptor
pull_inside() -> Region
@brief Returns all polygons of "other" which are inside polygons of this region The "pull_..." methods are similar to "select_..." but work the opposite way: they select shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." methods provide a way for re-hierarchization.
@return The region after the polygons have been selected (from other)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.26.1
pull_interacting
method descriptor
pull_interacting(other: Edges) -> Edges
pull_interacting(other: Region) -> Region
pull_interacting(other: Texts) -> Texts
pull_interacting()
@brief Returns all texts of "other" which are interacting with polygons of this region See \pull_inside for a description of the "pull_..." methods.
@return The text collection after the texts have been selected (from other)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27
pull_overlapping
method descriptor
pull_overlapping() -> Region
@brief Returns all polygons of "other" which are overlapping polygons of this region See \pull_inside for a description of the "pull_..." methods.
@return The region after the polygons have been selected (from other)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.26.1
rasterize
method descriptor
rasterize(origin: Point, pixel_distance: Vector, pixel_size: Vector, nx: int, ny: int) -> List[List[float]]
rasterize(origin: Point, pixel_size: Vector, nx: int, ny: int) -> List[List[float]]
rasterize()
@brief A version of 'rasterize' that allows a pixel step distance which is larger than the pixel size This version behaves like the first variant of 'rasterize', but the pixel distance (pixel-to-pixel step raster) can be specified separately from the pixel size. Currently, the pixel size must be equal or smaller than the pixel distance - i.e. the pixels must not overlap.
This method has been added in version 0.29.
rectangles
method descriptor
rectangles() -> Region
@brief Returns all polygons which are rectangles This method returns all polygons in self which are rectangles.Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
rectilinear
method descriptor
rectilinear() -> Region
@brief Returns all polygons which are rectilinear This method returns all polygons in self which are rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
remove_properties
method descriptor
remove_properties() -> None
@brief Removes properties for the given container. This will remove all properties on the given container.
This method has been introduced in version 0.28.4.
round_corners
method descriptor
round_corners() -> None
@brief Corner rounding @param r_inner Inner corner radius (in database units) @param r_outer Outer corner radius (in database units) @param n The number of points per circle
This method rounds the corners of the polygons in the region. Inner corners will be rounded with a radius of r_inner and outer corners with a radius of r_outer. The circles will be approximated by segments using n segments per full circle.
This method modifies the region. \rounded_corners is a method that does the same but returns a new region without modifying self. Merged semantics applies for this method.
rounded_corners
method descriptor
rounded_corners() -> Region
@brief Corner rounding @param r_inner Inner corner radius (in database units) @param r_outer Outer corner radius (in database units) @param n The number of points per circle
See \round_corners for a description of this method. This version returns a new region instead of modifying self (out-of-place).
scale_and_snap
method descriptor
scale_and_snap() -> None
@brief Scales and snaps the region to the given grid This method will first scale the region by a rational factor of mx/dx horizontally and my/dy vertically and then snap the region to the given grid - each x or y coordinate is brought on the gx or gy grid by rounding to the nearest value which is a multiple of gx or gy.
If gx or gy is 0, the result is brought on a grid of 1.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.26.1.
scaled_and_snapped
method descriptor
scaled_and_snapped() -> Region
@brief Returns the scaled and snapped region This method will scale and snap the region to the given grid and return the scaled and snapped region (see \scale_and_snap). The original region is not modified.
This method has been introduced in version 0.26.1.
select_covering
method descriptor
select_covering() -> Region
@brief Selects the polygons of this region which are completely covering polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function.
This method has been introduced in version 0.27.
select_inside
method descriptor
select_inside() -> Region
@brief Selects the polygons of this region which are completely inside polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
select_interacting
method descriptor
select_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
select_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
select_interacting(other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
select_interacting()
@brief Selects the polygons of this region which overlap or touch texts
@return The region after the polygons have been selected (self)
'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon selected. A polygon is selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count).
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27
select_not_covering
method descriptor
select_not_covering() -> Region
@brief Selects the polygons of this region which are not completely covering polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This attribute is sometimes called 'enclosing' instead of 'covering', but this term is reserved for the respective DRC function.
This method has been introduced in version 0.27.
select_not_inside
method descriptor
select_not_inside() -> Region
@brief Selects the polygons of this region which are not completely inside polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
select_not_interacting
method descriptor
select_not_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
select_not_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
select_not_interacting(other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region
select_not_interacting()
@brief Selects the polygons of this region which do not overlap or touch texts
'min_count' and 'max_count' impose a constraint on the number of times a polygon of this region has to interact with texts of the text collection to make the polygon not selected. A polygon is not selected by this method if the number of texts interacting with the polygon is between min_count and max_count (including max_count).
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27
select_not_outside
method descriptor
select_not_outside() -> Region
@brief Selects the polygons of this region which are not completely outside polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
select_not_overlapping
method descriptor
select_not_overlapping() -> Region
@brief Selects the polygons from this region which do not overlap polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
The count options have been introduced in version 0.27.
select_outside
method descriptor
select_outside() -> Region
@brief Selects the polygons of this region which are completely outside polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
select_overlapping
method descriptor
select_overlapping() -> Region
@brief Selects the polygons from this region which overlap polygons from the other region
@return The region after the polygons have been selected (self)
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
The count options have been introduced in version 0.27.
separation_check
method descriptor
separation_check() -> EdgePairs
@brief Performs a separation check with options @param d The minimum separation for which the polygons are checked @param other The other region against which to check @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
If "negative" is true, only edges from the first input are output as pseudo edge-pairs where the separation is larger or equal to the limit. This is a way to flag the parts of the first input where the distance to the second input is bigger. Note that only the first input's edges are output. The output is still edge pairs, but each edge pair contains one edge from the original input and the reverse version of the edge as the second edge.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
size
method descriptor
size() -> int
size(d: int, mode: Optional[int] = ...) -> Region
size(dv: Vector, mode: Optional[int] = ...) -> Region
size(dx: int, dy: int, mode: int) -> Region
size()
@brief Returns the (flat) number of polygons in the region
This returns the number of raw polygons (not merged polygons if merged semantics is enabled). The count is computed 'as if flat', i.e. polygons inside a cell are multiplied by the number of times a cell is instantiated.
The 'count' alias has been provided in version 0.26 to avoid ambiguity with the 'size' method which applies a geometrical bias.
size_inside
method descriptor
size_inside(inside: Region, d: int, steps: int, mode: Optional[int] = ...) -> Region
size_inside(inside: Region, dv: Vector, steps: int, mode: Optional[int] = ...) -> Region
size_inside(inside: Region, dx: int, dy: int, steps: int, mode: int) -> Region
size_inside()
@brief Incremental, isotropic sizing inside of another region
@return The region after the sizing has applied (self)
This method is equivalent to "size_inside(d, d, steps, mode)".
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.29.3.
size_outside
method descriptor
size_outside(outside: Region, d: int, steps: int, mode: Optional[int] = ...) -> Region
size_outside(outside: Region, dv: Vector, steps: int, mode: Optional[int] = ...) -> Region
size_outside(outside: Region, dx: int, dy: int, steps: int, mode: int) -> Region
size_outside()
@brief Incremental, anisotropic sizing outside of another region
This method is equivalent to \size_inside, except that sizing is performed outside the given 'outside' region. Technically this corresponds to a boolean 'NOT' operation instead of a boolean 'AND'.
This method has been introduced in version 0.29.3.
sized
method descriptor
sized(d: int, mode: Optional[int] = ...) -> Region
sized(dv: Vector, mode: Optional[int] = ...) -> Region
sized(dx: int, dy: int, mode: int) -> Region
sized()
@brief Returns the isotropically sized region
@return The sized region
This method is equivalent to "sized(d, d, mode)". This method returns the sized region (see \size), but does not modify self.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
sized_inside
method descriptor
sized_inside(inside: Region, d: int, steps: int, mode: Optional[int] = ...) -> Region
sized_inside(inside: Region, dv: Vector, steps: int, mode: Optional[int] = ...) -> Region
sized_inside(inside: Region, dx: int, dy: int, steps: int, mode: int) -> Region
sized_inside()
@brief Returns the incrementally sized region
@return The sized region
This method returns the incrementally sized region (see \size_inside), but does not modify self.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
sized_outside
method descriptor
sized_outside(outside: Region, d: int, steps: int, mode: Optional[int] = ...) -> Region
sized_outside(outside: Region, dv: Vector, steps: int, mode: Optional[int] = ...) -> Region
sized_outside(outside: Region, dx: int, dy: int, steps: int, mode: int) -> Region
sized_outside()
@brief Incremental, anisotropic sizing outside of another region
This method is equivalent to \size_inside, except that sizing is performed outside the given 'outside' region. Technically this corresponds to a boolean 'NOT' operation instead of a boolean 'AND'.
This method has been introduced in version 0.29.3.
smooth
method descriptor
smooth() -> None
@brief Smoothing @param d The smoothing tolerance (in database units) @param keep_hv If true, horizontal and vertical edges are maintained
This method will simplify the merged polygons of the region by removing vertexes if the resulting polygon stays equivalent with the original polygon. Equivalence is measured in terms of a deviation which is guaranteed to not become larger than \d. This method modifies the region. \smoothed is a method that does the same but returns a new region without modifying self. Merged semantics applies for this method.
smoothed
method descriptor
smoothed() -> Region
@brief Smoothing @param d The smoothing tolerance (in database units) @param keep_hv If true, horizontal and vertical edges are maintained
See \smooth for a description of this method. This version returns a new region instead of modifying self (out-of-place). It has been introduced in version 0.25.
snap
method descriptor
snap() -> None
@brief Snaps the region to the given grid This method will snap the region to the given grid - each x or y coordinate is brought on the gx or gy grid by rounding to the nearest value which is a multiple of gx or gy.
If gx or gy is 0, no snapping happens in that direction.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
snapped
method descriptor
snapped() -> Region
@brief Returns the snapped region This method will snap the region to the given grid and return the snapped region (see \snap). The original region is not modified.
space_check
method descriptor
space_check() -> EdgePairs
@brief Performs a space check with options @param d The minimum space for which the polygons are checked @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative If true, edges not violation the condition will be output as pseudo-edge pairs @param property_constraint Specifies whether to consider only shapes with a certain property relation @param zero_distance_mode Specifies how to handle edges with zero distance
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
"opposite_filter" specifies whether to require or reject errors happening on opposite sides of a figure. "rect_filter" allows suppressing specific error configurations on rectangular input figures.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.29.
split_covering
method descriptor
split_covering() -> List[Region]
@brief Returns the polygons of this region which are completely covering polygons from the other region and the ones which are not at the same time
@return Two new regions: the first containing the result of \covering, the second the result of \not_covering
This method is equivalent to calling \covering and \not_covering, but is faster when both results are required. Merged semantics applies for this method (see \merged_semantics= for a description of this concept).
This method has been introduced in version 0.27.
split_inside
method descriptor
split_inside() -> List[Region]
@brief Returns the polygons of this region which are completely inside polygons from the other region and the ones which are not at the same time
@return Two new regions: the first containing the result of \inside, the second the result of \not_inside
This method is equivalent to calling \inside and \not_inside, but is faster when both results are required. Merged semantics applies for this method (see \merged_semantics= for a description of this concept).
This method has been introduced in version 0.27.
split_interacting
method descriptor
split_interacting(other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]
split_interacting(other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]
split_interacting(other: Texts, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]
split_interacting()
@brief Returns the polygons of this region which are interacting with texts from the other text collection and the ones which are not at the same time
@return Two new regions: the first containing the result of \interacting, the second the result of \not_interacting
This method is equivalent to calling \interacting and \not_interacting, but is faster when both results are required. Merged semantics applies for this method (see \merged_semantics= for a description of this concept).
This method has been introduced in version 0.27.
split_outside
method descriptor
split_outside() -> List[Region]
@brief Returns the polygons of this region which are completely outside polygons from the other region and the ones which are not at the same time
@return Two new regions: the first containing the result of \outside, the second the result of \not_outside
This method is equivalent to calling \outside and \not_outside, but is faster when both results are required. Merged semantics applies for this method (see \merged_semantics= for a description of this concept).
This method has been introduced in version 0.27.
split_overlapping
method descriptor
split_overlapping() -> List[Region]
@brief Returns the polygons of this region which are overlapping with polygons from the other region and the ones which are not at the same time
@return Two new regions: the first containing the result of \overlapping, the second the result of \not_overlapping
This method is equivalent to calling \overlapping and \not_overlapping, but is faster when both results are required. Merged semantics applies for this method (see \merged_semantics= for a description of this concept).
This method has been introduced in version 0.27.
squares
method descriptor
squares() -> Region
@brief Returns all polygons which are squares This method returns all polygons in self which are squares.Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27.
strange_polygon_check
method descriptor
strange_polygon_check() -> Region
@brief Returns a region containing those parts of polygons which are "strange" Strange parts of polygons are self-overlapping parts or non-orientable parts (i.e. in the "8" configuration).
Merged semantics does not apply for this method (see \merged_semantics= for a description of this concept)
swap
method descriptor
swap() -> None
@brief Swap the contents of this region with the contents of another region This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare.
texts
method descriptor
texts(dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region
texts(expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region
texts()
@hide This method is provided for DRC implementation only.
texts_dots
method descriptor
texts_dots(dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges
texts_dots(expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges
texts_dots()
@hide This method is provided for DRC implementation only.
to_s
method descriptor
to_s() -> str
to_s(max_count: int) -> str
to_s()
@brief Converts the region to a string This version allows specification of the maximum number of polygons contained in the string.
transform
method descriptor
transform(t: ICplxTrans) -> Region
transform(t: IMatrix2d) -> Region
transform(t: IMatrix3d) -> Region
transform(t: Trans) -> Region
transform()
@brief Transform the region (modifies self)
Transforms the region with the given 3d matrix transformation. This version modifies the region and returns a reference to self.
@param t The transformation to apply.
@return The transformed region.
This variant was introduced in version 0.27.
transform_icplx
method descriptor
transform_icplx() -> Region
@brief Transform the region with a complex transformation (modifies self)
Transforms the region with the given transformation. This version modifies the region and returns a reference to self.
@param t The transformation to apply.
@return The transformed region.
transformed
method descriptor
transformed(t: ICplxTrans) -> Region
transformed(t: IMatrix2d) -> Region
transformed(t: IMatrix3d) -> Region
transformed(t: Trans) -> Region
transformed()
@brief Transforms the region
Transforms the region with the given 3d matrix transformation. Does not modify the region but returns the transformed region.
@param t The transformation to apply.
@return The transformed region.
This variant was introduced in version 0.27.
transformed_icplx
method descriptor
transformed_icplx() -> Region
@brief Transforms the region with a complex transformation
Transforms the region with the given complex transformation. Does not modify the region but returns the transformed region.
@param t The transformation to apply.
@return The transformed region.
width_check
method descriptor
width_check() -> EdgePairs
@brief Performs a width check with options @param d The minimum width for which the polygons are checked @param whole_edges If true, deliver the whole edges @param metrics Specify the metrics type @param ignore_angle The angle above which no check is performed @param min_projection The lower threshold of the projected length of one edge onto another @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding (see below) @param negative If true, edges not violation the condition will be output as pseudo-edge pairs @param property_constraint Only \IgnoreProperties and \NoPropertyConstraint are allowed - in the last case, properties are copied from the original shapes to the output. @param zero_distance_mode Specifies how to handle edges with zero distance Other than 'width' allow more options here.
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.
"ignore_angle" specifies the angle limit 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 selecting 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 limit, pass nil to the respective value.
"shielded" controls whether shielding is applied. Shielding means that rule violations are not detected 'through' other features. Measurements are only made where the opposite edge is unobstructed. Shielding often is not optional as a rule violation in shielded case automatically comes with rule violations between the original and the shielding features. If not necessary, shielding can be disabled by setting this flag to false. In general, this will improve performance somewhat.
Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept)
The 'shielded' and 'negative' options have been introduced in version 0.27. 'property_constraint' has been added in version 0.28.4. 'zero_distance_mode' has been added in version 0.28.16.
with_angle
method descriptor
with_angle(amin: float, amax: float, inverse: bool) -> EdgePairs
with_angle(angle: float, inverse: bool) -> EdgePairs
with_angle()
@brief Returns markers on every corner with an angle of more than amin and less than amax (or the opposite) If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle whose value is more or equal to amin (in degree) or less (but not equal to) amax. If the inverse flag is true, the method returns markers for every corner whose angle is not matching that criterion.
The edge pair objects returned will contain both edges forming the angle.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_area
method descriptor
with_area(area: int, inverse: bool) -> Region
with_area(min_area: Any, max_area: Any, inverse: bool) -> Region
with_area()
@brief Filter the polygons by area Filters the polygons of the region by area. If "inverse" is false, only polygons which have an area larger or equal to "min_area" and less than "max_area" are returned. If "inverse" is true, polygons having an area less than "min_area" or larger or equal than "max_area" are returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_area_ratio
method descriptor
with_area_ratio(min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region
with_area_ratio(ratio: float, inverse: bool) -> Region
with_area_ratio()
@brief Filters the polygons by the aspect ratio of their bounding boxes The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. The area ratio is always larger or equal to 1. With 'inverse' set to false, this version filters polygons which have an area ratio between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27.
with_bbox_aspect_ratio
method descriptor
with_bbox_aspect_ratio(min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region
with_bbox_aspect_ratio(ratio: float, inverse: bool) -> Region
with_bbox_aspect_ratio()
@brief Filters the polygons by the aspect ratio of their bounding boxes Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1.
With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27.
with_bbox_height
method descriptor
with_bbox_height(height: int, inverse: bool) -> Region
with_bbox_height(min_height: Any, max_height: Any, inverse: bool) -> Region
with_bbox_height()
@brief Filter the polygons by bounding box height Filters the polygons of the region by the height of their bounding box. If "inverse" is false, only polygons whose bounding box has a height larger or equal to "min_height" and less than "max_height" are returned. If "inverse" is true, all polygons not matching this criterion are returned. If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_bbox_max
method descriptor
with_bbox_max(dim: int, inverse: bool) -> Region
with_bbox_max(min_dim: Any, max_dim: Any, inverse: bool) -> Region
with_bbox_max()
@brief Filter the polygons by bounding box width or height, whichever is larger Filters the polygons of the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's larger dimension is larger or equal to "min_dim" and less than "max_dim" are returned. If "inverse" is true, all polygons not matching this criterion are returned. If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_bbox_min
method descriptor
with_bbox_min(dim: int, inverse: bool) -> Region
with_bbox_min(min_dim: Any, max_dim: Any, inverse: bool) -> Region
with_bbox_min()
@brief Filter the polygons by bounding box width or height, whichever is smaller Filters the polygons of the region by the minimum dimension of their bounding box. If "inverse" is false, only polygons whose bounding box's smaller dimension is larger or equal to "min_dim" and less than "max_dim" are returned. If "inverse" is true, all polygons not matching this criterion are returned. If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_bbox_width
method descriptor
with_bbox_width(min_width: Any, max_width: Any, inverse: bool) -> Region
with_bbox_width(width: int, inverse: bool) -> Region
with_bbox_width()
@brief Filter the polygons by bounding box width Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has a width larger or equal to "min_width" and less than "max_width" are returned. If "inverse" is true, all polygons not matching this criterion are returned. If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_holes
method descriptor
with_holes(min_bholes: Any, max_nholes: Any, inverse: bool) -> Region
with_holes(nholes: int, inverse: bool) -> Region
with_holes()
@brief Filter the polygons by their number of holes Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have a hole count larger or equal to "min_nholes" and less than "max_nholes" are returned. If "inverse" is true, polygons having a hole count less than "min_nholes" or larger or equal than "max_nholes" are returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27.
with_perimeter
method descriptor
with_perimeter(min_perimeter: Any, max_perimeter: Any, inverse: bool) -> Region
with_perimeter(perimeter: int, inverse: bool) -> Region
with_perimeter()
@brief Filter the polygons by perimeter Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have a perimeter larger or equal to "min_perimeter" and less than "max_perimeter" are returned. If "inverse" is true, polygons having a perimeter less than "min_perimeter" or larger or equal than "max_perimeter" are returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
with_relative_height
method descriptor
with_relative_height(min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region
with_relative_height(ratio: float, inverse: bool) -> Region
with_relative_height()
@brief Filters the polygons by the bounding box height to width ratio This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1.
An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic.
With 'inverse' set to false, this version filters polygons which have a relative height between 'min_ratio' and 'max_ratio'. With 'min_included' set to true, the 'min_ratio' value is included in the range, otherwise it's excluded. Same for 'max_included' and 'max_ratio'. With 'inverse' set to true, all other polygons will be returned.
If you don't want to specify a lower or upper limit, pass nil to that parameter.
Merged semantics applies for this method (see \merged_semantics= for a description of this concept)
This method has been introduced in version 0.27.
write
method descriptor
write() -> None
@brief Writes the region to a file This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell.
This method has been introduced in version 0.29.
xor
method descriptor
xor() -> Region
@brief Returns the boolean XOR between self and the other region
@return The result of the boolean XOR operation
This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged.
The 'xor' alias has been introduced in version 0.28.12.
xor_with
method descriptor
xor_with() -> Region
@brief Performs the boolean XOR between self and the other region in-place (modifying self)
@return The region after modification (self)
This method will compute the boolean XOR (intersection) between two regions. The result is often but not necessarily always merged.
Note that in Ruby, the '^=' operator actually does not exist, but is emulated by '^' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'xor_with' instead.
The 'xor_with' alias has been introduced in version 0.28.12.
SaveLayoutOptions
@brief Options for saving layouts
This class describes the various options for saving a layout to a stream file (GDS2, OASIS and others). There are: layers to be saved, cell or cells to be saved, scale factor, format, database unit and format specific options.
Usually the default constructor provides a suitable object. Please note, that the format written is "GDS2" by default. Either explicitly set a format using \format= or derive the format from the file name using \set_format_from_filename.
The layers are specified by either selecting all layers or by defining layer by layer using the \add_layer method. \select_all_layers will explicitly select all layers for saving, \deselect_all_layers will explicitly clear the list of layers.
Cells are selected in a similar fashion: by default, all cells are selected. Using \add_cell, specific cells can be selected for saving. All these cells plus their hierarchy will then be written to the stream file.
__doc__
class
__doc__ = '@brief Options for saving layouts\n\nThis class describes the various options for saving a layout to a stream file (GDS2, OASIS and others).\nThere are: layers to be saved, cell or cells to be saved, scale factor, format, database unit\nand format specific options.\n\nUsually the default constructor provides a suitable object. Please note, that the format written is "GDS2" by default. Either explicitly set a format using \\format= or derive the format from the file name using \\set_format_from_filename.\n\nThe layers are specified by either selecting all layers or by defining layer by layer using the\n\\add_layer method. \\select_all_layers will explicitly select all layers for saving, \\deselect_all_layers will explicitly clear the list of layers.\n\nCells are selected in a similar fashion: by default, all cells are selected. Using \\add_cell, specific\ncells can be selected for saving. All these cells plus their hierarchy will then be written to the stream file.\n\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 63
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'SaveLayoutOptions' objects>
list of weak references to the object
cif_blank_separator
class
cif_blank_separator: bool = <attribute 'cif_blank_separator' of 'SaveLayoutOptions' objects>
@brief Gets a flag indicating whether blanks shall be used as x/y separator characters See \cif_blank_separator= method for a description of that property. This property has been added in version 0.23.10.
The predicate version (cif_blank_separator?) has been added in version 0.25.1.
@brief Sets a flag indicating whether blanks shall be used as x/y separator characters If this property is set to true, the x and y coordinates are separated with blank characters rather than comma characters. This property has been added in version 0.23.10.
cif_dummy_calls
class
cif_dummy_calls: bool = <attribute 'cif_dummy_calls' of 'SaveLayoutOptions' objects>
@brief Gets a flag indicating whether dummy calls shall be written See \cif_dummy_calls= method for a description of that property. This property has been added in version 0.23.10.
The predicate version (cif_blank_separator?) has been added in version 0.25.1.
@brief Sets a flag indicating whether dummy calls shall be written If this property is set to true, dummy calls will be written in the top level entity of the CIF file calling every top cell. This option is useful for enhanced compatibility with other tools.
This property has been added in version 0.23.10.
dbu
class
dbu: float = <attribute 'dbu' of 'SaveLayoutOptions' objects>
@brief Get the explicit database unit if one is set
See \dbu= for a description of that attribute.
@brief Set the database unit to be used in the stream file
By default, the database unit of the layout is used. This method allows one to explicitly use a different database unit. A scale factor is introduced automatically which scales all layout objects accordingly so their physical dimensions remain the same. When scaling to a larger database unit or one that is not an integer fraction of the original one, rounding errors may occur and the layout may become slightly distorted.
dxf_polygon_mode
class
dxf_polygon_mode: int = <attribute 'dxf_polygon_mode' of 'SaveLayoutOptions' objects>
@brief Specifies how to write polygons. See \dxf_polygon_mode= for a description of this property.
This property has been added in version 0.21.3.
@brief Specifies how to write polygons. The mode is 0 (write POLYLINE entities), 1 (write LWPOLYLINE entities), 2 (decompose into SOLID entities), 3 (write HATCH entities), or 4 (write LINE entities).
This property has been added in version 0.21.3. '4', in version 0.25.6.
format
class
format: str = <attribute 'format' of 'SaveLayoutOptions' objects>
@brief Gets the format name
See \format= for a description of that method.
@brief Select a format The format string can be either "GDS2", "OASIS", "CIF" or "DXF". Other formats may be available if a suitable plugin is installed.
gds2_libname
class
gds2_libname: str = <attribute 'gds2_libname' of 'SaveLayoutOptions' objects>
@brief Get the library name See \gds2_libname= method for a description of the library name. This property has been added in version 0.18.
@brief Set the library name
The library name is the string written into the LIBNAME records of the GDS file. The library name should not be an empty string and is subject to certain limitations in the character choice.
This property has been added in version 0.18.
gds2_max_cellname_length
class
gds2_max_cellname_length: int = <attribute 'gds2_max_cellname_length' of 'SaveLayoutOptions' objects>
@brief Get the maximum length of cell names See \gds2_max_cellname_length= method for a description of the maximum cell name length. This property has been added in version 0.18.
@brief Maximum length of cell names
This property describes the maximum number of characters for cell names. Longer cell names will be shortened.
This property has been added in version 0.18.
gds2_max_vertex_count
class
gds2_max_vertex_count: int = <attribute 'gds2_max_vertex_count' of 'SaveLayoutOptions' objects>
@brief Gets the maximum number of vertices for polygons to write See \gds2_max_vertex_count= method for a description of the maximum vertex count. This property has been added in version 0.18.
@brief Sets the maximum number of vertices for polygons to write This property describes the maximum number of point for polygons in GDS2 files. Polygons with more points will be split. The minimum value for this property is 4. The maximum allowed value is about 4000 or 8000, depending on the GDS2 interpretation. If \gds2_multi_xy_records is true, this property is not used. Instead, the number of points is unlimited.
This property has been added in version 0.18.
gds2_multi_xy_records
class
gds2_multi_xy_records: bool = <attribute 'gds2_multi_xy_records' of 'SaveLayoutOptions' objects>
@brief Gets the property enabling multiple XY records for BOUNDARY elements See \gds2_multi_xy_records= method for a description of this property. This property has been added in version 0.18.
@brief Uses multiple XY records in BOUNDARY elements for unlimited large polygons
Setting this property to true allows producing polygons with an unlimited number of points at the cost of incompatible formats. Setting it to true disables the \gds2_max_vertex_count setting.
This property has been added in version 0.18.
gds2_no_zero_length_paths
class
gds2_no_zero_length_paths: bool = <attribute 'gds2_no_zero_length_paths' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether zero-length paths are eliminated
This property has been added in version 0.23.
@brief Eliminates zero-length paths if true
If this property is set to true, paths with zero length will be converted to BOUNDARY objects.
This property has been added in version 0.23.
gds2_resolve_skew_arrays
class
gds2_resolve_skew_arrays: bool = <attribute 'gds2_resolve_skew_arrays' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether to resolve skew arrays into single instances See \gds2_resolve_skew_arrays= method for a description of this property. This property has been added in version 0.27.1.
@brief Resolves skew arrays into single instances
Setting this property to true will make skew (non-orthogonal) arrays being resolved into single instances. Skew arrays happen if either the row or column vector isn't parallel to x or y axis. Such arrays can cause problems with some legacy software and can be disabled with this option.
This property has been added in version 0.27.1.
gds2_user_units
class
gds2_user_units: float = <attribute 'gds2_user_units' of 'SaveLayoutOptions' objects>
@brief Get the user units See \gds2_user_units= method for a description of the user units. This property has been added in version 0.18.
@brief Set the users units to write into the GDS file
The user units of a GDS file are rarely used and usually are set to 1 (micron). The intention of the user units is to specify the display units. KLayout ignores the user unit and uses microns as the display unit. The user unit must be larger than zero.
This property has been added in version 0.18.
gds2_write_cell_properties
class
gds2_write_cell_properties: bool = <attribute 'gds2_write_cell_properties' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether cell properties are written
This property has been added in version 0.23.
@brief Enables writing of cell properties if set to true
If this property is set to true, cell properties will be written as PROPATTR/PROPVALUE records immediately following the BGNSTR records. This is a non-standard extension and is therefore disabled by default.
This property has been added in version 0.23.
gds2_write_file_properties
class
gds2_write_file_properties: bool = <attribute 'gds2_write_file_properties' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether layout properties are written
This property has been added in version 0.24.
@brief Enables writing of file properties if set to true
If this property is set to true, layout properties will be written as PROPATTR/PROPVALUE records immediately following the BGNLIB records. This is a non-standard extension and is therefore disabled by default.
This property has been added in version 0.24.
gds2_write_timestamps
class
gds2_write_timestamps: bool = <attribute 'gds2_write_timestamps' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether the current time is written into the GDS2 timestamp fields
This property has been added in version 0.21.16.
@brief Writes the current time into the GDS2 timestamps if set to true
If this property is set to false, the time fields will all be zero. This somewhat simplifies compare and diff applications.
This property has been added in version 0.21.16.
keep_instances
class
keep_instances: bool = <attribute 'keep_instances' of 'SaveLayoutOptions' objects>
@brief Gets a flag indicating whether instances will be kept even if the target cell is dropped
See \keep_instances= for details about this flag.
This method was introduced in version 0.23.
@brief Enables or disables instances for dropped cells
If this flag is set to true, instances for cells will be written, even if the cell is dropped. That may happen, if cells are selected with \select_this_cell or \add_this_cell or \no_empty_cells is used. Even if cells called by such cells are not selected, instances will be written for that cell if "keep_instances" is true. That feature is supported by the GDS format currently and results in "ghost cells" which have instances but no cell definition.
The default value is false (instances of dropped cells are not written).
This method was introduced in version 0.23.
mag_lambda
class
mag_lambda: float = <attribute 'mag_lambda' of 'SaveLayoutOptions' objects>
@brief Gets the lambda value See \mag_lambda= method for a description of this attribute. This property has been added in version 0.26.2.
@brief Specifies the lambda value to used for writing
The lambda value is the basic unit of the layout. The layout is brought to units of this value. If the layout is not on-grid on this unit, snapping will happen. If the value is less or equal to zero, KLayout will use the lambda value stored inside the layout set by a previous read operation of a MAGIC file. The lambda value is stored in the Layout object as the "lambda" metadata attribute.
This property has been added in version 0.26.2.
mag_tech
class
mag_tech: str = <attribute 'mag_tech' of 'SaveLayoutOptions' objects>
@brief Gets the technology string used for writing See \mag_tech= method for a description of this attribute. This property has been added in version 0.26.2.
@brief Specifies the technology string used for writing
If this string is empty, the writer will try to obtain the technology from the "technology" metadata attribute of the layout.
This property has been added in version 0.26.2.
mag_write_timestamp
class
mag_write_timestamp: bool = <attribute 'mag_write_timestamp' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether to write a timestamp See \write_timestamp= method for a description of this attribute.
This property has been added in version 0.26.2.
@brief Specifies whether to write a timestamp
If this attribute is set to false, the timestamp written is 0. This is not permitted in the strict sense, but simplifies comparison of Magic files.
This property has been added in version 0.26.2.
no_empty_cells
class
no_empty_cells: bool = <attribute 'no_empty_cells' of 'SaveLayoutOptions' objects>
@brief Returns a flag indicating whether empty cells are not written.
@brief Don't write empty cells if this flag is set
By default, all cells are written (no_empty_cells is false). This applies to empty cells which do not contain shapes for the specified layers as well as cells which are empty because they reference empty cells only.
oasis_compression_level
class
oasis_compression_level: int = <attribute 'oasis_compression_level' of 'SaveLayoutOptions' objects>
@brief Get the OASIS compression level See \oasis_compression_level= method for a description of the OASIS compression level.
@brief Set the OASIS compression level The OASIS compression level is an integer number between 0 and 10. 0 basically is no compression, 1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate algorithm to find shape arrays which uses 2nd and further neighbor distances. The higher the level, the higher the memory requirements and run times.
oasis_permissive
class
oasis_permissive: bool = <attribute 'oasis_permissive' of 'SaveLayoutOptions' objects>
@brief Gets the OASIS permissive mode See \oasis_permissive= method for a description of this predicate. This method has been introduced in version 0.25.1.
@brief Sets OASIS permissive mode If this flag is true, certain shapes which cannot be written to OASIS are reported as warnings, not as errors. For example, paths with odd width (are rounded) or polygons with less than three points (are skipped).
This method has been introduced in version 0.25.1.
oasis_recompress
class
oasis_recompress: bool = <attribute 'oasis_recompress' of 'SaveLayoutOptions' objects>
@brief Gets the OASIS recompression mode See \oasis_recompress= method for a description of this predicate. This method has been introduced in version 0.23.
@brief Sets OASIS recompression mode If this flag is true, shape arrays already existing will be resolved and compression is applied to the individual shapes again. If this flag is false (the default), shape arrays already existing will be written as such.
This method has been introduced in version 0.23.
oasis_strict_mode
class
oasis_strict_mode: bool = <attribute 'oasis_strict_mode' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether to write strict-mode OASIS files
@brief Sets a value indicating whether to write strict-mode OASIS files Setting this property clears all format specific options for other formats such as GDS.
oasis_substitution_char
class
oasis_substitution_char: str = <attribute 'oasis_substitution_char' of 'SaveLayoutOptions' objects>
@brief Gets the substitution character
See \oasis_substitution_char for details. This attribute has been introduced in version 0.23.
@brief Sets the substitution character for a-strings and n-strings The substitution character is used in place of invalid characters. The value of this attribute is a string which is either empty or a single character. If the string is empty, no substitution is made at the risk of producing invalid OASIS files.
This attribute has been introduce in version 0.23.
oasis_write_cblocks
class
oasis_write_cblocks: bool = <attribute 'oasis_write_cblocks' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether to write compressed CBLOCKS per cell
@brief Sets a value indicating whether to write compressed CBLOCKS per cell Setting this property clears all format specific options for other formats such as GDS.
oasis_write_cell_bounding_boxes
class
oasis_write_cell_bounding_boxes: bool = <attribute 'oasis_write_cell_bounding_boxes' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether cell bounding boxes are written See \oasis_write_cell_bounding_boxes= method for a description of this flag. This method has been introduced in version 0.24.3.
@brief Sets a value indicating whether cell bounding boxes are written If this value is set to true, cell bounding boxes are written (S_BOUNDING_BOX). The S_BOUNDING_BOX properties will be attached to the CELLNAME records.
Setting this value to true will also enable writing of other standard properties like S_TOP_CELL (see \oasis_write_std_properties=). By default, cell bounding boxes are not written, but standard properties are.
This method has been introduced in version 0.24.3.
oasis_write_std_properties
class
oasis_write_std_properties: bool = <attribute 'oasis_write_std_properties' of 'SaveLayoutOptions' objects>
@brief Gets a value indicating whether standard properties will be written See \oasis_write_std_properties= method for a description of this flag. This method has been introduced in version 0.24.
@brief Sets a value indicating whether standard properties will be written If this value is false, no standard properties are written. If true, S_TOP_CELL and some other global standard properties are written. In addition, \oasis_write_cell_bounding_boxes= can be used to write cell bounding boxes using S_BOUNDING_BOX.
By default, this flag is true and standard properties are written.
Setting this property to false clears the oasis_write_cell_bounding_boxes flag too.
This method has been introduced in version 0.24.
oasis_write_std_properties_ext
class
oasis_write_std_properties_ext: int = <attribute 'oasis_write_std_properties_ext' of 'SaveLayoutOptions' objects>
@hide
@hide
scale_factor
class
scale_factor: float = <attribute 'scale_factor' of 'SaveLayoutOptions' objects>
@brief Gets the scaling factor currently set
@brief Set the scaling factor for the saving
Using a scaling factor will scale all objects accordingly. This scale factor adds to a potential scaling implied by using an explicit database unit.
Be aware that rounding effects may occur if fractional scaling factors are used.
By default, no scaling is applied.
write_context_info
class
write_context_info: bool = <attribute 'write_context_info' of 'SaveLayoutOptions' objects>
@brief Gets a flag indicating whether context information will be stored
See \write_context_info= for details about this flag.
This method was introduced in version 0.23.
@brief Enables or disables context information
If this flag is set to false, no context information for PCell or library cell instances is written. Those cells will be converted to plain cells and KLayout will not be able to restore the identity of those cells. Use this option to enforce compatibility with other tools that don't understand the context information of KLayout.
The default value is true (context information is stored). Not all formats support context information, hence that flag has no effect for formats like CIF or DXF.
This method was introduced in version 0.23.
__copy__
method descriptor
__copy__() -> SaveLayoutOptions
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> SaveLayoutOptions
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Default constructor
This will initialize the scale factor to 1.0, the database unit is set to "same as original" and all layers are selected as well as all cells. The default format is GDS2.
add_cell
method descriptor
add_cell() -> None
@brief Add a cell (plus hierarchy) to be saved
The index of the cell must be a valid index in the context of the layout that will be saved. This method clears the 'select all cells' flag.
This method also implicitly adds the children of that cell. A method that does not add the children in \add_this_cell.
add_layer
method descriptor
add_layer() -> None
@brief Add a layer to be saved
Adds the layer with the given index to the layer list that will be written. If all layers have been selected previously, all layers will be unselected first and only the new layer remains.
The 'properties' argument can be used to assign different layer properties than the ones present in the layout. Pass a default \LayerInfo object to this argument to use the properties from the layout object. Construct a valid \LayerInfo object with explicit layer, datatype and possibly a name to override the properties stored in the layout.
add_this_cell
method descriptor
add_this_cell() -> None
@brief Adds a cell to be saved
The index of the cell must be a valid index in the context of the layout that will be saved. This method clears the 'select all cells' flag. Unlike \add_cell, this method does not implicitly add all children of that cell.
This method has been added in version 0.23.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cif_blank_separator_
method descriptor
cif_blank_separator_()
@brief Gets a flag indicating whether blanks shall be used as x/y separator characters See \cif_blank_separator= method for a description of that property. This property has been added in version 0.23.10.
The predicate version (cif_blank_separator?) has been added in version 0.25.1.
cif_dummy_calls_
method descriptor
cif_dummy_calls_()
@brief Gets a flag indicating whether dummy calls shall be written See \cif_dummy_calls= method for a description of that property. This property has been added in version 0.23.10.
The predicate version (cif_blank_separator?) has been added in version 0.25.1.
clear_cells
method descriptor
clear_cells() -> None
@brief Clears all cells to be saved
This method can be used to ensure that no cell is selected before \add_cell is called to specify a cell. This method clears the 'select all cells' flag.
This method has been added in version 0.22.
create
method descriptor
create() -> None
@brief 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.
deselect_all_layers
method descriptor
deselect_all_layers() -> None
@brief Unselect all layers: no layer will be saved
This method will clear all layers selected with \add_layer so far and clear the 'select all layers' flag. Using this method is the only way to save a layout without any layers.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> SaveLayoutOptions
@brief Creates a copy of self
gds2_no_zero_length_paths_
method descriptor
gds2_no_zero_length_paths_()
@brief Gets a value indicating whether zero-length paths are eliminated
This property has been added in version 0.23.
gds2_write_cell_properties_
method descriptor
gds2_write_cell_properties_()
@brief Gets a value indicating whether cell properties are written
This property has been added in version 0.23.
gds2_write_file_properties_
method descriptor
gds2_write_file_properties_()
@brief Gets a value indicating whether layout properties are written
This property has been added in version 0.24.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> SaveLayoutOptions
@brief Default constructor
This will initialize the scale factor to 1.0, the database unit is set to "same as original" and all layers are selected as well as all cells. The default format is GDS2.
select_all_cells
method descriptor
select_all_cells() -> None
@brief Select all cells to save
This method will clear all cells specified with \add_cells so far and set the 'select all cells' flag. This is the default.
select_all_layers
method descriptor
select_all_layers() -> None
@brief Select all layers to be saved
This method will clear all layers selected with \add_layer so far and set the 'select all layers' flag. This is the default.
select_cell
method descriptor
select_cell() -> None
@brief Selects a cell to be saved (plus hierarchy below)
This method is basically a convenience method that combines \clear_cells and \add_cell. This method clears the 'select all cells' flag.
This method has been added in version 0.22.
select_this_cell
method descriptor
select_this_cell() -> None
@brief Selects a cell to be saved
This method is basically a convenience method that combines \clear_cells and \add_this_cell. This method clears the 'select all cells' flag.
This method has been added in version 0.23.
set_format_from_filename
method descriptor
set_format_from_filename() -> bool
@brief Select a format from the given file name
This method will set the format according to the file's extension.
This method has been introduced in version 0.22. Beginning with version 0.23, this method always returns true, since the only consumer for the return value, Layout#write, now ignores that parameter and automatically determines the compression mode from the file name.
Severity
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Error
class
Error: Severity = Error (3)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Info
class
Info: Severity = Info (1)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
NoSeverity
class
NoSeverity: Severity = NoSeverity (0)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
Warning
class
Warning: Severity = Warning (2)
@brief This enum specifies the severity level for log entries.
This enum was introduced in version 0.28.13.
__doc__
class
__doc__ = '@brief This enum specifies the severity level for log entries.\n\nThis enum was introduced in version 0.28.13.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 78
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Severity' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Severity
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Severity
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Severity) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Severity
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> Severity
new(s: str) -> Severity
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
Shape
@brief An object representing a shape in the layout database
The shape proxy is basically a pointer to a shape of different kinds. No copy of the shape is created: if the shape proxy is copied the copy still points to the original shape. If the original shape is modified or deleted, the shape proxy will also point to a modified or invalid shape. The proxy can be "null" which indicates an invalid reference.
Shape objects are used together with the \Shapes container object which stores the actual shape objects and uses Shape references as pointers inside the actual data storage. Shape references are used in various places, i.e. when removing or transforming objects inside a \Shapes container.
TBox
class
TBox: int = 15
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TBoxArray
class
TBoxArray: int = 16
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TBoxArrayMember
class
TBoxArrayMember: int = 17
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TEdge
class
TEdge: int = 9
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TEdgePair
class
TEdgePair: int = 10
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TNull
class
TNull: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPath
class
TPath: int = 11
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPathPtrArray
class
TPathPtrArray: int = 13
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPathPtrArrayMember
class
TPathPtrArrayMember: int = 14
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPathRef
class
TPathRef: int = 12
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPoint
class
TPoint: int = 25
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPolygon
class
TPolygon: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPolygonPtrArray
class
TPolygonPtrArray: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPolygonPtrArrayMember
class
TPolygonPtrArrayMember: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TPolygonRef
class
TPolygonRef: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TShortBox
class
TShortBox: int = 18
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TShortBoxArray
class
TShortBoxArray: int = 19
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TShortBoxArrayMember
class
TShortBoxArrayMember: int = 20
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TSimplePolygon
class
TSimplePolygon: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TSimplePolygonPtrArray
class
TSimplePolygonPtrArray: int = 7
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TSimplePolygonPtrArrayMember
class
TSimplePolygonPtrArrayMember: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TSimplePolygonRef
class
TSimplePolygonRef: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TText
class
TText: int = 21
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TTextPtrArray
class
TTextPtrArray: int = 23
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TTextPtrArrayMember
class
TTextPtrArrayMember: int = 24
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TTextRef
class
TTextRef: int = 22
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
TUserObject
class
TUserObject: int = 26
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief An object representing a shape in the layout database\n\nThe shape proxy is basically a pointer to a shape of different kinds.\nNo copy of the shape is created: if the shape proxy is copied the copy still\npoints to the original shape. If the original shape is modified or deleted,\nthe shape proxy will also point to a modified or invalid shape.\nThe proxy can be "null" which indicates an invalid reference.\n\nShape objects are used together with the \\Shapes container object which\nstores the actual shape objects and uses Shape references as pointers inside the\nactual data storage. Shape references are used in various places, i.e. when removing or\ntransforming objects inside a \\Shapes container.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 169
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Shape' objects>
list of weak references to the object
box
class
box: Any = <attribute 'box' of 'Shape' objects>
@brief Gets the box object
Starting with version 0.23, this method returns nil, if the shape does not represent a box.
@brief Replaces the shape by the given box This method replaces the shape by the given box. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
@brief Replaces the shape by the given box (in micrometer units) This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally.
This method has been introduced in version 0.25.
box_center
class
box_center: Point = <attribute 'box_center' of 'Shape' objects>
@brief Returns the center of the box
Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the center of the box
Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the center of the box with the point being given in micrometer units
Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.
This method has been introduced in version 0.25.
box_dcenter
class
box_dcenter: DPoint = <attribute 'box_dcenter' of 'Shape' objects>
@brief Returns the center of the box as a \DPoint object in micrometer units
Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box. Conversion from database units to micrometers is done internally.
This method has been introduced in version 0.25.
@brief Sets the center of the box with the point being given in micrometer units
Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.
This method has been introduced in version 0.25.
box_dheight
class
box_dheight: float = <attribute 'box_dheight' of 'Shape' objects>
@brief Returns the height of the box in micrometer units
Applies to boxes only. Returns the height of the box in micrometers and throws an exception if the shape is not a box.
This method has been introduced in version 0.25.
@brief Sets the height of the box
Applies to boxes only. Changes the height of the box to the value given in micrometer units and throws an exception if the shape is not a box. Translation to database units happens internally.
This method has been introduced in version 0.25.
box_dp1
class
box_dp1: DPoint = <attribute 'box_dp1' of 'Shape' objects>
@brief Returns the lower left point of the box as a \DPoint object in micrometer units
Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box. Conversion from database units to micrometers is done internally.
This method has been introduced in version 0.25.
@brief Sets the lower left corner of the box with the point being given in micrometer units
Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.
This method has been introduced in version 0.25.
box_dp2
class
box_dp2: DPoint = <attribute 'box_dp2' of 'Shape' objects>
@brief Returns the upper right point of the box as a \DPoint object in micrometer units
Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box. Conversion from database units to micrometers is done internally.
This method has been introduced in version 0.25.
@brief Sets the upper right corner of the box with the point being given in micrometer units
Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.
This method has been introduced in version 0.25.
box_dwidth
class
box_dwidth: float = <attribute 'box_dwidth' of 'Shape' objects>
@brief Returns the width of the box in micrometer units
Applies to boxes only. Returns the width of the box in micrometers and throws an exception if the shape is not a box.
This method has been introduced in version 0.25.
@brief Sets the width of the box in micrometer units
Applies to boxes only. Changes the width of the box to the value given in micrometer units and throws an exception if the shape is not a box. Translation to database units happens internally.
This method has been introduced in version 0.25.
box_height
class
box_height: int = <attribute 'box_height' of 'Shape' objects>
@brief Returns the height of the box
Applies to boxes only. Returns the height of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the height of the box
Applies to boxes only. Changes the height of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
box_p1
class
box_p1: Point = <attribute 'box_p1' of 'Shape' objects>
@brief Returns the lower left point of the box
Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the lower left point of the box
Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the lower left corner of the box with the point being given in micrometer units
Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.
This method has been introduced in version 0.25.
box_p2
class
box_p2: Point = <attribute 'box_p2' of 'Shape' objects>
@brief Returns the upper right point of the box
Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the upper right point of the box
Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the upper right corner of the box with the point being given in micrometer units
Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box. Translation from micrometer units to database units is done internally.
This method has been introduced in version 0.25.
box_width
class
box_width: int = <attribute 'box_width' of 'Shape' objects>
@brief Returns the width of the box
Applies to boxes only. Returns the width of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
@brief Sets the width of the box
Applies to boxes only. Changes the width of the box and throws an exception if the shape is not a box.
This method has been introduced in version 0.23.
cell
class
cell: Cell = <attribute 'cell' of 'Shape' objects>
@brief Gets a reference to the cell the shape belongs to
This reference can be nil, if the Shape object is not living inside a cell
This method has been introduced in version 0.22.
@brief Moves the shape to a different cell
Both the current and the target cell must reside in the same layout.
This method has been introduced in version 0.23.
dbox
class
dbox: Any = <attribute 'dbox' of 'Shape' objects>
@brief Gets the box object in micrometer units See \box for a description of this method. This method returns the box after translation to micrometer units.
This method has been added in version 0.25.
@brief Replaces the shape by the given box (in micrometer units) This method replaces the shape by the given box, like \box= with a \Box argument does. This version translates the box from micrometer units to database units internally.
This method has been introduced in version 0.25.
dedge
class
dedge: Any = <attribute 'dedge' of 'Shape' objects>
@brief Returns the edge object as a \DEdge object in micrometer units See \edge for a description of this method. This method returns the edge after translation to micrometer units.
This method has been added in version 0.25.
@brief Replaces the shape by the given edge (in micrometer units) This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally.
This method has been introduced in version 0.25.
dedge_pair
class
dedge_pair: Any = <attribute 'dedge_pair' of 'Shape' objects>
@brief Returns the edge pair object as a \DEdgePair object in micrometer units See \edge_pair for a description of this method. This method returns the edge pair after translation to micrometer units.
This method has been added in version 0.26.
@brief Replaces the shape by the given edge pair (in micrometer units) This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally.
This method has been introduced in version 0.26.
dpath
class
dpath: Any = <attribute 'dpath' of 'Shape' objects>
@brief Returns the path object as a \DPath object in micrometer units See \path for a description of this method. This method returns the path after translation to micrometer units.
This method has been added in version 0.25.
@brief Replaces the shape by the given path (in micrometer units) This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally.
This method has been introduced in version 0.25.
dpoint
class
dpoint: Any = <attribute 'dpoint' of 'Shape' objects>
@brief Returns the point object as a \DPoint object in micrometer units See \point for a description of this method. This method returns the point after translation to micrometer units.
This method has been introduced in version 0.28.
@brief Replaces the shape by the given point (in micrometer units) This method replaces the shape by the given point, like \point= with a \Point argument does. This version translates the point from micrometer units to database units internally.
This method has been introduced in version 0.28.
dpolygon
class
dpolygon: Any = <attribute 'dpolygon' of 'Shape' objects>
@brief Returns the polygon object in micrometer units
Returns the polygon object that this shape refers to or converts the object to a polygon. The method returns the same object than \polygon, but translates it to micrometer units internally.
This method has been introduced in version 0.25.
@brief Replaces the shape by the given polygon (in micrometer units) This method replaces the shape by the given polygon, like \polygon= with a \Polygon argument does. This version translates the polygon from micrometer units to database units internally.
This method has been introduced in version 0.25.
dsimple_polygon
class
dsimple_polygon: Any = <attribute 'dsimple_polygon' of 'Shape' objects>
@brief Returns the simple polygon object in micrometer units
Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. The method returns the same object than \simple_polygon, but translates it to micrometer units internally.
This method has been introduced in version 0.25.
@brief Replaces the shape by the given simple polygon (in micrometer units) This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally.
This method has been introduced in version 0.25.
dtext
class
dtext: Any = <attribute 'dtext' of 'Shape' objects>
@brief Returns the path object as a \DText object in micrometer units See \text for a description of this method. This method returns the text after translation to micrometer units.
This method has been added in version 0.25.
@brief Replaces the shape by the given text (in micrometer units) This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally.
This method has been introduced in version 0.25.
edge
class
edge: Any = <attribute 'edge' of 'Shape' objects>
@brief Returns the edge object
Starting with version 0.23, this method returns nil, if the shape does not represent an edge.
@brief Replaces the shape by the given edge This method replaces the shape by the given edge. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
@brief Replaces the shape by the given edge (in micrometer units) This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally.
This method has been introduced in version 0.25.
edge_pair
class
edge_pair: Any = <attribute 'edge_pair' of 'Shape' objects>
@brief Returns the edge pair object
This method has been introduced in version 0.26.
@brief Replaces the shape by the given edge pair This method replaces the shape by the given edge pair. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.26.
@brief Replaces the shape by the given edge pair (in micrometer units) This method replaces the shape by the given edge pair, like \edge_pair= with a \EdgePair argument does. This version translates the edge pair from micrometer units to database units internally.
This method has been introduced in version 0.26.
layer
class
layer: int = <attribute 'layer' of 'Shape' objects>
@brief Returns the layer index of the layer the shape is on Throws an exception if the shape does not reside inside a cell.
This method has been added in version 0.23.
@brief Moves the shape to a layer given by the layer index object
This method has been added in version 0.23.
layer_info
class
layer_info: LayerInfo = <attribute 'layer_info' of 'Shape' objects>
@brief Returns the \LayerInfo object of the layer the shape is on If the shape does not reside inside a cell, an empty layer is returned.
This method has been added in version 0.23.
@brief Moves the shape to a layer given by a \LayerInfo object If no layer with the given properties exists, an exception is thrown.
This method has been added in version 0.23.
path
class
path: Any = <attribute 'path' of 'Shape' objects>
@brief Returns the path object
Starting with version 0.23, this method returns nil, if the shape does not represent a path.
@brief Replaces the shape by the given path object This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
@brief Replaces the shape by the given path (in micrometer units) This method replaces the shape by the given path, like \path= with a \Path argument does. This version translates the path from micrometer units to database units internally.
This method has been introduced in version 0.25.
path_bgnext
class
path_bgnext: int = <attribute 'path_bgnext' of 'Shape' objects>
@brief Gets the path's starting vertex extension
Applies to paths only. Will throw an exception if the object is not a path.
@brief Sets the path's starting vertex extension Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.23.
path_dbgnext
class
path_dbgnext: float = <attribute 'path_dbgnext' of 'Shape' objects>
@brief Gets the path's starting vertex extension in micrometer units
Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.25.
@brief Sets the path's starting vertex extension in micrometer units Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.25.
path_dendext
class
path_dendext: float = <attribute 'path_dendext' of 'Shape' objects>
@brief Gets the path's end vertex extension in micrometer units
Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.25.
@brief Sets the path's end vertex extension in micrometer units Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.25.
path_dwidth
class
path_dwidth: float = <attribute 'path_dwidth' of 'Shape' objects>
@brief Gets the path width in micrometer units
Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.25.
@brief Sets the path width in micrometer units Applies to paths only. Will throw an exception if the object is not a path. Conversion to database units is done internally.
This method has been introduced in version 0.25.
path_endext
class
path_endext: int = <attribute 'path_endext' of 'Shape' objects>
@brief Obtain the path's end vertex extension
Applies to paths only. Will throw an exception if the object is not a path.
@brief Sets the path's end vertex extension Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.23.
path_width
class
path_width: int = <attribute 'path_width' of 'Shape' objects>
@brief Gets the path width
Applies to paths only. Will throw an exception if the object is not a path.
@brief Sets the path width Applies to paths only. Will throw an exception if the object is not a path.
This method has been introduced in version 0.23.
point
class
point: Any = <attribute 'point' of 'Shape' objects>
@brief Returns the point object
This method has been introduced in version 0.28.
@brief Replaces the shape by the given point This method replaces the shape by the given point. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.28.
@brief Replaces the shape by the given point (in micrometer units) This method replaces the shape by the given point, like \point= with a \Point argument does. This version translates the point from micrometer units to database units internally.
This method has been introduced in version 0.28.
polygon
class
polygon: Any = <attribute 'polygon' of 'Shape' objects>
@brief Returns the polygon object
Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour.
Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon.
@brief Replaces the shape by the given polygon object This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
@brief Replaces the shape by the given polygon (in micrometer units) This method replaces the shape by the given polygon, like \polygon= with a \Polygon argument does. This version translates the polygon from micrometer units to database units internally.
This method has been introduced in version 0.25.
prop_id
class
prop_id: int = <attribute 'prop_id' of 'Shape' objects>
@brief Gets the properties ID associated with the shape
The \Layout object can be used to retrieve the actual properties associated with the ID.
@brief Sets the properties ID of this shape
The \Layout object can be used to retrieve an ID for a given set of properties. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
round_path
class
round_path: bool = <attribute 'round_path' of 'Shape' objects>
@brief Returns true, if the path has round ends
Applies to paths only. Will throw an exception if the object is not a path.
@brief The path will be a round-ended path if this property is set to true
Applies to paths only. Will throw an exception if the object is not a path. Please note that the extensions will apply as well. To get a path with circular ends, set the begin and end extensions to half the path's width.
This method has been introduced in version 0.23.
simple_polygon
class
simple_polygon: Any = <attribute 'simple_polygon' of 'Shape' objects>
@brief Returns the simple polygon object
Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon.
@brief Replaces the shape by the given simple polygon object This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
@brief Replaces the shape by the given simple polygon (in micrometer units) This method replaces the shape by the given text, like \simple_polygon= with a \SimplePolygon argument does. This version translates the polygon from micrometer units to database units internally.
This method has been introduced in version 0.25.
text
class
text: Any = <attribute 'text' of 'Shape' objects>
@brief Returns the text object
Starting with version 0.23, this method returns nil, if the shape does not represent a text.
@brief Replaces the shape by the given text object This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
@brief Replaces the shape by the given text (in micrometer units) This method replaces the shape by the given text, like \text= with a \Text argument does. This version translates the text from micrometer units to database units internally.
This method has been introduced in version 0.25.
text_dpos
class
text_dpos: DVector = <attribute 'text_dpos' of 'Shape' objects>
@brief Gets the text's position in micrometer units
Applies to texts only. Will throw an exception if the object is not a text.
This method has been added in version 0.25.
@brief Sets the text's position in micrometer units Applies to texts only. Will throw an exception if the object is not a text.
This method has been added in version 0.25.
text_dsize
class
text_dsize: float = <attribute 'text_dsize' of 'Shape' objects>
@brief Gets the text size in micrometer units
Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.25.
@brief Sets the text size in micrometer units
Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.25.
text_dtrans
class
text_dtrans: DTrans = <attribute 'text_dtrans' of 'Shape' objects>
@brief Gets the text transformation in micrometer units
Applies to texts only. Will throw an exception if the object is not a text.
This method has been added in version 0.25.
@brief Sets the text transformation in micrometer units Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.25.
text_font
class
text_font: int = <attribute 'text_font' of 'Shape' objects>
@brief Gets the text's font
Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text's font
Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.23.
text_halign
class
text_halign: int = <attribute 'text_halign' of 'Shape' objects>
@brief Gets the text's horizontal alignment
Applies to texts only. Will throw an exception if the object is not a text. The return value is 0 for left alignment, 1 for center alignment and 2 to right alignment.
This method has been introduced in version 0.22.
@brief Sets the text's horizontal alignment
Applies to texts only. Will throw an exception if the object is not a text. See \text_halign for a description of that property.
This method has been introduced in version 0.23.
text_pos
class
text_pos: Vector = <attribute 'text_pos' of 'Shape' objects>
@brief Gets the text's position
Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text's position Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text's position in micrometer units Applies to texts only. Will throw an exception if the object is not a text.
This method has been added in version 0.25.
text_rot
class
text_rot: int = <attribute 'text_rot' of 'Shape' objects>
@brief Gets the text's orientation code (see \Trans)
Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text's orientation code (see \Trans)
Applies to texts only. Will throw an exception if the object is not a text.
text_size
class
text_size: int = <attribute 'text_size' of 'Shape' objects>
@brief Gets the text size
Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text size
Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.23.
text_string
class
text_string: str = <attribute 'text_string' of 'Shape' objects>
@brief Obtain the text string
Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text string
Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.23.
text_trans
class
text_trans: Trans = <attribute 'text_trans' of 'Shape' objects>
@brief Gets the text transformation
Applies to texts only. Will throw an exception if the object is not a text.
@brief Sets the text transformation Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.23.
@brief Sets the text transformation in micrometer units Applies to texts only. Will throw an exception if the object is not a text.
This method has been introduced in version 0.25.
text_valign
class
text_valign: int = <attribute 'text_valign' of 'Shape' objects>
@brief Gets the text's vertical alignment
Applies to texts only. Will throw an exception if the object is not a text. The return value is 0 for top alignment, 1 for center alignment and 2 to bottom alignment.
This method has been introduced in version 0.22.
@brief Sets the text's vertical alignment
Applies to texts only. Will throw an exception if the object is not a text. See \text_valign for a description of that property.
This method has been introduced in version 0.23.
__copy__
method descriptor
__copy__() -> Shape
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Shape
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality operator
Equality of shapes is not specified by the identity of the objects but by the identity of the pointers - both shapes must refer to the same object.
__hash__
method descriptor
__hash__() -> int
@brief Hash function
The hash function enables Shape objects as keys in hashes.
This method has been introduced in version 0.29.1.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__lt__
method descriptor
__lt__() -> bool
@brief Less operator
The less operator implementation is based on pointers and not strictly reproducible.However, it is good enough so Shape objects can serve as keys in hashes (see also \hash).
This method has been introduced in version 0.29.1.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality operator
__repr__
method descriptor
__repr__() -> str
@brief Create a string showing the contents of the reference
This method has been introduced with version 0.16.
__str__
method descriptor
__str__() -> str
@brief Create a string showing the contents of the reference
This method has been introduced with version 0.16.
area
method descriptor
area() -> int
@brief Returns the area of the shape This method has been added in version 0.22.
array_dtrans
method descriptor
array_dtrans() -> DTrans
@brief Gets the array instance member transformation in micrometer units
This attribute is valid only if \is_array_member? is true. The transformation returned describes the relative transformation of the array member addressed. The displacement is given in micrometer units.
This method has been added in version 0.25.
array_trans
method descriptor
array_trans() -> Trans
@brief Gets the array instance member transformation
This attribute is valid only if \is_array_member? is true. The transformation returned describes the relative transformation of the array member addressed.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Returns the bounding box of the shape
create
method descriptor
create() -> None
@brief 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.
darea
method descriptor
darea() -> float
@brief Returns the area of the shape in square micrometer units This method has been added in version 0.25.
dbbox
method descriptor
dbbox() -> DBox
@brief Returns the bounding box of the shape in micrometer units This method has been added in version 0.25.
delete
method descriptor
delete() -> None
@brief Deletes the shape
After the shape is deleted, the shape object is emptied and points to nothing.
This method has been introduced in version 0.23.
delete_property
method descriptor
delete_property() -> None
@brief Deletes the user property with the given key This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dperimeter
method descriptor
dperimeter() -> float
@brief Returns the perimeter of the shape in micrometer units
This method will return an approximation of the perimeter for paths.
This method has been added in version 0.25.
drectangle
method descriptor
drectangle() -> Any
@brief Gets the rectangle in micron units if the object represents one or nil if not
If the shape represents a rectangle - i.e. a box or box polygon, a path with two points and no round ends - this method returns the box. If not, nil is returned.
This method has been introduced in version 0.29.
dup
method descriptor
dup() -> Shape
@brief Creates a copy of self
each_dedge
method descriptor
each_dedge() -> Iterator[DEdge]
each_dedge(contour: int) -> Iterator[DEdge]
each_dedge()
@brief Iterates over the edges of a single contour of the object and returns edges in micrometer units
This method iterates over all edges of polygons and simple polygons like \each_edge, but will deliver edges in micrometer units. Multiplication by the database unit is done internally.
This method has been introduced in version 0.25.
each_dpoint
method descriptor
each_dpoint() -> Iterator[DPoint]
@brief Iterates over all points of the object and returns points in micrometer units
This method iterates over all points of the object like \each_point, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally.
This method has been introduced in version 0.25.
each_dpoint_hole
method descriptor
each_dpoint_hole() -> Iterator[DPoint]
@brief Iterates over a hole contour of the object and returns points in micrometer units
This method iterates over all points of the object's contour' like \each_point_hole, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally.
This method has been introduced in version 0.25.
each_dpoint_hull
method descriptor
each_dpoint_hull() -> Iterator[DPoint]
@brief Iterates over the hull contour of the object and returns points in micrometer units
This method iterates over all points of the object's contour' like \each_point_hull, but it returns \DPoint objects that are given in micrometer units already. Multiplication with the database unit happens internally.
This method has been introduced in version 0.25.
each_edge
method descriptor
each_edge() -> Iterator[Edge]
each_edge(contour: int) -> Iterator[Edge]
each_edge()
@brief Iterates over the edges of a single contour of the object @param contour The contour number (0 for hull, 1 for first hole ...)
This method applies to polygons and simple polygons and delivers all edges that form the given contour of the polygon. The hull has contour number 0, the first hole has contour 1 etc. Hole edges are oriented counterclockwise while hull edges are oriented clockwise.
It will throw an exception if the object is not a polygon.
This method was introduced in version 0.24.
each_point
method descriptor
each_point() -> Iterator[Point]
@brief Iterates over all points of the object
This method applies to paths and delivers all points of the path's center line. It will throw an exception for other objects.
each_point_hole
method descriptor
each_point_hole() -> Iterator[Point]
@brief Iterates over the points of a hole contour
This method applies to polygons and delivers all points of the respective hole contour. It will throw an exception for other objects. Simple polygons deliver an empty sequence.
@param hole The hole index (see holes () method)
each_point_hull
method descriptor
each_point_hull() -> Iterator[Point]
@brief Iterates over the hull contour of the object
This method applies to polygons and delivers all points of the polygon hull contour. It will throw an exception for other objects.
has_prop_id
method descriptor
has_prop_id() -> bool
@brief Returns true, if the shape has properties, i.e. has a properties ID
hash
method descriptor
hash() -> int
@brief Hash function
The hash function enables Shape objects as keys in hashes.
This method has been introduced in version 0.29.1.
holes
method descriptor
holes() -> int
@brief Returns the number of holes
This method applies to polygons and will throw an exception for other objects.. Simple polygons deliver a value of zero.
is_array_member
method descriptor
is_array_member() -> bool
@brief Returns true, if the shape is a member of a shape array
is_box
method descriptor
is_box() -> bool
@brief Returns true if the shape is a box
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_edge
method descriptor
is_edge() -> bool
@brief Returns true, if the object is an edge
is_edge_pair
method descriptor
is_edge_pair() -> bool
@brief Returns true, if the object is an edge pair
This method has been introduced in version 0.26.
is_null
method descriptor
is_null() -> bool
@brief Returns true, if the shape reference is a null reference (not referring to a shape)
is_path
method descriptor
is_path() -> bool
@brief Returns true, if the shape is a path
is_point
method descriptor
is_point() -> bool
@brief Returns true, if the object is an point
This method has been introduced in version 0.28.
is_polygon
method descriptor
is_polygon() -> bool
@brief Returns true, if the shape is a polygon
This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the \polygon method also if is_polygon? does not return true.
is_simple_polygon
method descriptor
is_simple_polygon() -> bool
@brief Returns true, if the shape is a simple polygon
This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use \is_polygon? and \polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes.
is_text
method descriptor
is_text() -> bool
@brief Returns true, if the object is a text
is_user_object
method descriptor
is_user_object() -> bool
@brief Returns true if the shape is a user defined object
is_valid
method descriptor
is_valid() -> bool
@brief Returns true, if the shape is valid
After the shape is deleted, the shape object is no longer valid and this method returns false.
This method has been introduced in version 0.23.
layout
method descriptor
layout() -> Layout
@brief Gets a reference to the Layout the shape belongs to
This reference can be nil, if the Shape object is not living inside a layout.
This method has been introduced in version 0.22.
new
builtin
new() -> Shape
@brief Creates a new object of this class
path_dlength
method descriptor
path_dlength() -> float
@brief Returns the length of the path in micrometer units
Applies to paths only. Will throw an exception if the object is not a path. This method returns the length of the spine plus extensions if present. The value returned is given in micrometer units.
This method has been added in version 0.25.
path_length
method descriptor
path_length() -> int
@brief Returns the length of the path
Applies to paths only. Will throw an exception if the object is not a path. This method returns the length of the spine plus extensions if present.
This method has been added in version 0.23.
perimeter
method descriptor
perimeter() -> int
@brief Returns the perimeter of the shape
This method will return an approximation of the perimeter for paths.
This method has been added in version 0.23.
properties
method descriptor
properties() -> Any
@brief Gets the user properties This method is a convenience method that gets the properties of the shape as a single hash.
This method has been introduced in version 0.29.5.
property
method descriptor
property() -> Any
@brief Gets the user property with the given key This method is a convenience method that gets the property with the given key. If no property with that key does not exist, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. This method has been introduced in version 0.22.
rectangle
method descriptor
rectangle() -> Any
@brief Gets the rectangle if the object represents one or nil if not
If the shape represents a rectangle - i.e. a box or box polygon, a path with two points and no round ends - this method returns the box. If not, nil is returned.
This method has been introduced in version 0.29.
set_property
method descriptor
set_property() -> None
@brief Sets the user property with the given key to the given value This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.
This method has been introduced in version 0.22.
shapes
method descriptor
shapes() -> Shapes
@brief Gets a reference to the Shapes container the shape lives in
This reference can be nil, if the Shape object is not referring to an actual shape.
This method has been introduced in version 0.22.
t_box
builtin
t_box() -> int
t_box_array
builtin
t_box_array() -> int
t_box_array_member
builtin
t_box_array_member() -> int
t_edge
builtin
t_edge() -> int
t_edge_pair
builtin
t_edge_pair() -> int
t_null
builtin
t_null() -> int
t_path
builtin
t_path() -> int
t_path_ptr_array
builtin
t_path_ptr_array() -> int
t_path_ptr_array_member
builtin
t_path_ptr_array_member() -> int
t_path_ref
builtin
t_path_ref() -> int
t_point
builtin
t_point() -> int
t_polygon
builtin
t_polygon() -> int
t_polygon_ptr_array
builtin
t_polygon_ptr_array() -> int
t_polygon_ptr_array_member
builtin
t_polygon_ptr_array_member() -> int
t_polygon_ref
builtin
t_polygon_ref() -> int
t_short_box
builtin
t_short_box() -> int
t_short_box_array
builtin
t_short_box_array() -> int
t_short_box_array_member
builtin
t_short_box_array_member() -> int
t_simple_polygon
builtin
t_simple_polygon() -> int
t_simple_polygon_ptr_array
builtin
t_simple_polygon_ptr_array() -> int
t_simple_polygon_ptr_array_member
builtin
t_simple_polygon_ptr_array_member() -> int
t_simple_polygon_ref
builtin
t_simple_polygon_ref() -> int
t_text
builtin
t_text() -> int
t_text_ptr_array
builtin
t_text_ptr_array() -> int
t_text_ptr_array_member
builtin
t_text_ptr_array_member() -> int
t_text_ref
builtin
t_text_ref() -> int
t_user_object
builtin
t_user_object() -> int
to_s
method descriptor
to_s() -> str
@brief Create a string showing the contents of the reference
This method has been introduced with version 0.16.
transform
method descriptor
transform(trans: DCplxTrans) -> None
transform(trans: DTrans) -> None
transform(trans: ICplxTrans) -> None
transform(trans: Trans) -> None
transform()
@brief Transforms the shape with the given complex transformation, given in micrometer units This method has been introduced in version 0.25.
type
method descriptor
type() -> int
@brief Return the type of the shape
The returned values are the t_... constants available through the corresponding class members.
ShapeCollection
@brief A base class for the shape collections (\Region, \Edges, \EdgePairs and \Texts)
This class has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief A base class for the shape collections (\\Region, \\Edges, \\EdgePairs and \\Texts)\n\nThis class has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 170
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ShapeCollection' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> ShapeCollection
@brief Creates a new object of this class
ShapeProcessor
@brief The shape processor (boolean, sizing, merge on shapes)
The shape processor implements the boolean and edge set operations (size, merge). Because the shape processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. The shape processor is similar to the \EdgeProcessor. The latter is specialized on handling polygons and edges directly.
__doc__
class
__doc__ = '@brief The shape processor (boolean, sizing, merge on shapes)\n\nThe shape processor implements the boolean and edge set operations (size, merge). Because the shape processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. The shape processor is similar to the \\EdgeProcessor. The latter is specialized on handling polygons and edges directly. '
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 171
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ShapeProcessor' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> ShapeProcessor
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ShapeProcessor
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
boolean
method descriptor
boolean(in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int) -> List[Edge]
boolean(in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int) -> List[Edge]
boolean(layout_a: Layout, cell_a: Cell, layer_a: int, layout_b: Layout, cell_b: Cell, layer_b: int, out: Shapes, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None
boolean()
@brief Boolean operation on two given shape sets into an edge set
See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes rather than polygons for input and produces an edge set.
This version does not feature a transformation for each shape (unity is assumed).
@param in_a The set of shapes to use for input A @param in_b The set of shapes to use for input A @param mode The boolean operation (see \EdgeProcessor)
boolean_to_polygon
method descriptor
boolean_to_polygon(in_a: Sequence[Shape], in_b: Sequence[Shape], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
boolean_to_polygon(in_a: Sequence[Shape], trans_a: Sequence[CplxTrans], in_b: Sequence[Shape], trans_b: Sequence[CplxTrans], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
boolean_to_polygon()
@brief Boolean operation on two given shape sets into a polygon set
See the \EdgeProcessor for a description of the boolean operations. This implementation takes shapes rather than polygons for input and produces a polygon set.
This version does not feature a transformation for each shape (unity is assumed).
@param in_a The set of shapes to use for input A @param in_b The set of shapes to use for input A @param mode The boolean operation (see \EdgeProcessor) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if minimum polygons should be created for touching corners
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ShapeProcessor
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
merge
method descriptor
merge(in_: Sequence[Shape], min_wc: int) -> List[Edge]
merge(in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int) -> List[Edge]
merge(layout: Layout, cell: Cell, layer: int, out: Shapes, hierarchical: bool, min_wc: int, resolve_holes: bool, min_coherence: bool) -> None
merge()
@brief Merge the given shapes
See the \EdgeProcessor for a description of the merge method. This implementation takes shapes rather than polygons for input and produces an edge set.
This version does not feature a transformation for each shape (unity is assumed).
@param in The set of shapes to merge @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping)
merge_to_polygon
method descriptor
merge_to_polygon(in_: Sequence[Shape], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
merge_to_polygon(in_: Sequence[Shape], trans: Sequence[CplxTrans], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
merge_to_polygon()
@brief Merge the given shapes
See the \EdgeProcessor for a description of the merge method. This implementation takes shapes rather than polygons for input and produces a polygon set.
This version does not feature a transformation for each shape (unity is assumed).
@param in The set of shapes to merge @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if minimum polygons should be created for touching corners
new
builtin
new() -> ShapeProcessor
@brief Creates a new object of this class
size
method descriptor
size(in_: Sequence[Shape], d: int, mode: int) -> List[Edge]
size(in_: Sequence[Shape], dx: int, dy: int, mode: int) -> List[Edge]
size(in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int) -> List[Edge]
size(in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int) -> List[Edge]
size(layout: Layout, cell: Cell, layer: int, out: Shapes, d: int, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None
size(layout: Layout, cell: Cell, layer: int, out: Shapes, dx: int, dy: int, mode: int, hierarchical: bool, resolve_holes: bool, min_coherence: bool) -> None
size()
@brief Size the given shapes
See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes rather than polygons for input and produces an edge set.
This version does not feature a transformation for each shape (unity is assumed).
@param in The set of shapes to size @param dx The sizing value in x-direction @param dy The sizing value in y-direction @param mode The sizing mode (see \EdgeProcessor)
size_to_polygon
method descriptor
size_to_polygon(in_: Sequence[Shape], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_to_polygon(in_: Sequence[Shape], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_to_polygon(in_: Sequence[Shape], trans: Sequence[CplxTrans], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_to_polygon(in_: Sequence[Shape], trans: Sequence[CplxTrans], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]
size_to_polygon()
@brief Size the given shapes
See the \EdgeProcessor for a description of the sizing method. This implementation takes shapes rather than polygons for input and produces a polygon set.
This version does not feature a transformation for each shape (unity is assumed).
@param in The set of shapes to size @param dx The sizing value in x-direction @param dy The sizing value in y-direction @param mode The sizing mode (see \EdgeProcessor) @param resolve_holes true, if holes should be resolved into the hull @param min_coherence true, if minimum polygons should be created for touching corners
Shapes
@brief A collection of shapes
A shapes collection is a collection of geometrical objects, such as polygons, boxes, paths, edges, edge pairs or text objects.
Shapes objects are the basic containers for geometrical objects of a cell. Inside a cell, there is one Shapes object per layer.
SAll
class
SAll: int = 1048575
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SAllWithProperties
class
SAllWithProperties: int = 2097151
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SBoxes
class
SBoxes: int = 30720
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SEdgePairs
class
SEdgePairs: int = 128
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SEdges
class
SEdges: int = 64
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SPaths
class
SPaths: int = 1792
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SPoints
class
SPoints: int = 262144
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SPolygons
class
SPolygons: int = 63
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SProperties
class
SProperties: int = 1048576
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SRegions
class
SRegions: int = 32575
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
STexts
class
STexts: int = 229376
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SUserObjects
class
SUserObjects: int = 524288
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A collection of shapes\n\nA shapes collection is a collection of geometrical objects, such as polygons, boxes, paths, edges, edge pairs or text objects.\n\nShapes objects are the basic containers for geometrical objects of a cell. Inside a cell, there is one Shapes object per layer.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 172
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Shapes' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Shapes
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Shapes
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__iter__
method descriptor
__iter__() -> Iterator[Shape]
@brief Gets all shapes
This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16
__len__
method descriptor
__len__() -> int
@brief Gets the number of shapes in this container This method was introduced in version 0.16 @return The number of shapes in this container
assign
method descriptor
assign() -> None
@brief Assigns another object to self
break_polygons
method descriptor
break_polygons() -> None
@brief Breaks the polygons of the shape container into smaller ones
There are two criteria for splitting a polygon: a polygon is split into parts with less then 'max_vertex_count' points and an bounding box-to-polygon area ratio less than 'max_area_ratio'. The area ratio is supposed to render polygons whose bounding box is a better approximation. This applies for example to 'L' shape polygons.
Using a value of 0 for either limit means that the respective limit isn't checked. Breaking happens by cutting the polygons into parts at 'good' locations. The algorithm does not have a specific goal to minimize the number of parts for example. The only goal is to achieve parts within the given limits.
Breaking also applies to paths if their polygon representation satisfies the breaking criterion. In that case, paths are converted to polygons and broken into smaller parts.
This method has been introduced in version 0.29.5.
cell
method descriptor
cell() -> Cell
@brief Gets the cell the shape container belongs to This method returns nil if the shape container does not belong to a cell.
This method has been added in version 0.28.
clear
method descriptor
clear() -> None
clear(flags: int) -> None
clear()
@brief Clears certain shape types from the shape container Only shapes matching the shape types from 'flags' are removed. 'flags' is a combination of the S... constants.
This method has been introduced in version 0.28.9.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dump_mem_statistics
method descriptor
dump_mem_statistics() -> None
@hide
dup
method descriptor
dup() -> Shapes
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[Shape]
each(flags: int) -> Iterator[Shape]
each()
@brief Gets all shapes
This call is equivalent to each(SAll). This convenience method has been introduced in version 0.16
each_overlapping
method descriptor
each_overlapping(flags: int, region: Box) -> Iterator[Shape]
each_overlapping(flags: int, region: DBox) -> Iterator[Shape]
each_overlapping(region: Box) -> Iterator[Shape]
each_overlapping(region: DBox) -> Iterator[Shape]
each_overlapping()
@brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units @param region The rectangular search region as a \DBox object in micrometer units This call is equivalent to each_touching(SAll,region).
This method was introduced in version 0.25
each_touching
method descriptor
each_touching(flags: int, region: Box) -> Iterator[Shape]
each_touching(flags: int, region: DBox) -> Iterator[Shape]
each_touching(region: Box) -> Iterator[Shape]
each_touching(region: DBox) -> Iterator[Shape]
each_touching()
@brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units @param region The rectangular search region as a \DBox object in micrometer units This call is equivalent to each_touching(SAll,region).
This method was introduced in version 0.25
erase
method descriptor
erase() -> None
@brief Erases the shape pointed to by the given \Shape object This method has been introduced in version 0.16. It can only be used in editable mode. Erasing a shape will invalidate the shape reference. Access to this reference may then render invalid results.
@param shape The shape which to destroy
find
method descriptor
find() -> Shape
@brief Finds a shape inside this collected This method has been introduced in version 0.21. This method tries to find the given shape in this collection. The original shape may be located in another collection. If the shape is found, this method returns a reference to the shape in this collection, otherwise a null reference is returned.
insert
method descriptor
insert(box: Box) -> Shape
insert(box: Box, property_id: int) -> Shape
insert(box: DBox) -> Shape
insert(box: DBox, property_id: int) -> Shape
insert(edge: DEdge) -> Shape
insert(edge: DEdge, property_id: int) -> Shape
insert(edge: Edge) -> Shape
insert(edge: Edge, property_id: int) -> Shape
insert(edge_pair: DEdgePair) -> Shape
insert(edge_pair: DEdgePair, property_id: int) -> Shape
insert(edge_pair: EdgePair) -> Shape
insert(edge_pair: EdgePair, property_id: int) -> Shape
insert(edge_pairs: EdgePairs) -> None
insert(edge_pairs: EdgePairs, trans: DCplxTrans) -> None
insert(edge_pairs: EdgePairs, trans: ICplxTrans) -> None
insert(edges: Edges) -> None
insert(edges: Edges, trans: DCplxTrans) -> None
insert(edges: Edges, trans: ICplxTrans) -> None
insert(iter: RecursiveShapeIterator) -> None
insert(iter: RecursiveShapeIterator, trans: ICplxTrans) -> None
insert(path: DPath) -> Shape
insert(path: DPath, property_id: int) -> Shape
insert(path: Path) -> Shape
insert(path: Path, property_id: int) -> Shape
insert(point: DPoint) -> Shape
insert(point: Point) -> Shape
insert(polygon: DPolygon) -> Shape
insert(polygon: DPolygon, property_id: int) -> Shape
insert(polygon: Polygon) -> Shape
insert(polygon: Polygon, property_id: int) -> Shape
insert(region: Region) -> None
insert(region: Region, trans: DCplxTrans) -> None
insert(region: Region, trans: ICplxTrans) -> None
insert(shape: Shape) -> Shape
insert(shape: Shape, trans: DCplxTrans) -> Shape
insert(shape: Shape, trans: DTrans) -> Shape
insert(shape: Shape, trans: ICplxTrans) -> Shape
insert(shape: Shape, trans: Trans) -> Shape
insert(shapes: Shapes) -> None
insert(shapes: Shapes, flags: int) -> None
insert(shapes: Shapes, flags: int, trans: ICplxTrans) -> None
insert(shapes: Shapes, trans: ICplxTrans) -> None
insert(simple_polygon: DSimplePolygon) -> Shape
insert(simple_polygon: DSimplePolygon, property_id: int) -> Shape
insert(simple_polygon: SimplePolygon) -> Shape
insert(simple_polygon: SimplePolygon, property_id: int) -> Shape
insert(text: DText) -> Shape
insert(text: DText, property_id: int) -> Shape
insert(text: Text) -> Shape
insert(text: Text, property_id: int) -> Shape
insert(texts: Texts) -> None
insert(texts: Texts, trans: DCplxTrans) -> None
insert(texts: Texts, trans: ICplxTrans) -> None
insert()
@brief Inserts a micrometer-unit polygon with properties into the shapes list @return A reference to the new shape (a \Shape object) This method behaves like the \insert version with a \Polygon argument and a property ID, except that it will internally translate the polygon from micrometer to database units.
This variant has been introduced in version 0.25.
insert_as_edges
method descriptor
insert_as_edges(edge_pairs: EdgePairs) -> None
insert_as_edges(edge_pairs: EdgePairs, trans: DCplxTrans) -> None
insert_as_edges(edge_pairs: EdgePairs, trans: ICplxTrans) -> None
insert_as_edges()
@brief Inserts the edge pairs from the edge pair collection as individual into this shape container with a transformation (given in micrometer units) @param edges The edge pairs to insert @param trans The transformation to apply (displacement in micrometer units)
This method inserts all edge pairs from the edge pair collection into this shape container. Each edge from the edge pair is inserted individually into the shape container. Before each edge is inserted into the shape collection, the given transformation is applied.
This method has been introduced in version 0.25.
insert_as_polygons
method descriptor
insert_as_polygons(edge_pairs: EdgePairs, e: DCplxTrans, trans: float) -> None
insert_as_polygons(edge_pairs: EdgePairs, e: ICplxTrans, trans: int) -> None
insert_as_polygons(edge_pairs: EdgePairs, e: float) -> None
insert_as_polygons(edge_pairs: EdgePairs, e: int) -> None
insert_as_polygons()
@brief Inserts the edge pairs from the edge pair collection as polygons into this shape container with a transformation @param edges The edge pairs to insert @param e The extension to apply when converting the edges to polygons (in micrometer units) @param trans The transformation to apply (displacement in micrometer units)
This method is identical to the version with a integer-type \e and \trans parameter, but for this version the \e parameter is given in micrometer units and the \trans parameter is a micrometer-unit transformation.
This method has been introduced in version 0.25.
insert_box
method descriptor
insert_box() -> Shape
@brief Inserts a box into the shapes list @return A reference to the new shape (a \Shape object)
Starting with version 0.16, this method returns a reference to the newly created shape
insert_box_with_properties
method descriptor
insert_box_with_properties() -> Shape
@brief Inserts a box with properties into the shapes list @return A reference to the new shape (a \Shape object) The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape
insert_edge
method descriptor
insert_edge() -> Shape
@brief Inserts an edge into the shapes list
Starting with version 0.16, this method returns a reference to the newly created shape
insert_edge_with_properties
method descriptor
insert_edge_with_properties() -> Shape
@brief Inserts an edge with properties into the shapes list @return A reference to the new shape (a \Shape object) The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape.
insert_path
method descriptor
insert_path() -> Shape
@brief Inserts a path into the shapes list @return A reference to the new shape (a \Shape object)
Starting with version 0.16, this method returns a reference to the newly created shape
insert_path_with_properties
method descriptor
insert_path_with_properties() -> Shape
@brief Inserts a path with properties into the shapes list @return A reference to the new shape (a \Shape object) The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape
insert_point
method descriptor
insert_point() -> Shape
@brief Inserts an point into the shapes list
This variant has been introduced in version 0.28.
insert_polygon
method descriptor
insert_polygon() -> Shape
@brief Inserts a polygon into the shapes list @return A reference to the new shape (a \Shape object)
Starting with version 0.16, this method returns a reference to the newly created shape
insert_polygon_with_properties
method descriptor
insert_polygon_with_properties() -> Shape
@brief Inserts a polygon with properties into the shapes list @return A reference to the new shape (a \Shape object) The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape
insert_simple_polygon
method descriptor
insert_simple_polygon() -> Shape
@brief Inserts a simple polygon into the shapes list @return A reference to the new shape (a \Shape object)
Starting with version 0.16, this method returns a reference to the newly created shape
insert_simple_polygon_with_properties
method descriptor
insert_simple_polygon_with_properties() -> Shape
@brief Inserts a simple polygon with properties into the shapes list @return A reference to the new shape (a \Shape object) The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape
insert_text
method descriptor
insert_text() -> Shape
@brief Inserts a text into the shapes list @return A reference to the new shape (a \Shape object)
Starting with version 0.16, this method returns a reference to the newly created shape
insert_text_with_properties
method descriptor
insert_text_with_properties() -> Shape
@brief Inserts a text with properties into the shapes list @return A reference to the new shape (a \Shape object) The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_empty
method descriptor
is_empty() -> bool
@brief Returns a value indicating whether the shapes container is empty This method has been introduced in version 0.20.
is_valid
method descriptor
is_valid() -> bool
@brief Tests if the given \Shape object is still pointing to a valid object This method has been introduced in version 0.16. If the shape represented by the given reference has been deleted, this method returns false. If however, another shape has been inserted already that occupies the original shape's position, this method will return true again.
layout
method descriptor
layout() -> Layout
@brief Gets the layout object the shape container belongs to This method returns nil if the shape container does not belong to a layout.
This method has been added in version 0.28.
new
builtin
new() -> Shapes
@brief Creates a new object of this class
replace
method descriptor
replace(shape: Shape, box: Box) -> Shape
replace(shape: Shape, box: DBox) -> Shape
replace(shape: Shape, edge: DEdge) -> Shape
replace(shape: Shape, edge: Edge) -> Shape
replace(shape: Shape, edge_pair: DEdgePair) -> Shape
replace(shape: Shape, edge_pair: EdgePair) -> Shape
replace(shape: Shape, path: DPath) -> Shape
replace(shape: Shape, path: Path) -> Shape
replace(shape: Shape, point: DPoint) -> Shape
replace(shape: Shape, point: Point) -> Shape
replace(shape: Shape, polygon: DPolygon) -> Shape
replace(shape: Shape, polygon: Polygon) -> Shape
replace(shape: Shape, simple_polygon: DSimplePolygon) -> Shape
replace(shape: Shape, simple_polygon: SimplePolygon) -> Shape
replace(shape: Shape, text: DText) -> Shape
replace(shape: Shape, text: Text) -> Shape
replace()
@brief Replaces the given shape with a polygon given in micrometer units @return A reference to the new shape (a \Shape object)
This method behaves like the \replace version with a \Polygon argument, except that it will internally translate the polygon from micrometer to database units.
This variant has been introduced in version 0.25.
replace_prop_id
method descriptor
replace_prop_id() -> Shape
@brief Replaces (or install) the properties of a shape @return A \Shape object representing the new shape This method has been introduced in version 0.16. It can only be used in editable mode. Changes the properties Id of the given shape or install a properties Id on that shape if it does not have one yet. The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. This method will potentially invalidate the shape reference passed to it. Use the reference returned for future references.
s_all
builtin
s_all() -> int
@brief Indicates that all shapes shall be retrieved You can use this constant to construct 'except' classes - e.g. to specify 'all shape types except boxes' use
@code SAll - SBoxes @/code
s_all_with_properties
builtin
s_all_with_properties() -> int
@brief Indicates that all shapes with properties shall be retrieved Using this selector means to retrieve only shapes with properties.You can use this constant to construct 'except' classes - e.g. to specify 'all shape types with properties except boxes' use
@code SAllWithProperties - SBoxes @/code
s_boxes
builtin
s_boxes() -> int
@brief Indicates that boxes shall be retrieved
s_edge_pairs
builtin
s_edge_pairs() -> int
@brief Indicates that edge pairs shall be retrieved
s_edges
builtin
s_edges() -> int
@brief Indicates that edges shall be retrieved
s_paths
builtin
s_paths() -> int
@brief Indicates that paths shall be retrieved
s_points
builtin
s_points() -> int
@brief Indicates that points shall be retrieved This constant has been added in version 0.28.
s_polygons
builtin
s_polygons() -> int
@brief Indicates that polygons shall be retrieved
s_properties
builtin
s_properties() -> int
@brief Indicates that only shapes with properties shall be retrieved You can or-combine this flag with the plain shape types to select a certain shape type, but only those shapes with properties. For example to select boxes with properties, use 'SProperties | SBoxes'.
s_regions
builtin
s_regions() -> int
@brief Indicates that objects which can be polygonized shall be retrieved (paths, boxes, polygons etc.)
This constant has been added in version 0.27.
s_texts
builtin
s_texts() -> int
@brief Indicates that texts be retrieved
s_user_objects
builtin
s_user_objects() -> int
@brief Indicates that user objects shall be retrieved
size
method descriptor
size() -> int
@brief Gets the number of shapes in this container This method was introduced in version 0.16 @return The number of shapes in this container
transform
method descriptor
transform(shape: Shape, trans: DCplxTrans) -> Shape
transform(shape: Shape, trans: DTrans) -> Shape
transform(shape: Shape, trans: ICplxTrans) -> Shape
transform(shape: Shape, trans: Trans) -> Shape
transform(trans: DCplxTrans) -> None
transform(trans: DTrans) -> None
transform(trans: ICplxTrans) -> None
transform(trans: Trans) -> None
transform()
@brief Transforms the shape given by the reference with the given complex transformation, where the transformation is given in micrometer units @param trans The transformation to apply (displacement in micrometer units) @return A reference (a \Shape object) to the new shape The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only. This method has been introduced in version 0.25.
SimplePolygon
@brief A simple polygon class
A simple polygon consists of an outer hull only. To support polygons with holes, use \Polygon. The hull contour consists of several points. The point list is normalized such that the leftmost, lowest point is the first one. The orientation is normalized such that the orientation of the hull contour is clockwise.
It is in no way checked that the contours are not overlapping This must be ensured by the user of the object when filling the contours.
The \SimplePolygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DSimplePolygon.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A simple polygon class\n\nA simple polygon consists of an outer hull only. To support polygons with holes, use \\Polygon.\nThe hull contour consists of several points. The point\nlist is normalized such that the leftmost, lowest point is \nthe first one. The orientation is normalized such that\nthe orientation of the hull contour is clockwise.\n\nIt is in no way checked that the contours are not overlapping\nThis must be ensured by the user of the object\nwhen filling the contours.\n\nThe \\SimplePolygon class stores coordinates in integer format. A class that stores floating-point coordinates is \\DSimplePolygon.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 152
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'SimplePolygon' objects>
list of weak references to the object
points
class
points: None = <attribute 'points' of 'SimplePolygon' objects>
@brief Sets the points of the simple polygon
@param pts An array of points to assign to the simple polygon
See the constructor description for details about raw mode.
__copy__
method descriptor
__copy__() -> SimplePolygon
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> SimplePolygon
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns a value indicating whether self is equal to p @param p The object to compare against
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(box: Box) -> None
__init__(dpolygon: DSimplePolygon) -> None
__init__(pts: Sequence[Point], raw: Optional[bool] = ...) -> None
__init__()
@brief Constructor converting a box to a polygon
@param box The box to convert to a polygon
__lt__
method descriptor
__lt__() -> bool
@brief Returns a value indicating whether self is less than p @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
This method has been introduced in version 0.25.
__mul__
method descriptor
__mul__() -> SimplePolygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__ne__
method descriptor
__ne__() -> bool
@brief Returns a value indicating whether self is not equal to p @param p The object to compare against
__repr__
method descriptor
__repr__() -> str
@brief Returns a string representing the polygon
__rmul__
method descriptor
__rmul__() -> SimplePolygon
@brief Scales the polygon by some factor
Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded.
__str__
method descriptor
__str__() -> str
@brief Returns a string representing the polygon
area
method descriptor
area() -> int
@brief Gets the area of the polygon The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.
area2
method descriptor
area2() -> int
@brief Gets the double area of the polygon This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types.
This method has been introduced in version 0.26.1
area_upper_manhattan_bound
method descriptor
area_upper_manhattan_bound() -> int
@hide
area_upper_manhattan_bound2
method descriptor
area_upper_manhattan_bound2() -> int
@hide
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Returns the bounding box of the simple polygon
break_
method descriptor
break_() -> List[SimplePolygon]
@brief Splits the polygon into parts with a maximum vertex count and area ratio The area ratio is the ratio between the bounding box area and the polygon area. Higher values mean more 'skinny' polygons.
This method will split the input polygon into pieces having a maximum of 'max_vertex_count' vertices and an area ratio less than 'max_area_ratio'. 'max_vertex_count' can be zero. In this case the limit is ignored. Also 'max_area_ratio' can be zero, in which case it is ignored as well.
The method of splitting is unspecified. The algorithm will apply 'split' recursively until the parts satisfy the limits.
This method has been introduced in version 0.29.
compress
method descriptor
compress() -> None
@brief Compressed the simple polygon.
This method removes redundant points from the polygon, such as points being on a line formed by two other points. If remove_reflected is true, points are also removed if the two adjacent edges form a spike.
@param remove_reflected See description of the functionality.
This method was introduced in version 0.18.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> SimplePolygon
@brief Creates a copy of self
each_edge
method descriptor
each_edge() -> Iterator[Edge]
@brief Iterates over the edges that make up the simple polygon
each_point
method descriptor
each_point() -> Iterator[Point]
@brief Iterates over the points that make up the simple polygon
ellipse
builtin
ellipse() -> SimplePolygon
@brief Creates a simple polygon approximating an ellipse
@param box The bounding box of the ellipse @param n The number of points that will be used to approximate the ellipse
This method has been introduced in version 0.23.
extract_rad
method descriptor
extract_rad() -> List[Any]
@brief Extracts the corner radii from a rounded polygon
Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul @li The polygon with the rounded corners replaced by edgy ones @/li @li The radius of the inner corners @/li @li The radius of the outer corners @/li @li The number of points per full circle @/li @/ul
This method is based on some assumptions and may fail. In this case, an empty array is returned.
If successful, the following code will more or less render the original polygon and parameters
@code p = ... # some polygon p.round_corners(ri, ro, n) (p2, ri2, ro2, n2) = p.extract_rad
-> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits)
@/code
This method was introduced in version 0.25.
from_dpoly
builtin
from_dpoly() -> SimplePolygon
@brief Creates an integer coordinate polygon from a floating-point coordinate polygon
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'.
from_s
builtin
from_s() -> SimplePolygon
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given polygon. This method enables polygons as hash keys.
This method has been introduced in version 0.25.
inside
method descriptor
inside() -> bool
@brief Gets a value indicating whether the given point is inside the polygon If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise.
is_box
method descriptor
is_box() -> bool
@brief Returns a value indicating whether the polygon is a simple box.
A polygon is a box if it is identical to its bounding box.
@return True if the polygon is a box.
This method was introduced in version 0.23.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_empty
method descriptor
is_empty() -> bool
@brief Returns a value indicating whether the polygon is empty
is_halfmanhattan
method descriptor
is_halfmanhattan() -> bool
@brief Returns a value indicating whether the polygon is half-manhattan Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping.
This predicate was introduced in version 0.27.
is_rectilinear
method descriptor
is_rectilinear() -> bool
@brief Returns a value indicating whether the polygon is rectilinear
minkowski_sum
method descriptor
minkowski_sum(b: Box, resolve_holes: bool) -> Polygon
minkowski_sum(c: Sequence[Point], resolve_holes: bool) -> Polygon
minkowski_sum(e: Edge, resolve_holes: bool) -> Polygon
minkowski_sum(p: SimplePolygon, resolve_holes: bool) -> Polygon
minkowski_sum()
@brief Computes the Minkowski sum of a polygon and a contour of points (a trace)
@param c The contour (a series of points forming the trace). @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull.
@return The new polygon representing the Minkowski sum of self and c.
This method was introduced in version 0.22.
minkowsky_sum
method descriptor
minkowsky_sum(b: Box, resolve_holes: bool) -> Polygon
minkowsky_sum(c: Sequence[Point], resolve_holes: bool) -> Polygon
minkowsky_sum(e: Edge, resolve_holes: bool) -> Polygon
minkowsky_sum(p: SimplePolygon, resolve_holes: bool) -> Polygon
minkowsky_sum()
@brief Computes the Minkowski sum of a polygon and a contour of points (a trace)
@param c The contour (a series of points forming the trace). @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull.
@return The new polygon representing the Minkowski sum of self and c.
This method was introduced in version 0.22.
move
method descriptor
move(p: Vector) -> SimplePolygon
move(x: int, y: int) -> SimplePolygon
move()
@brief Moves the polygon.
Moves the polygon by the given offset and returns the moved polygon. The polygon is overwritten.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon (self).
moved
method descriptor
moved(p: Vector) -> SimplePolygon
moved(x: int, y: int) -> SimplePolygon
moved()
@brief Returns the moved polygon (does not modify self)
Moves the polygon by the given offset and returns the moved polygon. The polygon is not modified.
@param x The x distance to move the polygon. @param y The y distance to move the polygon.
@return The moved polygon.
This method has been introduced in version 0.23.
new
builtin
new() -> SimplePolygon
new(box: Box) -> SimplePolygon
new(dpolygon: DSimplePolygon) -> SimplePolygon
new(pts: Sequence[Point], raw: Optional[bool] = ...) -> SimplePolygon
new()
@brief Constructor converting a box to a polygon
@param box The box to convert to a polygon
num_points
method descriptor
num_points() -> int
@brief Gets the number of points
perimeter
method descriptor
perimeter() -> int
@brief Gets the perimeter of the polygon The perimeter is sum of the lengths of all edges making up the polygon.
point
method descriptor
point() -> Point
@brief Gets a specific point of the contour@param p The index of the point to get If the index of the point is not a valid index, a default value is returned. This method was introduced in version 0.18.
round_corners
method descriptor
round_corners() -> SimplePolygon
@brief Rounds the corners of the polygon
Replaces the corners of the polygon with circle segments.
@param rinner The circle radius of inner corners (in database units). @param router The circle radius of outer corners (in database units). @param n The number of points per full circle.
@return The new polygon.
This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types.
set_points
method descriptor
set_points() -> None
@brief Sets the points of the simple polygon
@param pts An array of points to assign to the simple polygon @param raw If true, the points are taken as they are
See the constructor description for details about raw mode.
This method has been added in version 0.24.
split
method descriptor
split() -> List[SimplePolygon]
@brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes.
The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit.
This method has been introduced in version 0.25.3.
to_dtype
method descriptor
to_dtype() -> DSimplePolygon
@brief Converts the polygon to a floating-point coordinate polygon
The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Returns a string representing the polygon
touches
method descriptor
touches(box: Box) -> bool
touches(edge: Edge) -> bool
touches(polygon: Polygon) -> bool
touches(simple_polygon: SimplePolygon) -> bool
touches()
@brief Returns true, if the polygon touches the other polygon. The polygons touch if they overlap or their contours share at least one point.
This method was introduced in version 0.25.1.
transform
method descriptor
transform(t: ICplxTrans) -> SimplePolygon
transform(t: Trans) -> SimplePolygon
transform()
@brief Transforms the simple polygon (in-place)
Transforms the simple polygon with the given transformation. Modifies self and returns self. An out-of-place version which does not modify self is \transformed.
@param t The transformation to apply.
This method has been introduced in version 0.24.
transformed
method descriptor
transformed(t: CplxTrans) -> DSimplePolygon
transformed(t: ICplxTrans) -> SimplePolygon
transformed(t: Trans) -> SimplePolygon
transformed()
@brief Transforms the simple polygon.
Transforms the simple polygon with the given complex transformation. Does not modify the simple polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed simple polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
transformed_cplx
method descriptor
transformed_cplx() -> DSimplePolygon
@brief Transforms the simple polygon.
Transforms the simple polygon with the given complex transformation. Does not modify the simple polygon but returns the transformed polygon.
@param t The transformation to apply.
@return The transformed simple polygon.
With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations.
SubCircuit
Bases: klayout.dbcore.NetlistObject
@brief A subcircuit inside a circuit. Circuits may instantiate other circuits as subcircuits similar to cells in layouts. Such an instance is a subcircuit. A subcircuit refers to a circuit implementation (a \Circuit object), and presents connections through pins. The pins of a subcircuit can be connected to nets. The subcircuit pins are identical to the outgoing pins of the circuit the subcircuit refers to.
Subcircuits connect to nets through the \SubCircuit#connect_pin method. SubCircuit pins can be disconnected using \SubCircuit#disconnect_pin.
Subcircuit objects are created inside a circuit with \Circuit#create_subcircuit.
This class has been added in version 0.26.
__doc__
class
__doc__ = '@brief A subcircuit inside a circuit.\nCircuits may instantiate other circuits as subcircuits similar to cells in layouts. Such an instance is a subcircuit. A subcircuit refers to a circuit implementation (a \\Circuit object), and presents connections through pins. The pins of a subcircuit can be connected to nets. The subcircuit pins are identical to the outgoing pins of the circuit the subcircuit refers to.\n\nSubcircuits connect to nets through the \\SubCircuit#connect_pin method. SubCircuit pins can be disconnected using \\SubCircuit#disconnect_pin.\n\nSubcircuit objects are created inside a circuit with \\Circuit#create_subcircuit.\n\nThis class has been added in version 0.26.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 91
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
name
class
name: str = <attribute 'name' of 'SubCircuit' objects>
@brief Gets the name of the subcircuit.
@brief Sets the name of the subcircuit. SubCircuit names are used to name a subcircuits inside a netlist file. SubCircuit names should be unique within a circuit.
trans
class
trans: DCplxTrans = <attribute 'trans' of 'SubCircuit' objects>
@brief Gets the physical transformation for the subcircuit.
This property applies to subcircuits derived from a layout. It specifies the placement of the respective cell.
This property has been introduced in version 0.27.
@brief Sets the physical transformation for the subcircuit.
See \trans for details about this property.
This property has been introduced in version 0.27.
circuit
method descriptor
circuit() -> Circuit
circuit() -> Circuit
circuit()
@brief Gets the circuit the subcircuit lives in (non-const version). This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref.
This constness variant has been introduced in version 0.26.8
circuit_ref
method descriptor
circuit_ref() -> Circuit
circuit_ref() -> Circuit
circuit_ref()
@brief Gets the circuit referenced by the subcircuit (non-const version).
This constness variant has been introduced in version 0.26.8
connect_pin
method descriptor
connect_pin(pin: Pin, net: Net) -> None
connect_pin(pin_id: int, net: Net) -> None
connect_pin()
@brief Connects the given pin to the specified net. This version takes a \Pin reference instead of a pin ID.
disconnect_pin
method descriptor
disconnect_pin(pin: Pin) -> None
disconnect_pin(pin_id: int) -> None
disconnect_pin()
@brief Disconnects the given pin from any net. This version takes a \Pin reference instead of a pin ID.
expanded_name
method descriptor
expanded_name() -> str
@brief Gets the expanded name of the subcircuit. The expanded name takes the name of the subcircuit. If the name is empty, the numeric ID will be used to build a name.
id
method descriptor
id() -> int
@brief Gets the subcircuit ID. The ID is a unique integer which identifies the subcircuit. It can be used to retrieve the subcircuit from the circuit using \Circuit#subcircuit_by_id. When assigned, the subcircuit ID is not 0.
net_for_pin
method descriptor
net_for_pin(pin_id: int) -> Net
net_for_pin(pin_id: int) -> Net
net_for_pin()
@brief Gets the net connected to the specified pin of the subcircuit (non-const version). If the pin is not connected, nil is returned for the net.
This constness variant has been introduced in version 0.26.8
Technology
@brief Represents a technology
This class represents one technology from a set of technologies. The set of technologies available in the system can be obtained with \technology_names. Individual technology definitions are returned with \technology_by_name. Use \create_technology to register new technologies and \remove_technology to delete technologies.
Note that a Technology object needs to be registered in the system, before its name can be used to specify a technology, for example in \Layout#technology_name. Technology objects created by \create_technology are automatically registered. If you create a Technology object directly, you need to register it explicitly: @code tech = RBA::Technology::new tech.load("mytech.lyt") RBA::Technology::register_technology(tech) @/code
Note that in the latter example, an exception will be thrown if a technology with the same name already exists. Also note, that \Technology#register will register a copy of the object, so modifying it after registration will not have any effect.
The Technology class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief Represents a technology\n\nThis class represents one technology from a set of technologies. The set of technologies available in the system can be obtained with \\technology_names. Individual technology definitions are returned with \\technology_by_name. Use \\create_technology to register new technologies and \\remove_technology to delete technologies.\n\nNote that a Technology object needs to be registered in the system, before its name can be used to specify a technology, for example in \\Layout#technology_name. Technology objects created by \\create_technology are automatically registered. If you create a Technology object directly, you need to register it explicitly:\n@code\ntech = RBA::Technology::new\ntech.load("mytech.lyt")\nRBA::Technology::register_technology(tech)\n@/code\n\nNote that in the latter example, an exception will be thrown if a technology with the same name already exists. Also note, that \\Technology#register will register a copy of the object, so modifying it after registration will not have any effect.\n\nThe Technology class has been introduced in version 0.25.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 174
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Technology' objects>
list of weak references to the object
add_other_layers
class
add_other_layers: bool = <attribute 'add_other_layers' of 'Technology' objects>
@brief Gets the flag indicating whether to add other layers to the layer properties
@brief Sets the flag indicating whether to add other layers to the layer properties
dbu
class
dbu: float = <attribute 'dbu' of 'Technology' objects>
@brief Gets the default database unit
The default database unit is the one used when creating a layout for example.
@brief Sets the default database unit
default_base_path
class
default_base_path: str = <attribute 'default_base_path' of 'Technology' objects>
@brief Gets the default base path
See \base_path for details about the default base path.
@hide
default_grids
class
default_grids: List[float] = <attribute 'default_grids' of 'Technology' objects>
@brief Gets the default grids
See \default_grids for details.
This property has been introduced in version 0.28.17.
@brief Sets the default grids If not empty, this list replaces the global grid list for this technology. Note that this method will reset the default grid (see \default_grid). Use \set_default_grids to set the default grids and the strong default one.
This property has been introduced in version 0.28.17.
description
class
description: str = <attribute 'description' of 'Technology' objects>
@brief Gets the description
The technology description is shown to the user in technology selection dialogs and for display purposes.
@brief Sets the description
explicit_base_path
class
explicit_base_path: str = <attribute 'explicit_base_path' of 'Technology' objects>
@brief Gets the explicit base path
See \base_path for details about the explicit base path.
@brief Sets the explicit base path
See \base_path for details about the explicit base path.
group
class
group: str = <attribute 'group' of 'Technology' objects>
@brief Gets the technology group
The technology group is used to group certain technologies together in the technology selection menu. Technologies with the same group are put under a submenu with that group title.
The 'group' attribute has been introduced in version 0.26.2.
@brief Sets the technology group See \group for details about this attribute.
The 'group' attribute has been introduced in version 0.26.2.
layer_properties_file
class
layer_properties_file: str = <attribute 'layer_properties_file' of 'Technology' objects>
@brief Gets the path of the layer properties file
If empty, no layer properties file is associated with the technology. If non-empty, this path will be corrected by the base path (see \correct_path) and this layer properties file will be loaded for layouts with this technology.
@brief Sets the path of the layer properties file
See \layer_properties_file for details about this property.
load_layout_options
class
load_layout_options: LoadLayoutOptions = <attribute 'load_layout_options' of 'Technology' objects>
@brief Gets the layout reader options
This method returns the layout reader options that are used when reading layouts with this technology.
Change the reader options by modifying the object and using the setter to change it:
@code opt = tech.load_layout_options opt.dxf_dbu = 2.5 tech.load_layout_options = opt @/code
@brief Sets the layout reader options
See \load_layout_options for a description of this property.
name
class
name: str = <attribute 'name' of 'Technology' objects>
@brief Gets the name of the technology
@brief Sets the name of the technology
save_layout_options
class
save_layout_options: SaveLayoutOptions = <attribute 'save_layout_options' of 'Technology' objects>
@brief Gets the layout writer options
This method returns the layout writer options that are used when writing layouts with this technology.
Change the reader options by modifying the object and using the setter to change it:
@code opt = tech.save_layout_options opt.dbu = 0.01 tech.save_layout_options = opt @/code
@brief Sets the layout writer options
See \save_layout_options for a description of this property.
__copy__
method descriptor
__copy__() -> Technology
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Technology
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
base_path
method descriptor
base_path() -> str
@brief Gets the base path of the technology
The base path is the effective path where files are read from if their file path is a relative one. If the explicit path is set (see \explicit_base_path=), it is used. If not, the default path is used. The default path is the one from which a technology file was imported. The explicit one is the one that is specified explicitly with \explicit_base_path=.
clear_technologies
builtin
clear_technologies() -> None
@brief Clears all technologies
This method has been introduced in version 0.26.
component
method descriptor
component() -> TechnologyComponent
@brief Gets the technology component with the given name The names are unique system identifiers. For all names, use \component_names.
component_names
method descriptor
component_names() -> List[str]
@brief Gets the names of all components available for \component
correct_path
method descriptor
correct_path() -> str
@brief Makes a file path relative to the base path if one is specified
This method turns an absolute path into one relative to the base path. Only files below the base path will be made relative. Files above or beside won't be made relative.
See \base_path for details about the default base path.
create
method descriptor
create() -> None
@brief 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.
create_technology
builtin
create_technology() -> Technology
@brief Creates a new (empty) technology with the given name
The new technology is already registered in the system.
This method returns a reference to the new technology.
default_grid
method descriptor
default_grid() -> float
@brief Gets the default grid
The default grid is a specific one from the default grid list. It indicates the one that is taken if the current grid is not matching one of the default grids.
To set the default grid, use \set_default_grids.
This property has been introduced in version 0.29.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Technology
@brief Creates a copy of self
eff_layer_properties_file
method descriptor
eff_layer_properties_file() -> str
@brief Gets the effective path of the layer properties file
eff_path
method descriptor
eff_path() -> str
@brief Makes a file path relative to the base path if one is specified
This method will return the actual path for a file from the file's path. If the input path is a relative one, it will be made absolute by using the base path.
See \base_path for details about the default base path.
has_technology
builtin
has_technology() -> bool
@brief Returns a value indicating whether there is a technology with this name
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
load
method descriptor
load() -> None
@brief Loads the technology definition from a file
new
builtin
new() -> Technology
@brief Creates a new object of this class
register_technology
builtin
register_technology() -> Technology
@brief Registers a technology in the system
Only after a technology is registered, it can be used in the system, e.g. by specifying its name in \Layout#technology_name. While \create_technology already registers the technology, this method allows registering a Technology object that has created in other ways.
This method returns a reference to the new technology object, which is a copy of the argument. \remove_technology can be used to remove a technology registered by this method.
This method has been introduced in version 0.28.14.
remove_technology
builtin
remove_technology() -> None
@brief Removes the technology with the given name from the system
save
method descriptor
save() -> None
@brief Saves the technology definition to a file
set_default_grids
method descriptor
set_default_grids() -> None
@brief Sets the default grids and the strong default one See \default_grids and \default_grid for a description of this property. Note that the default grid has to be a member of the 'grids' array to become active.
This method has been introduced in version 0.29.
technologies_from_xml
builtin
technologies_from_xml() -> None
@brief Loads the technologies from a XML representation
See \technologies_to_xml for details.
technologies_to_xml
builtin
technologies_to_xml() -> str
@brief Returns a XML representation of all technologies registered in the system
\technologies_from_xml can be used to restore the technology definitions. This method is provided mainly as a substitute for the pre-0.25 way of accessing technology data through the 'technology-data' configuration parameter. This method will return the equivalent string.
technology_by_name
builtin
technology_by_name() -> Technology
@brief Gets the technology object for a given name
technology_from_xml
builtin
technology_from_xml() -> Technology
@brief Loads the technology from a XML representation
See \technology_to_xml for details. Note that this function will create a new Technology object which is not registered in the system. See \Technology#register for details.
technology_names
builtin
technology_names() -> List[str]
@brief Gets a list of technology names defined in the system
to_xml
method descriptor
to_xml() -> str
@brief Returns a XML representation of this technolog
\technology_from_xml can be used to restore the technology definition.
TechnologyComponent
@brief A part of a technology definition Technology components extend technology definitions (class \Technology) by specialized subfeature definitions. For example, the net tracer supplies its technology-dependent specification through a technology component called \NetTracerTechnology.
Components are managed within technologies and can be accessed from a technology using \Technology#component.
This class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief A part of a technology definition\nTechnology components extend technology definitions (class \\Technology) by specialized subfeature definitions. For example, the net tracer supplies its technology-dependent specification through a technology component called \\NetTracerTechnology.\n\nComponents are managed within technologies and can be accessed from a technology using \\Technology#component.\n\nThis class has been introduced in version 0.25.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 173
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TechnologyComponent' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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.
description
method descriptor
description() -> str
@brief Gets the human-readable description string of the technology component
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
name
method descriptor
name() -> str
@brief Gets the formal name of the technology component This is the name by which the component can be obtained from a technology using \Technology#component.
new
builtin
new() -> TechnologyComponent
@brief Creates a new object of this class
Text
@brief A text object
A text object has a point (location), a text, a text transformation, a text size and a font id. Text size and font id are provided to be be able to render the text correctly. Text objects are used as labels (i.e. for pins) or to indicate a particular position.
The \Text class uses integer coordinates. A class that operates with floating-point coordinates is \DText.
See @The Database API@ for more details about the database objects.
HAlignCenter
class
HAlignCenter: HAlign = HAlignCenter (1)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignLeft
class
HAlignLeft: HAlign = HAlignLeft (0)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
HAlignRight
class
HAlignRight: HAlign = HAlignRight (2)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
NoHAlign
class
NoHAlign: HAlign = NoHAlign (-1)
@brief This class represents the horizontal alignment modes. This enum has been introduced in version 0.28.
NoVAlign
class
NoVAlign: VAlign = NoVAlign (-1)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignBottom
class
VAlignBottom: VAlign = VAlignBottom (2)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignCenter
class
VAlignCenter: VAlign = VAlignCenter (1)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignTop
class
VAlignTop: VAlign = VAlignTop (0)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief A text object\n\nA text object has a point (location), a text, a text transformation,\na text size and a font id. Text size and font id are provided to be\nbe able to render the text correctly.\nText objects are used as labels (i.e. for pins) or to indicate a particular position.\n\nThe \\Text class uses integer coordinates. A class that operates with floating-point coordinates is \\DText.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 175
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Text' objects>
list of weak references to the object
font
class
font: int = <attribute 'font' of 'Text' objects>
@brief Gets the font number See \font= for a description of this property.
@brief Sets the font number The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects.
halign
class
halign: HAlign = <attribute 'halign' of 'Text' objects>
@brief Gets the horizontal alignment
See \halign= for a description of this property.
@brief Sets the horizontal alignment
This is the version accepting integer values. It's provided for backward compatibility.
@brief Sets the horizontal alignment
This property specifies how the text is aligned relative to the anchor point. This property has been introduced in version 0.22 and extended to enums in 0.28.
size
class
size: int = <attribute 'size' of 'Text' objects>
@brief Gets the text height
@brief Sets the text height of this object
string
class
string: str = <attribute 'string' of 'Text' objects>
@brief Get the text string
@brief Assign a text string to this object
trans
class
trans: Trans = <attribute 'trans' of 'Text' objects>
@brief Gets the transformation
@brief Assign a transformation (text position and orientation) to this object
valign
class
valign: VAlign = <attribute 'valign' of 'Text' objects>
@brief Gets the vertical alignment
See \valign= for a description of this property.
@brief Sets the vertical alignment
This is the version accepting integer values. It's provided for backward compatibility.
@brief Sets the vertical alignment
This property specifies how the text is aligned relative to the anchor point. This property has been introduced in version 0.22 and extended to enums in 0.28.
x
class
x: int = <attribute 'x' of 'Text' objects>
@brief Gets the x location of the text
This method has been introduced in version 0.23.
@brief Sets the x location of the text
This method has been introduced in version 0.23.
y
class
y: int = <attribute 'y' of 'Text' objects>
@brief Gets the y location of the text
This method has been introduced in version 0.23.
@brief Sets the y location of the text
This method has been introduced in version 0.23.
__copy__
method descriptor
__copy__() -> Text
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Text
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality
Return true, if this text object and the given text are equal
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given text object. This method enables texts as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(dtext: DText) -> None
__init__(string: str, trans: Trans) -> None
__init__(string: str, trans: Trans, height: int, font: int) -> None
__init__(string: str, x: int, y: int) -> None
__init__()
@brief Constructor with string, transformation, text height and font
A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified.
__lt__
method descriptor
__lt__() -> bool
@brief Less operator @param t The object to compare against This operator is provided to establish some, not necessarily a certain sorting order
__ne__
method descriptor
__ne__() -> bool
@brief Inequality
Return true, if this text object and the given text are not equal
__repr__
method descriptor
__repr__() -> str
@brief Converts the object to a string. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__str__
method descriptor
__str__() -> str
@brief Converts the object to a string. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Gets the bounding box of the text The bounding box of the text is a single point - the location of the text. Both points of the box are identical.
This method has been added in version 0.28.
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Text
@brief Creates a copy of self
from_s
builtin
from_s() -> Text
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given text object. This method enables texts as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
move
method descriptor
move(distance: Vector) -> Text
move(dx: int, dy: int) -> Text
move()
@brief Moves the text by a certain distance (modifies self)
Moves the text by a given distance in x and y direction and returns the moved text. Does not check for coordinate overflows.
@param dx The x distance to move the text. @param dy The y distance to move the text.
@return A reference to this text object
This method was introduced in version 0.23.
moved
method descriptor
moved(distance: Vector) -> Text
moved(dx: int, dy: int) -> Text
moved()
@brief Returns the text moved by a certain distance (does not modify self)
Moves the text by a given offset and returns the moved text. Does not modify *this. Does not check for coordinate overflows.
@param dx The x distance to move the text. @param dy The y distance to move the text.
@return The moved text.
This method was introduced in version 0.23.
new
builtin
new() -> Text
new(dtext: DText) -> Text
new(string: str, trans: Trans) -> Text
new(string: str, trans: Trans, height: int, font: int) -> Text
new(string: str, x: int, y: int) -> Text
new()
@brief Constructor with string, transformation, text height and font
A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified.
position
method descriptor
position() -> Point
@brief Gets the position of the text
This convenience method has been added in version 0.28.
to_dtype
method descriptor
to_dtype() -> DText
@brief Converts the text to a floating-point coordinate text The database unit can be specified to translate the integer-coordinate text into a floating-point coordinate text in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief Converts the object to a string. If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
transformed
method descriptor
transformed(t: CplxTrans) -> DText
transformed(t: ICplxTrans) -> Text
transformed(t: Trans) -> Text
transformed()
@brief Transforms the text with the given complex transformation
@param t The magnifying transformation to apply @return The transformed text (a DText now)
TextFilter
@brief A generic text filter adaptor
Text filters are an efficient way to filter texts from a Texts collection. To apply a filter, derive your own filter class and pass an instance to \Texts#filter or \Texts#filtered method.
Conceptually, these methods take each text from the collection and present it to the filter's 'selected' method. Based on the result of this evaluation, the text is kept or discarded.
The magic happens when deep mode text collections are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using the filter.
You can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that filters texts with a given string length: @code class TextStringLengthFilter < RBA::TextFilter
# Constructor def initialize(string_length) self.is_isotropic_and_scale_invariant # orientation and scale do not matter @string_length = string_length end
# Select texts with given string length def selected(text) return text.string.size == @string_length end
end
texts = ... # some Texts object with_length_3 = edges.filtered(TextStringLengthFilter::new(3)) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic text filter adaptor\n\nText filters are an efficient way to filter texts from a Texts collection. To apply a filter, derive your own filter class and pass an instance to \\Texts#filter or \\Texts#filtered method.\n\nConceptually, these methods take each text from the collection and present it to the filter's 'selected' method.\nBased on the result of this evaluation, the text is kept or discarded.\n\nThe magic happens when deep mode text collections are involved. In that case, the filter will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the filter behaves. You need to configure the filter by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using the filter.\n\nYou can skip this step, but the filter algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that filters texts with a given string length:\n@code\nclass TextStringLengthFilter < RBA::TextFilter\n\n # Constructor\n def initialize(string_length)\n self.is_isotropic_and_scale_invariant # orientation and scale do not matter\n @string_length = string_length\n end\n \n # Select texts with given string length\n def selected(text)\n return text.string.size == @string_length\n end\n\nend\n\ntexts = ... # some Texts object\nwith_length_3 = edges.filtered(TextStringLengthFilter::new(3))\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 179
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TextFilter' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'TextFilter' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) filters are area or perimeter filters. The area or perimeter of a polygon depends on the scale, but not on the orientation of the polygon.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) filter is the square selector. Whether a polygon is a square or not does not depend on the polygon's orientation nor scale.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) filter is the bounding box aspect ratio (height/width) filter. The definition of heigh and width depends on the orientation, but the ratio is independent on scale.
new
builtin
new() -> TextFilter
@brief Creates a new object of this class
TextGenerator
@brief A text generator class
A text generator is basically a way to produce human-readable text for labelling layouts. It's similar to the Basic.TEXT PCell, but more convenient to use in a scripting context.
Generators can be constructed from font files (or resources) or one of the registered generators can be used.
To create a generator from a font file proceed this way: @code gen = RBA::TextGenerator::new gen.load_from_file("myfont.gds") region = gen.text("A TEXT", 0.001) @/code
This code produces a RBA::Region with a database unit of 0.001 micron. This region can be fed into a \Shapes container to place it into a cell for example.
By convention the font files must have two to three layers:
@ul @li 1/0 for the actual data @/li @li 2/0 for the borders @/li @li 3/0 for an optional additional background @/li @/ul
Currently, all glyphs must be bottom-left aligned at 0, 0. The border must be drawn in at least one glyph cell. The border is taken as the overall bbox of all borders.
The glyph cells must be named with a single character or "nnn" where "d" is the ASCII code of the character (i.e. "032" for space). Allowed ASCII codes are 32 through 127. If a lower-case "a" character is defined, lower-case letters are supported. Otherwise, lowercase letters are mapped to uppercase letters.
Undefined characters are left blank in the output.
A comment cell can be defined ("COMMENT") which must hold one text in layer 1 stating the comment, and additional descriptions such as line width:
@ul
@li "line_width=
Generators can be picked form a list of predefined generator. See \generators, \default_generator and \generator_by_name for picking a generator from the list.
This class has been introduced in version 0.25.
__doc__
class
__doc__ = '@brief A text generator class\n\nA text generator is basically a way to produce human-readable text for labelling layouts. It\'s similar to the Basic.TEXT PCell, but more convenient to use in a scripting context.\n\nGenerators can be constructed from font files (or resources) or one of the registered generators can be used.\n\nTo create a generator from a font file proceed this way:\n@code\ngen = RBA::TextGenerator::new\ngen.load_from_file("myfont.gds")\nregion = gen.text("A TEXT", 0.001)\n@/code\n\nThis code produces a RBA::Region with a database unit of 0.001 micron. This region can be fed into a \\Shapes container to place it into a cell for example.\n\nBy convention the font files must have two to three layers:\n\n@ul\n@li 1/0 for the actual data @/li\n@li 2/0 for the borders @/li\n@li 3/0 for an optional additional background @/li\n@/ul\n\nCurrently, all glyphs must be bottom-left aligned at 0, 0. The\nborder must be drawn in at least one glyph cell. The border is taken\nas the overall bbox of all borders.\n\nThe glyph cells must be named with a single character or "nnn" where "d" is the\nASCII code of the character (i.e. "032" for space). Allowed ASCII codes are 32 through 127.\nIf a lower-case "a" character is defined, lower-case letters are supported.\nOtherwise, lowercase letters are mapped to uppercase letters.\n\nUndefined characters are left blank in the output.\n\nA comment cell can be defined ("COMMENT") which must hold one text in layer 1\nstating the comment, and additional descriptions such as line width:\n\n@ul\n@li "line_width=<x>": Specifies the intended line width in micron units @/li\n@li "design_grid=<x>": Specifies the intended design grid in micron units @/li\n@li any other text: The description string @/li\n@/ul\n\nGenerators can be picked form a list of predefined generator. See \\generators, \\default_generator and \\generator_by_name for picking a generator from the list.\n\nThis class has been introduced in version 0.25.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 57
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TextGenerator' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> TextGenerator
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> TextGenerator
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
background
method descriptor
background() -> Box
@brief Gets the background rectangle of each glyph in the generator's database units The background rectangle is the one that is used as background for inverted rendering. A version that delivers this value in micrometer units is \dbackground.
create
method descriptor
create() -> None
@brief 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.
dbackground
method descriptor
dbackground() -> DBox
@brief Gets the background rectangle in micron units The background rectangle is the one that is used as background for inverted rendering.
dbu
method descriptor
dbu() -> float
@brief Gets the basic database unit the design of the glyphs was made This database unit the basic resolution of the glyphs.
ddesign_grid
method descriptor
ddesign_grid() -> float
@brief Gets the design grid of the glyphs in micron units The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit.
default_generator
builtin
default_generator() -> TextGenerator
@brief Gets the default text generator (a standard font) This method delivers the default generator or nil if no such generator is installed.
description
method descriptor
description() -> str
@brief Gets the description text of the generator The generator's description text is a human-readable text that is used to identify the generator (aka 'font') in user interfaces.
design_grid
method descriptor
design_grid() -> int
@brief Gets the design grid of the glyphs in the generator's database units The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. A version that delivers this value in micrometer units is \ddesign_grid.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dheight
method descriptor
dheight() -> float
@brief Gets the design height of the glyphs in micron units The height is the height of the rectangle occupied by each character.
dline_width
method descriptor
dline_width() -> float
@brief Gets the line width of the glyphs in micron units The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I').
dup
method descriptor
dup() -> TextGenerator
@brief Creates a copy of self
dwidth
method descriptor
dwidth() -> float
@brief Gets the design width of the glyphs in micron units The width is the width of the rectangle occupied by each character.
font_paths
builtin
font_paths() -> List[str]
@brief Gets the paths where to look for font files See \set_font_paths for a description of this function.
This method has been introduced in version 0.27.4.
generator_by_name
builtin
generator_by_name() -> TextGenerator
@brief Gets the text generator for a given name This method delivers the generator with the given name or nil if no such generator is registered.
generators
builtin
generators() -> List[TextGenerator]
@brief Gets the generators registered in the system This method delivers a list of generator objects that can be used to create texts.
glyph
method descriptor
glyph() -> Region
@brief Gets the glyph of the given character as a region The region represents the glyph's outline and is delivered in the generator's database units .A more elaborate way to getting the text's outline is \text.
height
method descriptor
height() -> int
@brief Gets the design height of the glyphs in the generator's database units The height is the height of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dheight.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
line_width
method descriptor
line_width() -> int
@brief Gets the line width of the glyphs in the generator's database units The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). A version that delivers this value in micrometer units is \dline_width.
load_from_file
method descriptor
load_from_file() -> None
@brief Loads the given file into the generator See the description of the class how the layout data is read.
load_from_resource
method descriptor
load_from_resource() -> None
@brief Loads the given resource data (as layout data) into the generator The resource path has to start with a colon, i.e. ':/my/resource.gds'. See the description of the class how the layout data is read.
name
method descriptor
name() -> str
@brief Gets the name of the generator The generator's name is the basic key by which the generator is identified.
new
builtin
new() -> TextGenerator
@brief Creates a new object of this class
set_font_paths
builtin
set_font_paths() -> None
@brief Sets the paths where to look for font files This function sets the paths where to look for font files. After setting such a path, each font found will render a specific generator. The generator can be found under the font file's name. As the text generator is also the basis for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell.
This method has been introduced in version 0.27.4.
text
method descriptor
text() -> Region
@brief Gets the rendered text as a region @param text The text string @param target_dbu The database unit for which to produce the text @param mag The magnification (1.0 for original size) @param inv inverted rendering: if true, the glyphs are rendered inverse with the background box as the outer bounding box @param bias An additional bias to be applied (happens before inversion, can be negative) @param char_spacing Additional space between characters (in micron units) @param line_spacing Additional space between lines (in micron units) Various options can be specified to control the appearance of the text. See the description of the parameters. It's important to specify the target database unit in \target_dbu to indicate what database unit shall be used to create the output for.
width
method descriptor
width() -> int
@brief Gets the design height of the glyphs in the generator's database units The width is the width of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dwidth.
TextOperator
@brief A generic text operator
Text processors are an efficient way to process texts from an text collection. To apply a processor, derive your own operator class and pass an instance to the \Texts#processed or \Texts#process method.
Conceptually, these methods take each text from the edge pair collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output texts derived from the input text. The output text collection is the sum over all these individual results.
The magic happens when deep mode text collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
Here is some example that replaces the text string: @code class ReplaceTextString < RBA::TextOperator
# Constructor def initialize self.is_isotropic_and_scale_invariant # orientation and scale do not matter end
# Replaces the string by a number representing the string length def process(text) new_text = text.dup # need a copy as we cannot modify the text passed new_text.string = text.string.size.to_s return [ new_text ] end
end
texts = ... # some Texts object modified = texts.processed(ReplaceTextString::new) @/code
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic text operator\n\nText processors are an efficient way to process texts from an text collection. To apply a processor, derive your own operator class and pass an instance to the \\Texts#processed or \\Texts#process method.\n\nConceptually, these methods take each text from the edge pair collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output texts derived from the input text.\nThe output text collection is the sum over all these individual results.\n\nThe magic happens when deep mode text collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nHere is some example that replaces the text string:\n@code\nclass ReplaceTextString < RBA::TextOperator\n\n # Constructor\n def initialize\n self.is_isotropic_and_scale_invariant # orientation and scale do not matter\n end\n \n # Replaces the string by a number representing the string length\n def process(text)\n new_text = text.dup # need a copy as we cannot modify the text passed\n new_text.string = text.string.size.to_s\n return [ new_text ]\n end\n\nend\n\ntexts = ... # some Texts object\nmodified = texts.processed(ReplaceTextString::new)\n@/code\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 180
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TextOperator' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'TextOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> TextOperator
@brief Creates a new object of this class
TextToPolygonOperator
@brief A generic text-to-polygon operator
Text processors are an efficient way to process texts from an text collection. To apply a processor, derive your own operator class and pass an instance to the \Texts#processed method.
Conceptually, these methods take each text from the text collection and present it to the operator's 'process' method. The result of this call is a list of zero to many output polygons derived from the input text. The output region is the sum over all these individual results.
The magic happens when deep mode text collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \is_isotropic, \is_scale_invariant or \is_isotropic_and_scale_invariant before using it.
You can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.
For a basic example see the \TextOperator class, with the exception that this incarnation delivers polygons.
This class has been introduced in version 0.29.
__doc__
class
__doc__ = "@brief A generic text-to-polygon operator\n\nText processors are an efficient way to process texts from an text collection. To apply a processor, derive your own operator class and pass an instance to the \\Texts#processed method.\n\nConceptually, these methods take each text from the text collection and present it to the operator's 'process' method.\nThe result of this call is a list of zero to many output polygons derived from the input text.\nThe output region is the sum over all these individual results.\n\nThe magic happens when deep mode text collections are involved. In that case, the processor will use as few calls as possible and exploit the hierarchical compression if possible. It needs to know however, how the operator behaves. You need to configure the operator by calling \\is_isotropic, \\is_scale_invariant or \\is_isotropic_and_scale_invariant before using it.\n\nYou can skip this step, but the processor algorithm will assume the worst case then. This usually leads to cell variant formation which is not always desired and blows up the hierarchy.\n\nFor a basic example see the \\TextOperator class, with the exception that this incarnation delivers polygons.\n\nThis class has been introduced in version 0.29.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 181
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TextToPolygonOperator' objects>
list of weak references to the object
wants_variants
class
wants_variants: bool = <attribute 'wants_variants' of 'TextToPolygonOperator' objects>
@brief Gets a value indicating whether the filter prefers cell variants See \wants_variants= for details.
@brief Sets a value indicating whether the filter prefers cell variants This flag must be set before using this filter for hierarchical applications (deep mode). It tells the filter implementation whether cell variants should be created (true, the default) or shape propagation will be applied (false).
This decision needs to be made, if the filter indicates that it will deliver different results for scaled or rotated versions of the shape (see \is_isotropic and the other hints). If a cell is present with different qualities - as seen from the top cell - the respective instances need to be differentiated. Cell variant formation is one way, shape propagation the other way. Typically, cell variant formation is less expensive, but the hierarchy will be modified.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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
method descriptor
is_const_object() -> bool
@brief 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.
is_isotropic
method descriptor
is_isotropic() -> None
@brief Indicates that the filter has isotropic properties Call this method before using the filter to indicate that the selection is independent of the orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
Examples for isotropic (polygon) processors are size or shrink operators. Size or shrink is not dependent on orientation unless size or shrink needs to be different in x and y direction.
is_isotropic_and_scale_invariant
method descriptor
is_isotropic_and_scale_invariant() -> None
@brief Indicates that the filter is isotropic and scale invariant Call this method before using the filter to indicate that the selection is independent of the scale and orientation of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for such a (polygon) processor is the convex decomposition operator. The decomposition of a polygon into convex parts is an operation that is not depending on scale nor orientation.
is_scale_invariant
method descriptor
is_scale_invariant() -> None
@brief Indicates that the filter is scale invariant Call this method before using the filter to indicate that the selection is independent of the scale of the shape. This helps the filter algorithm optimizing the filter run, specifically in hierarchical mode.
An example for a scale invariant (polygon) processor is the rotation operator. Rotation is not depending on scale, but on the original orientation as mirrored versions need to be rotated differently.
new
builtin
new() -> TextToPolygonOperator
@brief Creates a new object of this class
Texts
Bases: klayout.dbcore.ShapeCollection
@brief Texts (a collection of texts)
Text objects are useful as labels for net names, to identify certain regions and to specify specific locations in general. Text collections provide a way to store - also in a hierarchical fashion - and manipulate a collection of text objects.
Text objects can be turned into polygons by creating small boxes around the texts (\polygons). Texts can also be turned into dot-like edges (\edges). Texts can be filtered by string, either by matching against a fixed string (\with_text) or a glob-style pattern (\with_match).
Text collections can be filtered geometrically against a polygon \Region using \interacting or \non-interacting. Vice versa, texts can be used to select polygons from a \Region using \pull_interacting.
Beside that, text collections can be transformed, flattened and combined, similar to \EdgePairs.
This class has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief Texts (a collection of texts)\n\nText objects are useful as labels for net names, to identify certain regions and to specify specific locations in general. Text collections provide a way to store - also in a hierarchical fashion - and manipulate a collection of text objects.\n\nText objects can be turned into polygons by creating small boxes around the texts (\\polygons). Texts can also be turned into dot-like edges (\\edges). Texts can be filtered by string, either by matching against a fixed string (\\with_text) or a glob-style pattern (\\with_match).\n\nText collections can be filtered geometrically against a polygon \\Region using \\interacting or \\non-interacting. Vice versa, texts can be used to select polygons from a \\Region using \\pull_interacting.\n\nBeside that, text collections can be transformed, flattened and combined, similar to \\EdgePairs.\n\nThis class has been introduced in version 0.27.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 182
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__add__
method descriptor
__add__() -> Texts
@brief Returns the combined text collection of self and the other one
@return The resulting text collection
This operator adds the texts of the other collection to self and returns a new combined set.
The 'join' alias has been introduced in version 0.28.12.
__and__
method descriptor
__and__() -> Texts
@brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region
@return A new text collection containing the texts inside or on the edge of polygons from the region
__copy__
method descriptor
__copy__() -> Texts
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Texts
@brief Creates a copy of self
__getitem__
method descriptor
__getitem__() -> Text
@brief Returns the nth text
This method returns nil if the index is out of range. It is available for flat texts only - i.e. those for which \has_valid_texts? is true. Use \flatten to explicitly flatten an text collection.
The \each iterator is the more general approach to access the texts.
__iadd__
method descriptor
__iadd__() -> Texts
@brief Adds the texts of the other text collection to self
@return The text collection after modification (self)
This operator adds the texts of the other collection to self.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
__init__
method descriptor
__init__() -> None
__init__(array: Sequence[Text]) -> None
__init__(shape_iterator: RecursiveShapeIterator) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> None
__init__(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> None
__init__(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None
__init__(shapes: Shapes) -> None
__init__(text: Text) -> None
__init__()
@brief Creates a hierarchical text collection from an original layer with a transformation
This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. This version will create a hierarchical text collection which supports hierarchical operations. The transformation is useful to scale to a specific database unit for example.
@code dss = RBA::DeepShapeStore::new 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::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) @/code
__iter__
method descriptor
__iter__() -> Iterator[Text]
@brief Returns each text of the text collection
__len__
method descriptor
__len__() -> int
@brief Returns the (flat) number of texts in the text collection
The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
__repr__
method descriptor
__repr__() -> str
@brief Converts the text collection to a string The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter.
__str__
method descriptor
__str__() -> str
@brief Converts the text collection to a string The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter.
__sub__
method descriptor
__sub__() -> Texts
@brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region
@return A new text collection containing the texts not inside or on the edge of polygons from the region
assign
method descriptor
assign() -> None
@brief Assigns another object to self
bbox
method descriptor
bbox() -> Box
@brief Return the bounding box of the text collection The bounding box is the box enclosing all origins of all texts.
clear
method descriptor
clear() -> None
@brief Clears the text collection
count
method descriptor
count() -> int
@brief Returns the (flat) number of texts in the text collection
The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
data_id
method descriptor
data_id() -> int
@brief Returns the data ID (a unique identifier for the underlying data storage)
disable_progress
method descriptor
disable_progress() -> None
@brief Disable progress reporting Calling this method will disable progress reporting. See \enable_progress.
dup
method descriptor
dup() -> Texts
@brief Creates a copy of self
each
method descriptor
each() -> Iterator[Text]
@brief Returns each text of the text collection
edges
method descriptor
edges() -> Edges
@brief Returns dot-like edges for the texts @return An edge collection containing the individual, dot-like edges
enable_progress
method descriptor
enable_progress() -> None
@brief Enable progress reporting After calling this method, the text 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.
enable_properties
method descriptor
enable_properties() -> None
@brief Enables properties for the given container. This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key.
This method has been introduced in version 0.28.4.
extents
method descriptor
extents(d: Optional[int] = ...) -> Region
extents(dx: int, dy: int) -> Region
extents()
@brief Returns a region with the enlarged bounding boxes of the texts This method acts like the other version of \extents, but allows giving different enlargements for x and y direction.
filter
method descriptor
filter() -> None
@brief Applies a generic filter in place (replacing the texts from the Texts collection) See \TextFilter for a description of this feature.
This method has been introduced in version 0.29.
filter_properties
method descriptor
filter_properties() -> None
@brief Filters properties by certain keys. Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
filtered
method descriptor
filtered() -> Texts
@brief Applies a generic filter and returns a filtered copy See \TextFilter for a description of this feature.
This method has been introduced in version 0.29.
flatten
method descriptor
flatten() -> None
@brief Explicitly flattens an text collection
If the collection is already flat (i.e. \has_valid_texts? returns true), this method will not change the collection.
has_valid_texts
method descriptor
has_valid_texts() -> bool
@brief Returns true if the text collection is flat and individual texts can be accessed randomly
hier_count
method descriptor
hier_count() -> int
@brief Returns the (hierarchical) number of texts in the text collection
The count is computed 'hierarchical', i.e. texts inside a cell are counted once even if the cell is instantiated multiple times.
This method has been introduced in version 0.27.
insert
method descriptor
insert(text: Text) -> None
insert(texts: Texts) -> None
insert()
@brief Inserts all texts from the other text collection into this collection
insert_into
method descriptor
insert_into() -> None
@brief Inserts this texts into the given layout, below the given cell and into the given layer. If the text collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused.
insert_into_as_polygons
method descriptor
insert_into_as_polygons() -> None
@brief Inserts this texts into the given layout, below the given cell and into the given layer. If the text collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused.
The texts will be converted to polygons with the enlargement value given be 'e'. See \polygon or \extents for details.
interacting
method descriptor
interacting() -> Texts
@brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region
@return A new text collection containing the texts inside or on the edge of polygons from the region
is_deep
method descriptor
is_deep() -> bool
@brief Returns true if the edge pair collection is a deep (hierarchical) one
is_empty
method descriptor
is_empty() -> bool
@brief Returns true if the collection is empty
join
method descriptor
join() -> Texts
@brief Returns the combined text collection of self and the other one
@return The resulting text collection
This operator adds the texts of the other collection to self and returns a new combined set.
The 'join' alias has been introduced in version 0.28.12.
join_with
method descriptor
join_with() -> Texts
@brief Adds the texts of the other text collection to self
@return The text collection after modification (self)
This operator adds the texts of the other collection to self.
Note that in Ruby, the '+=' operator actually does not exist, but is emulated by '+' followed by an assignment. This is less efficient than the in-place operation, so it is recommended to use 'join_with' instead.
The 'join_with' alias has been introduced in version 0.28.12.
map_properties
method descriptor
map_properties() -> None
@brief Maps properties by name key. Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. As a side effect, this method enables properties on original layers.
This method has been introduced in version 0.28.4.
move
method descriptor
move(p: Vector) -> Texts
move(x: int, y: int) -> Texts
move()
@brief Moves the text collection
Moves the edge pairs by the given offset and returns the moved texts. The edge pair collection is overwritten.
@param x The x distance to move the texts. @param y The y distance to move the texts.
@return The moved texts (self).
moved
method descriptor
moved(p: Vector) -> Texts
moved(x: int, y: int) -> Texts
moved()
@brief Returns the moved edge pair collection (does not modify self)
Moves the texts by the given offset and returns the moved texts. The text collection is not modified.
@param x The x distance to move the texts. @param y The y distance to move the texts.
@return The moved texts.
new
builtin
new() -> Texts
new(array: Sequence[Text]) -> Texts
new(shape_iterator: RecursiveShapeIterator) -> Texts
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> Texts
new(shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> Texts
new(shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Texts
new(shapes: Shapes) -> Texts
new(text: Text) -> Texts
new()
@brief Creates a hierarchical text collection from an original layer with a transformation
This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. This version will create a hierarchical text collection which supports hierarchical operations. The transformation is useful to scale to a specific database unit for example.
@code dss = RBA::DeepShapeStore::new 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::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) @/code
not_interacting
method descriptor
not_interacting() -> Texts
@brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region
@return A new text collection containing the texts not inside or on the edge of polygons from the region
polygons
method descriptor
polygons() -> Region
@brief Converts the edge pairs to polygons This method creates polygons from the texts. This is equivalent to calling \extents.
process
method descriptor
process() -> None
@brief Applies a generic text processor in place (replacing the texts from the text collection) See \TextProcessor for a description of this feature.
This method has been introduced in version 0.29.
processed
method descriptor
processed(processed: TextOperator) -> Texts
processed(processed: TextToPolygonOperator) -> Region
processed()
@brief Applies a generic text-to-polygon processor and returns a region with the results See \TextToPolygonProcessor for a description of this feature.
This method has been introduced in version 0.29.
pull_interacting
method descriptor
pull_interacting() -> Region
@brief Returns all polygons of "other" which are including texts of this text set The "pull_..." method is similar to "select_..." but works the opposite way: it selects shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." method provide a way for re-hierarchization.
@return The region after the polygons have been selected (from other)
Merged semantics applies for the polygon region.
remove_properties
method descriptor
remove_properties() -> None
@brief Removes properties for the given container. This will remove all properties on the given container.
This method has been introduced in version 0.28.4.
select_interacting
method descriptor
select_interacting() -> Texts
@brief Selects the texts from this text collection which are inside or on the edge of polygons from the given region
@return A text collection after the texts have been selected (self)
In contrast to \interacting, this method will modify self.
select_not_interacting
method descriptor
select_not_interacting() -> Texts
@brief Selects the texts from this text collection which are not inside or on the edge of polygons from the given region
@return A text collection after the texts have been selected (self)
In contrast to \interacting, this method will modify self.
size
method descriptor
size() -> int
@brief Returns the (flat) number of texts in the text collection
The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated.
Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias.
swap
method descriptor
swap() -> None
@brief Swap the contents of this collection with the contents of another collection 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
method descriptor
to_s() -> str
to_s(max_count: int) -> str
to_s()
@brief Converts the text collection to a string This version allows specification of the maximum number of texts contained in the string.
transform
method descriptor
transform(t: ICplxTrans) -> Texts
transform(t: Trans) -> Texts
transform()
@brief Transform the text collection with a complex transformation (modifies self)
Transforms the text collection with the given transformation. This version modifies the text collection and returns a reference to self.
@param t The transformation to apply.
@return The transformed text collection.
transform_icplx
method descriptor
transform_icplx() -> Texts
@brief Transform the text collection with a complex transformation (modifies self)
Transforms the text collection with the given transformation. This version modifies the text collection and returns a reference to self.
@param t The transformation to apply.
@return The transformed text collection.
transformed
method descriptor
transformed(t: ICplxTrans) -> Texts
transformed(t: Trans) -> Texts
transformed()
@brief Transform the text collection with a complex transformation
Transforms the text with the given complex transformation. Does not modify the text collection but returns the transformed texts.
@param t The transformation to apply.
@return The transformed texts.
transformed_icplx
method descriptor
transformed_icplx() -> Texts
@brief Transform the text collection with a complex transformation
Transforms the text with the given complex transformation. Does not modify the text collection but returns the transformed texts.
@param t The transformation to apply.
@return The transformed texts.
with_match
method descriptor
with_match() -> Texts
@brief Filter the text by glob pattern "pattern" is a glob-style pattern (e.g. "A*" will select all texts starting with a capital "A"). If "inverse" is false, this method returns the texts matching the pattern. If "inverse" is true, this method returns the texts not matching the pattern.
with_text
method descriptor
with_text() -> Texts
@brief Filter the text by text string If "inverse" is false, this method returns the texts with the given string. If "inverse" is true, this method returns the texts not having the given string.
write
method descriptor
write() -> None
@brief Writes the region to a file This method is provided for debugging purposes. It writes the object to a flat layer 0/0 in a single top cell.
This method has been introduced in version 0.29.
TileOutputReceiver
Bases: klayout.dbcore.TileOutputReceiverBase
@brief A receiver abstraction for the tiling processor.
The tiling processor (\TilingProcessor) is a framework for executing sequences of operations on tiles of a layout or multiple layouts. The \TileOutputReceiver class is used to specify an output channel for the tiling processor. See \TilingProcessor#output for more details.
This class has been introduced in version 0.23.
__doc__
class
__doc__ = '@brief A receiver abstraction for the tiling processor.\n\nThe tiling processor (\\TilingProcessor) is a framework for executing sequences of operations on tiles of a layout or multiple layouts. The \\TileOutputReceiver class is used to specify an output channel for the tiling processor. See \\TilingProcessor#output for more details.\n\nThis class has been introduced in version 0.23.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 184
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
TileOutputReceiverBase
@hide @alias TileOutputReceiver
__doc__
class
__doc__ = '@hide\n@alias TileOutputReceiver'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 183
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TileOutputReceiverBase' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> TileOutputReceiverBase
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> TileOutputReceiverBase
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> TileOutputReceiverBase
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> TileOutputReceiverBase
@brief Creates a new object of this class
processor
method descriptor
processor() -> TilingProcessor
@brief Gets the processor the receiver is attached to
This attribute is set before begin and can be nil if the receiver is not attached to a processor.
This method has been introduced in version 0.25.
TilingProcessor
@brief A processor for layout which distributes tasks over tiles
The tiling processor executes one or several scripts on one or multiple layouts providing a tiling scheme. In that scheme, the processor divides the original layout into rectangular tiles and executes the scripts on each tile separately. The tiling processor allows one to specify multiple, independent scripts which are run separately on each tile. It can make use of multi-core CPU's by supporting multiple threads running the tasks in parallel (with respect to tiles and scripts).
Tiling a optional - if no tiles are specified, the tiling processing basically operates flat and parallelization extends to the scripts only.
Tiles can be overlapping to gather input from neighboring tiles into the current tile. In order to provide that feature, a border can be specified which gives the amount by which the search region is extended beyond the border of the tile. To specify the border, use the \TilingProcessor#tile_border method.
The basis of the tiling processor are \Region objects and expressions. Expressions are a built-in simple language to form simple scripts. Expressions allow access to the objects and methods built into KLayout. Each script can consist of multiple operations. Scripts are specified using \TilingProcessor#queue.
Input is provided to the script through variables holding a \Region object each. From outside the tiling processor, input is specified with the \TilingProcessor#input method. This method is given a name and a \RecursiveShapeIterator object which delivers the data for the input. On the script side, a \Region object is provided through a variable named like the first argument of the "input" method.
Inside the script the following functions are provided:
@ul @li"_dbu" delivers the database unit used for the computations @/li @li"_tile" delivers a region containing a mask for the tile (a rectangle) or nil if no tiling is used @/li @li"_output" is used to deliver output (see below) @/li @/ul
Output can be obtained from the tiling processor by registering a receiver with a channel. A channel is basically a name. Inside the script, the name describes a variable which can be used as the first argument of the "_output" function to identify the channel. A channel is registers using the \TilingProcessor#output method. Beside the name, a receiver must be specified. A receiver is either another layout (a cell of that), a report database or a custom receiver implemented through the \TileOutputReceiver class.
The "_output" function expects two or three parameters: one channel id (the variable that was defined by the name given in the output method call) and an object to output (a \Region, \Edges, \EdgePairs or a geometrical primitive such as \Polygon or \Box). In addition, a boolean argument can be given indicating whether clipping at the tile shall be applied. If clipping is requested (the default), the shapes will be clipped at the tile's box.
The tiling can be specified either through a tile size, a tile number or both. If a tile size is specified with the \TilingProcessor#tile_size method, the tiling processor will compute the number of tiles required. If the tile count is given (through \TilingProcessor#tiles), the tile size will be computed. If both are given, the tiling array is fixed and the array is centered around the original layout's center. If the tiling origin is given as well, the tiling processor will use the given array without any modifications.
Once the tiling processor has been set up, the operation can be launched using \TilingProcessor#execute.
This is some sample code. It performs two XOR operations between two layouts and delivers the results to a report database:
@code ly1 = ... # first layout ly2 = ... # second layout
rdb = RBA::ReportDatabase::new("xor") output_cell = rdb.create_cell(ly1.top_cell.name) output_cat1 = rbd.create_category("XOR 1-10") output_cat2 = rbd.create_category("XOR 2-11")
tp = RBA::TilingProcessor::new tp.input("a1", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(1, 0)) tp.input("a2", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(2, 0)) tp.input("b1", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(11, 0)) tp.input("b2", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(12, 0)) tp.output("o1", rdb, output_cell, output_cat1) tp.output("o2", rdb, output_cell, output_cat2) tp.queue("_output(o1, a1 ^ b1)") tp.queue("_output(o2, a2 ^ b2)") tp.tile_size(50.0, 50.0) tp.execute("Job description") @/code
This class has been introduced in version 0.23.
__doc__
class
__doc__ = '@brief A processor for layout which distributes tasks over tiles\n\nThe tiling processor executes one or several scripts on one or multiple layouts providing a tiling scheme. In that scheme, the processor divides the original layout into rectangular tiles and executes the scripts on each tile separately. The tiling processor allows one to specify multiple, independent scripts which are run separately on each tile. It can make use of multi-core CPU\'s by supporting multiple threads running the tasks in parallel (with respect to tiles and scripts).\n\nTiling a optional - if no tiles are specified, the tiling processing basically operates flat and parallelization extends to the scripts only.\n\nTiles can be overlapping to gather input from neighboring tiles into the current tile. In order to provide that feature, a border can be specified which gives the amount by which the search region is extended beyond the border of the tile. To specify the border, use the \\TilingProcessor#tile_border method.\n\nThe basis of the tiling processor are \\Region objects and expressions. Expressions are a built-in simple language to form simple scripts. Expressions allow access to the objects and methods built into KLayout. Each script can consist of multiple operations. Scripts are specified using \\TilingProcessor#queue.\n\nInput is provided to the script through variables holding a \\Region object each. From outside the tiling processor, input is specified with the \\TilingProcessor#input method. This method is given a name and a \\RecursiveShapeIterator object which delivers the data for the input. On the script side, a \\Region object is provided through a variable named like the first argument of the "input" method.\n\nInside the script the following functions are provided:\n\n@ul\n@li"_dbu" delivers the database unit used for the computations @/li\n@li"_tile" delivers a region containing a mask for the tile (a rectangle) or nil if no tiling is used @/li\n@li"_output" is used to deliver output (see below) @/li\n@/ul\n\nOutput can be obtained from the tiling processor by registering a receiver with a channel. A channel is basically a name. Inside the script, the name describes a variable which can be used as the first argument of the "_output" function to identify the channel. A channel is registers using the \\TilingProcessor#output method. Beside the name, a receiver must be specified. A receiver is either another layout (a cell of that), a report database or a custom receiver implemented through the \\TileOutputReceiver class.\n\nThe "_output" function expects two or three parameters: one channel id (the variable that was defined by the name given in the output method call) and an object to output (a \\Region, \\Edges, \\EdgePairs or a geometrical primitive such as \\Polygon or \\Box). In addition, a boolean argument can be given indicating whether clipping at the tile shall be applied. If clipping is requested (the default), the shapes will be clipped at the tile\'s box.\n\nThe tiling can be specified either through a tile size, a tile number or both. If a tile size is specified with the \\TilingProcessor#tile_size method, the tiling processor will compute the number of tiles required. If the tile count is given (through \\TilingProcessor#tiles), the tile size will be computed. If both are given, the tiling array is fixed and the array is centered around the original layout\'s center. If the tiling origin is given as well, the tiling processor will use the given array without any modifications.\n\nOnce the tiling processor has been set up, the operation can be launched using \\TilingProcessor#execute.\n\nThis is some sample code. It performs two XOR operations between two layouts and delivers the results to a report database:\n\n@code\nly1 = ... # first layout\nly2 = ... # second layout\n\nrdb = RBA::ReportDatabase::new("xor")\noutput_cell = rdb.create_cell(ly1.top_cell.name)\noutput_cat1 = rbd.create_category("XOR 1-10")\noutput_cat2 = rbd.create_category("XOR 2-11")\n\ntp = RBA::TilingProcessor::new\ntp.input("a1", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(1, 0))\ntp.input("a2", ly1, ly1.top_cell.cell_index, RBA::LayerInfo::new(2, 0))\ntp.input("b1", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(11, 0))\ntp.input("b2", ly2, ly2.top_cell.cell_index, RBA::LayerInfo::new(12, 0))\ntp.output("o1", rdb, output_cell, output_cat1)\ntp.output("o2", rdb, output_cell, output_cat2)\ntp.queue("_output(o1, a1 ^ b1)")\ntp.queue("_output(o2, a2 ^ b2)")\ntp.tile_size(50.0, 50.0)\ntp.execute("Job description")\n@/code\n\nThis class has been introduced in version 0.23.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 185
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TilingProcessor' objects>
list of weak references to the object
dbu
class
dbu: float = <attribute 'dbu' of 'TilingProcessor' objects>
@brief Gets the database unit under which the computations will be done
@brief Sets the database unit under which the computations will be done
All data used within the scripts will be brought to that database unit. If none is given it will be the database unit of the first layout given or 1nm if no layout is specified.
frame
class
frame: None = <attribute 'frame' of 'TilingProcessor' objects>
@brief Sets the layout frame
The layout frame is the box (in micron units) taken into account for computing the tiles if the tile counts are not given. If the layout frame is not set or set to an empty box, the processor will try to derive the frame from the given inputs.
This method has been introduced in version 0.25.
scale_to_dbu
class
scale_to_dbu: bool = <attribute 'scale_to_dbu' of 'TilingProcessor' objects>
@brief Gets a valid indicating whether automatic scaling to database unit is enabled
This method has been introduced in version 0.23.2.
@brief Enables or disabled automatic scaling to database unit
If automatic scaling to database unit is enabled, the input is automatically scaled to the database unit set inside the tile processor. This is the default.
This method has been introduced in version 0.23.2.
threads
class
threads: int = <attribute 'threads' of 'TilingProcessor' objects>
@brief Gets the number of threads to use
@brief Specifies the number of threads to use
__copy__
method descriptor
__copy__() -> TilingProcessor
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> TilingProcessor
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> TilingProcessor
@brief Creates a copy of self
execute
method descriptor
execute() -> None
@brief Runs the job
This method will initiate execution of the queued scripts, once for every tile. The desc is a text shown in the progress bar for example.
input
method descriptor
input(name: str, edge_pairs: EdgePairs) -> None
input(name: str, edge_pairs: EdgePairs, trans: ICplxTrans) -> None
input(name: str, edges: Edges) -> None
input(name: str, edges: Edges, trans: ICplxTrans) -> None
input(name: str, iter: RecursiveShapeIterator) -> None
input(name: str, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None
input(name: str, layout: Layout, cell_index: int, layer: int) -> None
input(name: str, layout: Layout, cell_index: int, layer: int, trans: ICplxTrans) -> None
input(name: str, layout: Layout, cell_index: int, lp: LayerInfo) -> None
input(name: str, layout: Layout, cell_index: int, lp: LayerInfo, trans: ICplxTrans) -> None
input(name: str, region: Region) -> None
input(name: str, region: Region, trans: ICplxTrans) -> None
input(name: str, texts: Texts) -> None
input(name: str, texts: Texts, trans: ICplxTrans) -> None
input()
@brief Specifies input for the tiling processor This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too.
Caution: the Texts object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Texts object. Not doing so may crash the application.
The name specifies the variable under which the input can be used in the scripts. This variant has been introduced in version 0.27.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> TilingProcessor
@brief Creates a new object of this class
output
method descriptor
output(name: str, edge_pairs: EdgePairs) -> None
output(name: str, edges: Edges) -> None
output(name: str, image: lay.BasicImage) -> None
output(name: str, layout: Layout, cell: int, layer_index: int) -> None
output(name: str, layout: Layout, cell: int, lp: LayerInfo) -> None
output(name: str, rdb: rdb.ReportDatabase, cell_id: int, category_id: int) -> None
output(name: str, rec: TileOutputReceiverBase) -> None
output(name: str, region: Region) -> None
output(name: str, sum: float) -> None
output(name: str, texts: Texts) -> None
output()
@brief Specifies output to a report database This method will establish an output channel for the processor. The output sent to that channel will be put into the report database given by the "rdb" parameter. "cell_id" specifies the cell and "category_id" the category to use.
The name is the name which must be used in the _output function of the scripts in order to address that channel.
queue
method descriptor
queue() -> None
@brief Queues a script for parallel execution
With this method, scripts are registered that are executed in parallel on each tile. The scripts have "Expressions" syntax and can make use of several predefined variables and functions. See the \TilingProcessor class description for details.
tile_border
method descriptor
tile_border() -> None
@brief Sets the tile border
Specifies the tile border. The border is a margin that is considered when fetching shapes. By specifying a border you can fetch shapes into the tile's data which are outside the tile but still must be considered in the computations (i.e. because they might grow into the tile).
The tile border is given in micron.
tile_origin
method descriptor
tile_origin() -> None
@brief Sets the tile origin
Specifies the origin (lower left corner) of the tile field. If no origin is specified, the tiles are centered to the layout's bounding box. Giving the origin together with the tile count and dimensions gives full control over the tile array.
The tile origin is given in micron.
tile_size
method descriptor
tile_size() -> None
@brief Sets the tile size
Specifies the size of the tiles to be used. If no tile size is specified, tiling won't be used and all computations will be done on the whole layout.
The tile size is given in micron.
tiles
method descriptor
tiles() -> None
@brief Sets the tile count
Specifies the number of tiles to be used. If no tile number is specified, the number of tiles required is computed from the layout's dimensions and the tile size. If a number is given, but no tile size, the tile size will be computed from the layout's dimensions.
var
method descriptor
var() -> None
@brief Defines a variable for the tiling processor script
The name specifies the variable under which the value can be used in the scripts.
Trans
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M0
class
M0: Trans = m0 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M135
class
M135: Trans = m135 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M45
class
M45: Trans = m45 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
M90
class
M90: Trans = m90 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R0
class
R0: Trans = r0 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R180
class
R180: Trans = r180 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R270
class
R270: Trans = r270 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
R90
class
R90: Trans = r90 0,0
@brief A simple transformation
Simple transformations only provide rotations about angles which a multiples of 90 degree. Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). These can be combined with a displacement which is applied after the rotation/mirror. This version acts on integer coordinates. A version for floating-point coordinates is \DTrans.
Here are some examples for using the Trans class:
@code t = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction
the inverse: -> "r0 0,-100"
t.inverted.to_s
concatenation: -> "r90 -100,0"
(RBA::Trans::R90 * t).to_s
apply to a point: -> "0,100"
RBA::Trans::R90.trans(RBA::Point::new(100, 0)) @/code
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A simple transformation\n\nSimple transformations only provide rotations about angles which a multiples of 90 degree.\nTogether with the mirror options, this results in 8 distinct orientations (fixpoint transformations).\nThese can be combined with a displacement which is applied after the rotation/mirror.\nThis version acts on integer coordinates. A version for floating-point coordinates is \\DTrans.\n\nHere are some examples for using the Trans class:\n\n@code\nt = RBA::Trans::new(0, 100) # displacement by 100 DBU in y direction\n# the inverse: -> "r0 0,-100"\nt.inverted.to_s\n# concatenation: -> "r90 -100,0"\n(RBA::Trans::R90 * t).to_s\n# apply to a point: -> "0,100"\nRBA::Trans::R90.trans(RBA::Point::new(100, 0))\n@/code\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 186
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Trans' objects>
list of weak references to the object
angle
class
angle: int = <attribute 'angle' of 'Trans' objects>
@brief Gets the angle in units of 90 degree
This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true.
@brief Sets the angle in units of 90 degree @param a The new angle
This method was introduced in version 0.20.
disp
class
disp: Vector = <attribute 'disp' of 'Trans' objects>
@brief Gets to the displacement vector
Staring with version 0.25 the displacement type is a vector.
@brief Sets the displacement @param u The new displacement
This method was introduced in version 0.20. Staring with version 0.25 the displacement type is a vector.
mirror
class
mirror: bool = <attribute 'mirror' of 'Trans' objects>
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
@brief Sets the mirror flag "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag
This method was introduced in version 0.20.
rot
class
rot: int = <attribute 'rot' of 'Trans' objects>
@brief Gets the angle/mirror code
The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis).
@brief Sets the angle/mirror code @param r The new angle/rotation code (see \rot property)
This method was introduced in version 0.20.
__copy__
method descriptor
__copy__() -> Trans
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Trans
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(c: Trans, u: Optional[Vector] = ...) -> None
__init__(c: Trans, x: Optional[int] = ..., y: Optional[int] = ...) -> None
__init__(dtrans: DTrans) -> None
__init__(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., u: Optional[Vector] = ...) -> None
__init__(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> None
__init__(u: Vector) -> None
__init__(x: int, y: int) -> None
__init__()
@brief Creates a transformation using a displacement given as two coordinates
@param x The horizontal displacement @param y The vertical displacement
__lt__
method descriptor
__lt__() -> bool
@brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions.
__mul__
method descriptor
__mul__(box: Box) -> Box
__mul__(d: int) -> int
__mul__(edge: Edge) -> Edge
__mul__(p: Point) -> Point
__mul__(path: Path) -> Path
__mul__(polygon: Polygon) -> Polygon
__mul__(t: Trans) -> Trans
__mul__(text: Text) -> Text
__mul__(v: Vector) -> Vector
__mul__()
@brief Returns the concatenated transformation
The * operator returns self*t ("t is applied before this transformation").
@param t The transformation to apply before @return The modified transformation
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality
__repr__
method descriptor
__repr__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: Box) -> Box
__rmul__(d: int) -> int
__rmul__(edge: Edge) -> Edge
__rmul__(p: Point) -> Point
__rmul__(path: Path) -> Path
__rmul__(polygon: Polygon) -> Polygon
__rmul__(text: Text) -> Text
__rmul__(v: Vector) -> Vector
__rmul__()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
ctrans
method descriptor
ctrans() -> int
@brief Transforms a single distance
The "ctrans" method transforms the given distance. This is equivalent to multiplying with the magnification. For the simple transformations, there is no magnification and no modification of the distance.
@param d The distance to transform @return The transformed distance
The product '*' has been added as a synonym in version 0.28. The distance can be signed since version 0.29.3.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Trans
@brief Creates a copy of self
from_dtrans
builtin
from_dtrans() -> Trans
@brief Creates an integer coordinate transformation from a floating-point coordinate transformation
This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'.
from_s
builtin
from_s() -> Trans
@brief Creates a transformation 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> Trans
@brief Inverts the transformation (in place)
Inverts the transformation and replaces this object by the inverted one.
@return The inverted transformation
inverted
method descriptor
inverted() -> Trans
@brief Returns the inverted transformation Returns the inverted transformation
@return The inverted transformation
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mirror
method descriptor
is_mirror() -> bool
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
new
builtin
new() -> Trans
new(c: Trans, u: Optional[Vector] = ...) -> Trans
new(c: Trans, x: Optional[int] = ..., y: Optional[int] = ...) -> Trans
new(dtrans: DTrans) -> Trans
new(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., u: Optional[Vector] = ...) -> Trans
new(rot: Optional[int] = ..., mirrx: Optional[bool] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> Trans
new(u: Vector) -> Trans
new(x: int, y: int) -> Trans
new()
@brief Creates a transformation using a displacement given as two coordinates
@param x The horizontal displacement @param y The vertical displacement
to_dtype
method descriptor
to_dtype() -> DTrans
@brief Converts the transformation to a floating-point coordinate transformation
The database unit can be specified to translate the integer-coordinate transformation into a floating-point coordinate transformation in micron units. The database unit is basically a scaling factor.
This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
trans
method descriptor
trans(box: Box) -> Box
trans(edge: Edge) -> Edge
trans(p: Point) -> Point
trans(path: Path) -> Path
trans(polygon: Polygon) -> Polygon
trans(text: Text) -> Text
trans(v: Vector) -> Vector
trans()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
TrapezoidDecompositionMode
@brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition
This enum has been introduced in version 0.27.
TD_htrapezoids
class
TD_htrapezoids: TrapezoidDecompositionMode = TD_htrapezoids (1)
@brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition
This enum has been introduced in version 0.27.
TD_simple
class
TD_simple: TrapezoidDecompositionMode = TD_simple (0)
@brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition
This enum has been introduced in version 0.27.
TD_vtrapezoids
class
TD_vtrapezoids: TrapezoidDecompositionMode = TD_vtrapezoids (2)
@brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition
This enum has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition\n\nThis enum has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 41
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'TrapezoidDecompositionMode' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> TrapezoidDecompositionMode
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> TrapezoidDecompositionMode
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: TrapezoidDecompositionMode) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> TrapezoidDecompositionMode
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> TrapezoidDecompositionMode
new(s: str) -> TrapezoidDecompositionMode
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
Utils
@brief This namespace provides a collection of utility functions
This class has been introduced in version 0.27.
__doc__
class
__doc__ = '@brief This namespace provides a collection of utility functions\n\nThis class has been introduced in version 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 192
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Utils' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Utils
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Utils
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Utils
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Utils
@brief Creates a new object of this class
spline_interpolation
builtin
spline_interpolation(control_points: Sequence[DPoint], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]
spline_interpolation(control_points: Sequence[DPoint], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]
spline_interpolation(control_points: Sequence[Point], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]
spline_interpolation(control_points: Sequence[Point], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]
spline_interpolation()
@brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots.
This is the version for integer-coordinate points for non-rational splines.
VAlign
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
NoVAlign
class
NoVAlign: VAlign = NoVAlign (-1)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignBottom
class
VAlignBottom: VAlign = VAlignBottom (2)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignCenter
class
VAlignCenter: VAlign = VAlignCenter (1)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
VAlignTop
class
VAlignTop: VAlign = VAlignTop (0)
@brief This class represents the vertical alignment modes. This enum has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief This class represents the vertical alignment modes.\nThis enum has been introduced in version 0.28.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 178
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'VAlign' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> VAlign
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> VAlign
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: VAlign) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> VAlign
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> VAlign
new(s: str) -> VAlign
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
VCplxTrans
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
M0
class
M0: VCplxTrans = m0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
M135
class
M135: VCplxTrans = m135 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
M45
class
M45: VCplxTrans = m45 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
M90
class
M90: VCplxTrans = m90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
R0
class
R0: VCplxTrans = r0 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
R180
class
R180: VCplxTrans = r180 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
R270
class
R270: VCplxTrans = r270 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
R90
class
R90: VCplxTrans = r90 *1 0,0
@brief A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.
Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar.
Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:
@code
Create a transformation that applies a magnification of 1.5, a rotation by 90 degree
and displacement of 10 in x and 20 units in y direction:
t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20
compute the inverse:
t.inverted.to_s # r270 *0.666666667 -13,7
Combine with another displacement (applied after that):
(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25
Transform a point:
t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 @/code
The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A complex transformation\n\nA complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary\nangle and a displacement. This is also the order, the operations are applied.\nThis version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.\n\nComplex transformations are extensions of the simple transformation classes (\\Trans in that case) and behave similar.\n\nTransformations can be used to transform points or other objects. Transformations can be combined with the \'*\' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:\n\n@code\n# Create a transformation that applies a magnification of 1.5, a rotation by 90 degree\n# and displacement of 10 in x and 20 units in y direction:\nt = RBA::VCplxTrans::new(1.5, 90, false, 10, 20)\nt.to_s # r90 *1.5 10,20\n# compute the inverse:\nt.inverted.to_s # r270 *0.666666667 -13,7\n# Combine with another displacement (applied after that):\n(RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25\n# Transform a point:\nt.trans(RBA::DPoint::new(100, 200)).to_s # -290,170\n@/code\n\nThe VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.\n\nThis class has been introduced in version 0.25.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 191
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'VCplxTrans' objects>
list of weak references to the object
angle
class
angle: float = <attribute 'angle' of 'VCplxTrans' objects>
@brief Gets the angle
Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree.
@return The rotation angle this transformation provides in degree units (0..360 deg).
@brief Sets the angle @param a The new angle See \angle for a description of that attribute.
disp
class
disp: Vector = <attribute 'disp' of 'VCplxTrans' objects>
@brief Gets the displacement
@brief Sets the displacement @param u The new displacement
mag
class
mag: float = <attribute 'mag' of 'VCplxTrans' objects>
@brief Gets the magnification
@brief Sets the magnification @param m The new magnification
mirror
class
mirror: bool = <attribute 'mirror' of 'VCplxTrans' objects>
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
@brief Sets the mirror flag "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag
__copy__
method descriptor
__copy__() -> VCplxTrans
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> VCplxTrans
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Tests for equality
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(c: VCplxTrans, mag: Optional[float] = ..., u: Optional[Vector] = ...) -> None
__init__(c: VCplxTrans, mag: Optional[float] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[Vector] = ...) -> None
__init__(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> None
__init__(t: DTrans, mag: Optional[float] = ...) -> None
__init__(trans: CplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: DCplxTrans, dbu: Optional[float] = ...) -> None
__init__(trans: ICplxTrans, dbu: Optional[float] = ...) -> None
__init__(u: Vector) -> None
__init__(x: int, y: int) -> None
__init__()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
__lt__
method descriptor
__lt__() -> bool
@brief Provides a 'less' criterion for sorting This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions.
__mul__
method descriptor
__mul__(box: DBox) -> Box
__mul__(d: float) -> int
__mul__(edge: DEdge) -> Edge
__mul__(p: DPoint) -> Point
__mul__(p: DVector) -> Vector
__mul__(path: DPath) -> Path
__mul__(polygon: DPolygon) -> Polygon
__mul__(t: CplxTrans) -> ICplxTrans
__mul__(t: DCplxTrans) -> VCplxTrans
__mul__(t: VCplxTrans) -> VCplxTrans
__mul__(text: DText) -> Text
__mul__()
@brief Returns the concatenated transformation
The * operator returns self*t ("t is applied before this transformation").
@param t The transformation to apply before @return The modified transformation
__ne__
method descriptor
__ne__() -> bool
@brief Tests for inequality
__repr__
method descriptor
__repr__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(box: DBox) -> Box
__rmul__(d: float) -> int
__rmul__(edge: DEdge) -> Edge
__rmul__(p: DPoint) -> Point
__rmul__(p: DVector) -> Vector
__rmul__(path: DPath) -> Path
__rmul__(polygon: DPolygon) -> Polygon
__rmul__(text: DText) -> Text
__rmul__()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
__str__
method descriptor
__str__() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
ctrans
method descriptor
ctrans() -> int
@brief Transforms a single distance
The "ctrans" method transforms the given distance. This is equivalent to multiplying with the magnification. For the simple transformations, there is no magnification and no modification of the distance.
@param d The distance to transform @return The transformed distance
The product '*' has been added as a synonym in version 0.28. The distance can be signed since version 0.29.3.
destroy
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> VCplxTrans
@brief Creates a copy of self
from_s
builtin
from_s() -> VCplxTrans
@brief 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
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given transformation. This method enables transformations as hash keys.
This method has been introduced in version 0.25.
invert
method descriptor
invert() -> VCplxTrans
@brief Inverts the transformation (in place)
Inverts the transformation and replaces this transformation by its inverted one.
@return The inverted transformation
inverted
method descriptor
inverted() -> CplxTrans
@brief Returns the inverted transformation
Returns the inverted transformation. This method does not modify the transformation.
@return The inverted transformation
is_complex
method descriptor
is_complex() -> bool
@brief Returns true if the transformation is a complex one
If this predicate is false, the transformation can safely be converted to a simple transformation. Otherwise, this conversion will be lossy. The predicate value is equivalent to 'is_mag || !is_ortho'.
This method has been introduced in version 0.27.5.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_mag
method descriptor
is_mag() -> bool
@brief Tests, if the transformation is a magnifying one
This is the recommended test for checking if the transformation represents a magnification.
is_mirror
method descriptor
is_mirror() -> bool
@brief Gets the mirror flag
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property.
is_ortho
method descriptor
is_ortho() -> bool
@brief Tests, if the transformation is an orthogonal transformation
If the rotation is by a multiple of 90 degree, this method will return true.
is_unity
method descriptor
is_unity() -> bool
@brief Tests, whether this is a unit transformation
new
builtin
new() -> VCplxTrans
new(c: VCplxTrans, mag: Optional[float] = ..., u: Optional[Vector] = ...) -> VCplxTrans
new(c: VCplxTrans, mag: Optional[float] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> VCplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., u: Optional[Vector] = ...) -> VCplxTrans
new(mag: Optional[float] = ..., rot: Optional[float] = ..., mirrx: Optional[bool] = ..., x: Optional[int] = ..., y: Optional[int] = ...) -> VCplxTrans
new(t: DTrans, mag: Optional[float] = ...) -> VCplxTrans
new(trans: CplxTrans, dbu: Optional[float] = ...) -> VCplxTrans
new(trans: DCplxTrans, dbu: Optional[float] = ...) -> VCplxTrans
new(trans: ICplxTrans, dbu: Optional[float] = ...) -> VCplxTrans
new(u: Vector) -> VCplxTrans
new(x: int, y: int) -> VCplxTrans
new()
@brief Creates a transformation using magnification, angle, mirror flag and displacement
The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.
@param mag The magnification @param rot The rotation angle in units of degree @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement
rot
method descriptor
rot() -> int
@brief Returns the respective simple transformation equivalent rotation code if possible
If this transformation is orthogonal (is_ortho () == true), then this method will return the corresponding fixpoint transformation, not taking into account magnification and displacement. If the transformation is not orthogonal, the result reflects the quadrant the rotation goes into.
s_trans
method descriptor
s_trans() -> DTrans
@brief Extracts the simple transformation part
The simple transformation part does not reflect magnification or arbitrary angles. Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0.
to_itrans
method descriptor
to_itrans() -> DCplxTrans
@brief Converts the transformation to another transformation with floating-point output coordinates
The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit.
This method is redundant with the conversion constructors and is ill-named. Instead of 'to_itrans' use the conversion constructor:
@code dtrans = RBA::DCplxTrans::new(vtrans, dbu) @/code
This method has been deprecated in version 0.29.
to_s
method descriptor
to_s() -> str
@brief String conversion If 'lazy' is true, some parts are omitted when not required. If a DBU is given, the output units will be micrometers.
The lazy and DBU arguments have been added in version 0.27.6.
to_trans
method descriptor
to_trans() -> ICplxTrans
@brief Converts the transformation to another transformation with integer input coordinates
This method is redundant with the conversion constructors and is ill-named. Instead of 'to_trans' use the conversion constructor:
@code itrans = RBA::ICplxTrans::new(vtrans, dbu) @/code
This method has been deprecated in version 0.29.
to_vtrans
method descriptor
to_vtrans() -> CplxTrans
@brief Converts the transformation to another transformation with integer input and floating-point output coordinates
The database unit can be specified to translate the integer coordinate displacement in database units to an floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit.
This method is redundant with the conversion constructors and is ill-named. Instead of 'to_vtrans' use the conversion constructor:
@code trans = RBA::CplxTrans::new(vtrans, dbu) @/code
This method has been deprecated in version 0.29.
trans
method descriptor
trans(box: DBox) -> Box
trans(edge: DEdge) -> Edge
trans(p: DPoint) -> Point
trans(p: DVector) -> Vector
trans(path: DPath) -> Path
trans(polygon: DPolygon) -> Polygon
trans(text: DText) -> Text
trans()
@brief Transforms a text
't*text' or 't.trans(text)' is equivalent to text.transformed(t).
@param text The text to transform @return The transformed text
This convenience method has been introduced in version 0.25.
Vector
@brief A integer vector class A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes.
This class has been introduced in version 0.25.
See @The Database API@ for more details about the database objects.
__doc__
class
__doc__ = '@brief A integer vector class\nA vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. \nVectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes.\n\nThis class has been introduced in version 0.25.\n\nSee @<a href="/programming/database_api.xml">The Database API@</a> for more details about the database objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 194
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Vector' objects>
list of weak references to the object
x
class
x: int = <attribute 'x' of 'Vector' objects>
@brief Accessor to the x coordinate
@brief Write accessor to the x coordinate
y
class
y: int = <attribute 'y' of 'Vector' objects>
@brief Accessor to the y coordinate
@brief Write accessor to the y coordinate
__add__
method descriptor
__add__(p: Point) -> Point
__add__(v: Vector) -> Vector
__add__()
@brief Adds a vector and a point
Returns the point p shifted by the vector.
__copy__
method descriptor
__copy__() -> Vector
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Vector
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality test operator
__hash__
method descriptor
__hash__() -> int
@brief Computes a hash value Returns a hash value for the given vector. This method enables vectors as hash keys.
This method has been introduced in version 0.25.
__imul__
method descriptor
__imul__() -> Vector
@brief Scaling by some factor
Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded.
__init__
method descriptor
__init__() -> None
__init__(dvector: DVector) -> None
__init__(p: Point) -> None
__init__(x: int, y: int) -> None
__init__()
@brief Constructor for a vector from two coordinate values
__itruediv__
method descriptor
__itruediv__() -> Vector
@brief Division by some divisor
Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded.
__lt__
method descriptor
__lt__() -> bool
@brief "less" comparison operator
This operator is provided to establish a sorting order
__mul__
method descriptor
__mul__(f: float) -> Vector
__mul__(v: Vector) -> int
__mul__()
@brief Computes the scalar product between self and the given vector
The scalar product of a and b is defined as: vp = axbx+ayby.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality test operator
__neg__
method descriptor
__neg__() -> Vector
@brief Compute the negative of a vector
Returns a new vector with -x,-y.
__repr__
method descriptor
__repr__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__rmul__
method descriptor
__rmul__(f: float) -> Vector
__rmul__(v: Vector) -> int
__rmul__()
@brief Computes the scalar product between self and the given vector
The scalar product of a and b is defined as: vp = axbx+ayby.
__str__
method descriptor
__str__() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
__sub__
method descriptor
__sub__() -> Vector
@brief Subtract two vectors
Subtract vector v from self by subtracting the coordinates.
__truediv__
method descriptor
__truediv__() -> Vector
@brief Division by some divisor
Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded.
abs
method descriptor
abs() -> float
@brief Returns the length of the vector 'abs' is an alias provided for compatibility with the former point type.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Vector
@brief Creates a copy of self
from_s
builtin
from_s() -> Vector
@brief Creates an object from a string Creates the object from a string representation (as returned by \to_s)
hash
method descriptor
hash() -> int
@brief Computes a hash value Returns a hash value for the given vector. This method enables vectors as hash keys.
This method has been introduced in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
length
method descriptor
length() -> float
@brief Returns the length of the vector 'abs' is an alias provided for compatibility with the former point type.
new
builtin
new() -> Vector
new(dvector: DVector) -> Vector
new(p: Point) -> Vector
new(x: int, y: int) -> Vector
new()
@brief Constructor for a vector from two coordinate values
sprod
method descriptor
sprod() -> int
@brief Computes the scalar product between self and the given vector
The scalar product of a and b is defined as: vp = axbx+ayby.
sprod_sign
method descriptor
sprod_sign() -> int
@brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product
@return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative.
sq_abs
method descriptor
sq_abs() -> float
@brief The square length of the vector 'sq_abs' is an alias provided for compatibility with the former point type.
sq_length
method descriptor
sq_length() -> float
@brief The square length of the vector 'sq_abs' is an alias provided for compatibility with the former point type.
to_dtype
method descriptor
to_dtype() -> DVector
@brief Converts the vector to a floating-point coordinate vector The database unit can be specified to translate the integer-coordinate vector into a floating-point coordinate vector in micron units. The database unit is basically a scaling factor.
to_p
method descriptor
to_p() -> Point
@brief Turns the vector into a point This method returns the point resulting from adding the vector to (0,0). This method has been introduced in version 0.25.
to_s
method descriptor
to_s() -> str
@brief String conversion If a DBU is given, the output units will be micrometers.
The DBU argument has been added in version 0.27.6.
vprod
method descriptor
vprod() -> int
@brief Computes the vector product between self and the given vector
The vector product of a and b is defined as: vp = axby-aybx.
vprod_sign
method descriptor
vprod_sign() -> int
@brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product
@return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative.
ZeroDistanceMode
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
AlwaysIncludeZeroDistance
class
AlwaysIncludeZeroDistance: ZeroDistanceMode = AlwaysIncludeZeroDistance (4)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenCollinearAndTouching
class
IncludeZeroDistanceWhenCollinearAndTouching: ZeroDistanceMode = IncludeZeroDistanceWhenCollinearAndTouching (2)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenOverlapping
class
IncludeZeroDistanceWhenOverlapping: ZeroDistanceMode = IncludeZeroDistanceWhenOverlapping (3)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
IncludeZeroDistanceWhenTouching
class
IncludeZeroDistanceWhenTouching: ZeroDistanceMode = IncludeZeroDistanceWhenTouching (1)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
NeverIncludeZeroDistance
class
NeverIncludeZeroDistance: ZeroDistanceMode = NeverIncludeZeroDistance (0)
@brief This class represents the zero_distance_mode type for \Region#width and related checks. This mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\NeverIncludeZeroDistance) or only include them if they share at least one common point (\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks. This enum has been introduced in version 0.28.16.
__doc__
class
__doc__ = "@brief This class represents the zero_distance_mode type for \\Region#width and related checks.\nThis mode determines how edges with zero distance are treated in the DRC checks. Formally these edges do neither represent a space other other relation as they do not face each other. There are three modes available to treat this boundary case: Ignore such edges (\\NeverIncludeZeroDistance) or only include them if they share at least one common point (\\IncludeZeroDistanceWhenTouching). The latter mode allows activating checks for the 'kissing corner' case and is the default mode in most checks.\nThis enum has been introduced in version 0.28.16."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 167
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.dbcore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ZeroDistanceMode' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> ZeroDistanceMode
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ZeroDistanceMode
@brief Creates a copy of self
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: ZeroDistanceMode) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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
method descriptor
destroy() -> None
@brief 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
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ZeroDistanceMode
@brief Creates a copy of self
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new(i: int) -> ZeroDistanceMode
new(s: str) -> ZeroDistanceMode
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum