TXLWizard.ShapeLibrary.LabelArray¶
Renders an array of arbitrary text in TXLWriter.
Functions¶
GetLabelArray (TXLWriter, Text, OriginPoint, ...) |
Renders an array of arbitrary text. |
-
TXLWizard.ShapeLibrary.LabelArray.
GetLabelArray
(TXLWriter, Text, OriginPoint, PositionDelta1, PositionDelta2, Repetitions1, Repetitions2, FontSize=100, StrokeWidth=10, RotationAngle=0, FillCharacters=True, RoundCaps=False, Layer=1, **kwargs)[source]¶ Renders an array of arbitrary text. Will have an automatically generated ID. The markers {i} and {j} in the text are substituted with an auto-incremented index starting at 1.
Parameters: - TXLWriter (
TXLWizard.TXLWriter.TXLWriter
) – Current Instance ofTXLWizard.TXLWriter.TXLWriter
- Text (str) – Text to be displayed
- OriginPoint (list of float) – x- and y-coordinates of the origin point of the label array.
- PositionDelta1 (list of float) – x- and y- coordinates of the first replication direction.
- PositionDelta2 (list of float) – x- and y- coordinates of the second replication direction.
- Repetitions1 (int) – Number of replications in the first replication direction
- Repetitions2 (int) – Number of replications in the second replication direction
- FontSize (float, optional) –
Font size. Character height = font size.
Defaults to 100
- StrokeWidth (float, optional) –
line thickness of the letters.
Defaults to 10
- RotationAngle (float, optional) –
Angle by which the text is rotated.
Defaults to 0
- FillCharacters (bool, optional) –
If set to True, closed boundaries will be filled. Can be useful if there should be no free-standing parts.
Defaults to True
- RoundCaps (bool, optional) –
If set to True, the paths will habe rounded ends. Should be set to False for better e-Beam Performance.
Defaults to False.
- Layer (int, optional) –
Layer the text should be rendered in.
Defaults to 1
- **kwargs – keyword arguments
Returns: Structure object containing the patterns representing the text
Return type: Examples
Import required modules
>>> import TXLWizard.TXLWriter >>> import TXLWizard.ShapeLibrary.LabelArray
Initialize TXLWriter
>>> TXLWriter = TXLWizard.TXLWriter.TXLWriter()
Add a label array
>>> SampleLabelObject = TXLWizard.ShapeLibrary.LabelArray.GetLabelArray( ... TXLWriter, ... Text='ObjectA_A{i}B{j}', ... OriginPoint=[ ... -200, 300 ... ], ... PositionDelta1=[ ... 500, 0 ... ], ... PositionDelta2=[ ... 0, 100 ... ], ... Repetitions1=3, ... Repetitions2=5, ... FontSize=20, ... StrokeWidth=4, ... RoundCaps=True, # Set to False to improve e-Beam performance ... Layer=1 ... )
Generate Files
>>> TXLWriter.GenerateFiles('Tests/Results/ShapeLibrary/LabelArray')
- TXLWriter (