TXLWizard.Patterns.Ellipse

Implements a class for Pattern objects of type Ellipse (ELP).

Renders an ellipse.

Classes

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

Bases: TXLWizard.Patterns.AbstractPattern.AbstractPattern

Implements a class for Pattern objects of type Ellipse.

Corresponds to the TXL command ELP.

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

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

If PathOnly is set to True, only the arc of the ellipse is shown.

Parameters:
  • Center (list of float) – x- and y-coordinates specifying the center of the ellipse
  • RadiusX (float) – Semi-major axis of the ellipse in x-direction
  • RadiusY (float) – Semi-minor axis of the ellipse in y-direction
  • StartAngle (float, optional) –

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

    Defaults to 0

  • EndAngle (float, optional) –

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

    Defaults to 0

  • NumberOfPoints (int, optional) –

    Number of path segments used for drawing the ellipse.

    Defaults to None.

  • **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 ellipse and add Pattern of type Ellipse

>>> EllipseStructure = TXLWriter.AddContentStructure('MyEllipseID')
>>> EllipseStructure.AddPattern(
...     'Ellipse',
...     Center=[0, 0],
...     RadiusX=50,
...     RadiusY=70,
...     Layer=1
... ) 
<TXLWizard.Patterns.Ellipse.Ellipse object at 0x...>

Generate Files

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

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

EndAngle = None

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

EndPoint = None

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

NumberOfPoints = None

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

RadiusX = None

float – Semi-major axis of the ellipse in x-direction

RadiusY = None

float – Semi-minor axis of the ellipse in y-direction

StartAngle = None

float – If given, only a sector is drawn from StartAngle to 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 ‘Ellipse’