Reference
T_Instance
Reference
Reference object. Do not subscript this class, use inferred generic types.
Source code in gdsr/_gdsr.pyi
__init__
__init__(instance: T_Instance, grid: Grid = Grid()) -> None
Initialize the Reference with an instance and a grid.
Parameters:
-
instance
(Instance
) –The instance to reference.
-
grid
(Grid
, default:Grid()
) –The grid to reference the cell.
copy
move_to
move_to(point: PointLike) -> Self
Move the reference to a point.
This method modifies the reference in place and returns itself.
Parameters:
-
point
(PointLike
) –Point to move the reference to.
move_by
move_by(vector: PointLike) -> Self
Move the reference by a vector.
This method modifies the reference in place and returns itself.
Parameters:
-
vector
(PointLike
) –Vector to move the reference by.
rotate
rotate(angle: float, centre: PointLike = Point(0, 0)) -> Self
Rotate the reference by an angle around a centre point.
This method modifies the reference in place and returns itself.
Parameters:
-
angle
(float
) –Counter-clockwise rotation angle in degrees.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of rotation, defaults to (0, 0).
Source code in gdsr/_gdsr.pyi
scale
scale(factor: float, centre: PointLike = Point(0, 0)) -> Self
Scale the reference by a factor around a centre point.
This method modifies the reference in place and returns itself.
Parameters:
-
factor
(float
) –Scaling factor.
-
centre
(PointLike
, default:Point(0, 0)
) –Centre point of scaling, defaults to (0, 0).
Source code in gdsr/_gdsr.pyi
flatten
flatten(*layer_data_types: LayerDataType, depth: int | None = None) -> list[Element]
Return a list of the elements in the reference.
When depth is None, the reference is flattened to the deepest level.
Parameters:
-
layer_data_types
(LayerDataType
, default:()
) –the layer, data_type pairs to flatten on
-
depth
(int
, default:None
) –Depth of the flattening, defaults to None.
Source code in gdsr/_gdsr.pyi
is_on
is_on(*layer_data_types: LayerDataType) -> bool