Terminal

class photonforge.Terminal(routing_layer, structure)

Electrical terminal.

Parameters:
  • routing_layer – Layer used when routing from this terminal.

  • structure – Terminal shape used for connectivity check and routing.

Methods

bounds()

Calculate the terminal bounds

center()

Calculate the terminal center.

copy([deep])

Create a copy of this terminal.

mirror([axis_endpoint, axis_origin])

Mirror this terminal.

rotate(rotation[, center])

Rotate this terminal.

scale(scaling[, center])

Scale this terminal.

size()

Calculate the terminal size.

transform([translation, rotation, scaling, ...])

Apply a transformation to this terminal: self = translate(rotate(mirror(scale(self))))

translate(translation)

Translate this terminal.

Attributes

routing_layer

Terminal routing layer.

structure

Terminal structure.

x_max

Upper bound in the x axis.

x_mid

Bounding box center in the x axis.

x_min

Lower bound in the x axis.

y_max

Upper bound in the y axis.

y_mid

Bounding box center in the y axis.

y_min

Lower bound in the y axis.

bounds()

Calculate the terminal bounds

Returns:

The lower-left and upper-right corners of the bounding box of the terminal: ((min_x, min_y), (max_x, max_y)).

center()

Calculate the terminal center.

Returns:

The center of the bounding box of the terminal.

copy(deep=False)

Create a copy of this terminal.

Parameters:

deep – If set, creates a deep copy.

Returns:

New copy.

mirror(axis_endpoint=(1, 0), axis_origin=(0, 0))

Mirror this terminal.

Parameters:
  • axis_endpoint – Mirror axis endpoint.

  • axis_origin – Mirror axis origin.

Returns:

This object.

rotate(rotation, center=(0, 0))

Rotate this terminal.

Parameters:
  • rotation – Rotation angle in degrees.

  • center – Center of rotation.

Returns:

This object.

routing_layer

Terminal routing layer.

scale(scaling, center=(0, 0))

Scale this terminal.

Parameters:
  • scaling – Magnification factor.

  • center – Center of scaling.

Returns:

This object.

size()

Calculate the terminal size.

Returns:

The size of the bounding box of the terminal.

structure

Terminal structure.

transform(translation=(0, 0), rotation=0, scaling=1, x_reflection=False)

Apply a transformation to this terminal: self = translate(rotate(mirror(scale(self))))

Parameters:
  • translation – Coordinate pair used as a translation vector.

  • rotation – Rotation angle in degrees.

  • scaling – Magnification factor.

  • x_reflection – Mirror across the horizontal axis.

Returns:

This object.

translate(translation)

Translate this terminal.

Parameters:

translation – Coordinate pair used as a translation vector.

Returns:

This object.

x_max

Upper bound in the x axis.

x_mid

Bounding box center in the x axis.

x_min

Lower bound in the x axis.

y_max

Upper bound in the y axis.

y_mid

Bounding box center in the y axis.

y_min

Lower bound in the y axis.