Label
Label( text='', origin=(0, 0), anchor='NW', rotation=0, scaling=1, x_reflection=False,)Text label.
Args
- text (str): Label text.
- origin (Sequence[float] | complex): Label position.
- anchor (Literal[“NW”, “N”, “NE”, “W”, “O”, “E”, “SW”, “S”, “SE”]): Anchor point for text alignment.
- rotation (float): Rotation (in degrees) of this label.
- scaling (float): Label scaling factor.
- x_reflection (bool): Flag controlling mirroring across the x axis.
Methods
Section titled “Methods”| Method | Description |
|---|---|
add_gds_property | Add a custom property to this object compatible with GDSII files. |
copy | Create a copy of this label. |
mirror | Mirror this label. |
rotate | Rotate this label around a specific center. |
scale | Scale this label. |
transform | Apply a transformation to this label: |
translate | Translate this label. |
add_gds_property
Section titled “add_gds_property”add_gds_property(attribute, value)Add a custom property to this object compatible with GDSII files.
Args
- attribute (int): Property number.
- value (str): Property value.
copy(self)Create a copy of this label.
Returns
Label: New copy.
mirror
Section titled “mirror”mirror(self, axis_endpoint=(1, 0), axis_origin=(0, 0))Mirror this label.
Args
- axis_endpoint (Sequence[float] | complex): Mirror axis endpoint.
- axis_origin (Sequence[float] | complex): Mirror axis origin.
Returns
Label: This label.
rotate
Section titled “rotate”rotate(self, rotation, center=(0, 0))Rotate this label around a specific center.
Args
- rotation (float): Rotation angle in degrees.
- center (Sequence[float] | complex): Center of rotation.
Returns
Label: This label.
scale(self, scaling, center=(0, 0))Scale this label.
Args
- scaling (float): Scaling factor.
- center (Sequence[float] | complex): Center of scaling.
Returns
Label: This label.
transform
Section titled “transform”transform( self, translation=(0, 0), rotation=0, scaling=1, x_reflection=False)Apply a transformation to this label:
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
Label: This label.
translate
Section titled “translate”translate(self, translation)Translate this label.
Args
- translation (Sequence[float]): Translation vector.
Returns
Label: This label.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
anchor | Literal[‘NW’, ‘N’, ‘NE’, ‘W’, ‘O’, ‘E’, ‘SW’, ‘S’, ‘SE’]: Label anchor. |
origin | ndarray: Label origin. |
properties | Properties: Object properties. |
rotation | float: Label rotation. |
scaling | float: Label scaling. |
text | str: Label text. |
x_reflection | Label x_reflection. |
anchor
Section titled “anchor”Literal[‘NW’, ‘N’, ‘NE’, ‘W’, ‘O’, ‘E’, ‘SW’, ‘S’, ‘SE’]: Label anchor.
origin
Section titled “origin”ndarray: Label origin.
properties
Section titled “properties”Properties: Object properties.
rotation
Section titled “rotation”float: Label rotation.
scaling
Section titled “scaling”float: Label scaling.
str: Label text.
x_reflection
Section titled “x_reflection”Label x_reflection.