Label

class photonforge.Label(text='', origin=(0, 0), anchor='NW', rotation=0, scaling=1, x_reflection=False)

Text label.

Parameters:
  • text – Label text.

  • origin – Translation vector for this label.

  • anchor – Anchor point for text alignment.

  • rotation – Rotation (in degrees) of this label.

  • scaling – Label scaling factor.

  • x_reflection – Flag controlling mirroring across the x axis.

Methods

copy()

Create a copy of this label.

mirror([axis_endpoint, axis_origin])

Mirror this label.

rotate(rotation[, center])

Rotate this label around a specific center.

scale(scaling[, center])

Scale this label.

transform([translation, rotation, scaling, ...])

Apply a transformation to this label: self = translate(rotate(mirror(scale(self))))

translate(translation)

Translate this label.

Attributes

anchor

Label anchor.

origin

Label origin.

rotation

Label rotation.

scaling

Label scaling.

text

Label text.

x_reflection

Label x_reflection.

anchor

Label anchor.

copy()

Create a copy of this label.

Returns:

New copy.

mirror(axis_endpoint=(1, 0), axis_origin=(0, 0))

Mirror this label.

Parameters:
  • axis_endpoint – Mirror axis endpoint.

  • axis_origin – Mirror axis origin.

Returns:

This label.

origin

Label origin.

rotate(rotation, center=(0, 0))

Rotate this label around a specific center.

Parameters:
  • rotation – Rotation angle in degrees.

  • center – Center of rotation.

Returns:

This label.

rotation

Label rotation.

scale(scaling, center=(0, 0))

Scale this label.

Parameters:
  • scaling – Scaling factor.

  • center – Center of scaling.

Returns:

This label.

scaling

Label scaling.

text

Label text.

transform(translation=(0, 0), rotation=0, scaling=1, x_reflection=False)

Apply a transformation to this label: self = translate(rotate(mirror(scale(self))))

Parameters:
  • translation – Translation vector.

  • rotation – Rotation angle in degrees.

  • scaling – Magnification factor.

  • x_reflection – Mirror across the horizontal axis.

Returns:

This label.

translate(translation)

Translate this label.

Parameters:

translation – Translation vector.

Returns:

This label.

x_reflection

Label x_reflection.