TXLWizard.Patterns.Circle

Implements a class for Pattern objects of type Circle (C).

Renders a circle.

Classes

Circle(Center, Radius, **kwargs) Implements a class for Pattern objects of type Circle.
class TXLWizard.Patterns.Circle.Circle(Center, Radius, **kwargs)[source]

Bases: TXLWizard.Patterns.AbstractPattern.AbstractPattern

Implements a class for Pattern objects of type Circle.

Corresponds to the TXL command C (CP if PathOnly is specified, CPR if RoundCaps and CPE if Extended).

Renders a circle.

Optionally, only a sector is shown when specifying StartAngle and EndAngle.

If NumberOfPoints is given, the number of path segments defining the circle can be specified.

If PathOnly is set to True, only the arc of the circle is shown. Optionally, the ends of the path are rounded by specifying RoundCaps or extended by specifying Extended along with PathOnly.

Parameters:
  • Center (list of float) – x- and y-coordinates specifying the center of the circle
  • Radius (float) – Radius of the circle
  • StartAngle (float, optional) –

    If given, only a sector is drawn from StartAngle to EndAngle.

    Defaults to None.

  • EndAngle (float, optional) –

    If given, only a sector is drawn from StartAngle to EndAngle.

    Defaults to None.

  • NumberOfPoints (int, optional) –

    Number of path segments used for drawing the circle.

    Defaults to None.

  • PathOnly (bool, optional) –

    If set to True, only the arc of the circle is drawn.

    Defaults to False.

  • RoundCaps (bool, optional) –

    If set to True along with PathOnly, the end of the path is rounded.

    Defaults to False.

  • Extended (bool, optional) –

    If set to True along with PathOnly, the end of the path is extended.

    Defaults to False.

  • **kwargs – keyword arguments passed to the TXLWizard.Patterns.AbstractPattern.AbstractPattern constructor. Can specify attributes of the current pattern.

Examples

Import required modules

>>> import TXLWizard.TXLWriter

Initialize TXLWriter

>>> TXLWriter = TXLWizard.TXLWriter.TXLWriter()

Create Content Structure for Circle and add Pattern of type Circle

>>> CircleStructure = TXLWriter.AddContentStructure('MyCircleID')
>>> CircleStructure.AddPattern(
...     'Circle',
...     Center=[0, 0],
...     Radius=50,
...     Layer=1
... ) 
<TXLWizard.Patterns.Circle.Circle object at 0x...>

Generate Files

>>> TXLWriter.GenerateFiles('Tests/Results/Patterns/Circle')
Center = None

list of float – x- and y-coordinates specifying the center of the circle

EndAngle = None

float – If set, only a sector is drawn from self.StartAngle to self.EndAngle.

EndPoint = None

list of float – If self.StartAngle and self.EndAngle are set, the ending point of the segment arc is calculated

Extended = None

bool – If set to True along with PathOnly, the end of the path is extended

NumberOfPoints = None

int – Number of path segments used for drawing the circle.

PathOnly = None

bool – If set to True, only the arc of the circle is drawn.

Radius = None

float – Radius of the circle

RoundCaps = None

bool – If set to True along with PathOnly, the end of the path is rounded

StartAngle = None

float – If set, only a sector is drawn from self.StartAngle to self.EndAngle.

StartPoint = None

list of float – If self.StartAngle and self.EndAngle are set, the starting point of the segment arc is calculated

Type = None

str – specifies the type of the pattern. Set to ‘Circle’