Terminal
Terminal(routing_layer, structure)Electrical terminal.
Args
- routing_layer (str | tuple[int, int]): Layer used when routing from this terminal.
- structure (Rectangle | Circle | Polygon | Path): Template used for electrical routing. It does not create layout geometry or connect terminals by itself.
Methods
Section titled “Methods”| Method | Description |
|---|---|
bounds | Calculate the terminal bounds |
center | Calculate the terminal center. |
copy | Create a copy of this terminal. |
mirror | Mirror this terminal. |
rotate | Rotate this terminal. |
scale | Scale this terminal. |
size | Calculate the terminal size. |
transform | Apply a transformation to this terminal: |
translate | Translate this terminal. |
bounds
Section titled “bounds”bounds(self)Calculate the terminal bounds
Returns
ndarray: The lower-left and upper-right corners of the bounding box
of the terminal: ((min_x, min_y), (max_x, max_y)).
center
Section titled “center”center(self)Calculate the terminal center.
Returns
ndarray: The center of the bounding box of the terminal.
copy(self, deep=False)Create a copy of this terminal.
Args
- deep (bool): If set, creates a deep copy.
Returns
Terminal: New copy.
mirror
Section titled “mirror”mirror(self, axis_endpoint=(1, 0), axis_origin=(0, 0))Mirror this terminal.
Args
- axis_endpoint (Sequence[float] | complex): Mirror axis endpoint.
- axis_origin (Sequence[float] | complex): Mirror axis origin.
Returns
Terminal: This object.
rotate
Section titled “rotate”rotate(self, rotation, center=(0, 0))Rotate this terminal.
Args
- rotation (float): Rotation angle around the center (in degrees).
- center (Sequence[float] | complex): Center of rotation.
Returns
Terminal: This object.
scale(self, scaling, center=(0, 0))Scale this terminal.
Args
- scaling (float): Magnification factor.
- center (Sequence[float] | complex): Center of scaling.
Returns
Terminal: This object.
size(self)Calculate the terminal size.
Returns
ndarray: The size of the bounding box of the terminal.
transform
Section titled “transform”transform( self, translation=(0, 0), rotation=0, scaling=1, x_reflection=False)Apply a transformation to this terminal:
self = translate(rotate(mirror(scale(self))))
Args
- translation (Sequence[float] | complex): Translation vector.
- rotation (float): Rotation angle (in degrees).
- scaling (float): Magnification factor.
- x_reflection (bool): Mirror across the horizontal axis.
Returns
Terminal: This object.
translate
Section titled “translate”translate(self, translation)Translate this terminal.
Args
- translation (Sequence[float] | complex): Translation vector.
Returns
Terminal: This object.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
properties | Properties: Object properties. |
routing_layer | tuple[int, int]: Terminal routing layer. |
structure | Rectangle | Circle | Polygon | Path: Terminal structure. |
x_max | float: Upper bound in the x axis. |
x_mid | float: Bounding box center in the x axis. |
x_min | float: Lower bound in the x axis. |
y_max | float: Upper bound in the y axis. |
y_mid | float: Bounding box center in the y axis. |
y_min | float: Lower bound in the y axis. |
properties
Section titled “properties”Properties: Object properties.
routing_layer
Section titled “routing_layer”tuple[int, int]: Terminal routing layer.
structure
Section titled “structure”Rectangle | Circle | Polygon | Path: Terminal structure.
float: Upper bound in the x axis.
float: Bounding box center in the x axis.
float: Lower bound in the x axis.
float: Upper bound in the y axis.
float: Bounding box center in the y axis.
float: Lower bound in the y axis.