Skip to content

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.
MethodDescription
boundsCalculate the terminal bounds
centerCalculate the terminal center.
copyCreate a copy of this terminal.
mirrorMirror this terminal.
rotateRotate this terminal.
scaleScale this terminal.
sizeCalculate the terminal size.
transformApply a transformation to this terminal:
translateTranslate this terminal.

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(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(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(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(
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(self, translation)

Translate this terminal.

Args

  • translation (Sequence[float] | complex): Translation vector.

Returns

Terminal: This object.

AttributeDescription
propertiesProperties: Object properties.
routing_layertuple[int, int]: Terminal routing layer.
structureRectangle | Circle | Polygon | Path: Terminal structure.
x_maxfloat: Upper bound in the x axis.
x_midfloat: Bounding box center in the x axis.
x_minfloat: Lower bound in the x axis.
y_maxfloat: Upper bound in the y axis.
y_midfloat: Bounding box center in the y axis.
y_minfloat: Lower bound in the y axis.

Properties: Object properties.

tuple[int, int]: Terminal routing layer.

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.