pyfeyn2.render.pyx.lines.Line

class pyfeyn2.render.pyx.lines.Line(point1, point2, styles=None, arcthrupoint=None, is3D=False, arrows=None, labels=None, **kwargs)[source]

Bases: Visible

Base class for all objects which connect points in Feynman diagrams

__init__(point1, point2, styles=None, arcthrupoint=None, is3D=False, arrows=None, labels=None, **kwargs)[source]

Constructor.

Methods

__init__(point1, point2[, styles, ...])

Constructor.

addArrow([position, arrow])

Add an arrow to the line at the specified position, which is a number between 0 and 1, representing the fraction along the line at which the arrow should be placed.

addLabel(text[, pos, displace, angle, size, ...])

Add a LaTeX label to this line, either via parameters or actually as a TeXLabel object.

addParallelArrow([pos, displace, length, ...])

Add an arrow pointing along the line.

addStyle(style)

Add a style to this line.

addStyles(stylelist)

Add some styles to this line.

arcThru([arcpoint, x, y])

Set the point through which this line will arc.

bend(amount)

Bend the line to the right by a given distance.

draw(canvas)

Draw this line on the given canvas.

fracpoint(frac)

Get a new Point representing the point at the given fraction along the fundamental line (i.e.

getDepth()

Return the depth at which this instance lives.

getPath()

Get the path taken by this line.

getStyles(stylelist)

Get the styles associated with this line.

getVisiblePath()

Find the subpath between the endpoints which isn't overshadowed by a blob of some kind

isVisible()

Check if this instance is visible.

removeArrows()

Remove all arrows from this line.

removeLabels()

Remove the labels from this line.

set3D(is3d)

Make this line display in '3D'.

setArrows(arrows)

Define the arrows on this line.

setDepth(depth)

Set the depth at which this instance lives.

setStyles(stylelist)

Set the styles associated with this line.

straighten()

Make this line a straight line between start and end.

addArrow(position=0.53, arrow=None)[source]

Add an arrow to the line at the specified position, which is a number between 0 and 1, representing the fraction along the line at which the arrow should be placed. The default arrow style can be overridden by explicitly supplying an arrow object as the ‘arrow’ argument, in which case the position argument will be ignored.

addLabel(text, pos=0.5, displace=-0.25, angle=0, size=<pyx.text.size object>, halign=<pyx.text.halign object>, valign=None, **kwargs)[source]

Add a LaTeX label to this line, either via parameters or actually as a TeXLabel object.

addParallelArrow(pos=0.5, displace=0.3, length=<pyx.unit.length object>, size=<pyx.unit.length object>, angle=45, constriction=0.8, sense=1, curved=False, stems=1, stemsep=0.03)[source]

Add an arrow pointing along the line.

addStyle(style)[source]

Add a style to this line.

addStyles(stylelist)[source]

Add some styles to this line.

arcThru(arcpoint=None, x=None, y=None)[source]

Set the point through which this line will arc. Either pass a Point or set x, y as floats.

bend(amount)[source]

Bend the line to the right by a given distance.

draw(canvas)[source]

Draw this line on the given canvas.

fracpoint(frac)[source]

Get a new Point representing the point at the given fraction along the fundamental line (i.e. no truncation or deformation). TODO: Handle units properly.

getDepth()

Return the depth at which this instance lives.

getPath()[source]

Get the path taken by this line.

getStyles(stylelist)[source]

Get the styles associated with this line.

getVisiblePath()[source]

Find the subpath between the endpoints which isn’t overshadowed by a blob of some kind

isVisible()

Check if this instance is visible.

removeArrows()[source]

Remove all arrows from this line.

removeLabels()[source]

Remove the labels from this line.

set3D(is3d)[source]

Make this line display in ‘3D’.

setArrows(arrows)[source]

Define the arrows on this line.

setDepth(depth)

Set the depth at which this instance lives.

setStyles(stylelist)[source]

Set the styles associated with this line.

straighten()[source]

Make this line a straight line between start and end.