Terminal¶
- class photonforge.Terminal(routing_layer, structure)¶
Electrical terminal.
- Parameters:
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
Object properties.
Terminal routing layer.
Terminal structure.
Upper bound in the x axis.
Bounding box center in the x axis.
Lower bound in the x axis.
Upper bound in the y axis.
Bounding box center in the y axis.
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))
.- Return type:
ndarray
- center()¶
Calculate the terminal center.
- Returns:
The center of the bounding box of the terminal.
- Return type:
ndarray
- copy(deep=False)¶
Create a copy of this terminal.
- Parameters:
deep (bool) – If set, creates a deep copy.
- Returns:
New copy.
- Return type:
- mirror(axis_endpoint=(1, 0), axis_origin=(0, 0))¶
Mirror this terminal.
- Parameters:
axis_endpoint (Sequence[float] | complex) – Mirror axis endpoint.
axis_origin (Sequence[float] | complex) – Mirror axis origin.
- Returns:
This object.
- Return type:
- properties¶
Object properties.
- Type:
- rotate(rotation, center=(0, 0))¶
Rotate this terminal.
- Parameters:
rotation (float) – Rotation angle around the center (in degrees).
center (Sequence[float] | complex) – Center of rotation.
- Returns:
This object.
- Return type:
- routing_layer¶
Terminal routing layer.
- Type:
tuple[int, int]
- scale(scaling, center=(0, 0))¶
Scale this terminal.
- Parameters:
scaling (float) – Magnification factor.
center (Sequence[float] | complex) – Center of scaling.
- Returns:
This object.
- Return type:
- size()¶
Calculate the terminal size.
- Returns:
The size of the bounding box of the terminal.
- Return type:
ndarray
- 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 (Sequence[float] | complex) – Translation vector.
rotation (float) – Rotation angle (in degrees).
scaling (float) – Magnification factor.
x_reflection (bool) – Mirror across the horizontal axis.
- Returns:
This object.
- Return type:
- translate(translation)¶
Translate this terminal.
- Parameters:
translation (Sequence[float] | complex) – Translation vector.
- Returns:
This object.
- Return type:
- x_max¶
Upper bound in the x axis.
- Type:
float
- x_mid¶
Bounding box center in the x axis.
- Type:
float
- x_min¶
Lower bound in the x axis.
- Type:
float
- y_max¶
Upper bound in the y axis.
- Type:
float
- y_mid¶
Bounding box center in the y axis.
- Type:
float
- y_min¶
Lower bound in the y axis.
- Type:
float