Text3DSource

Text3DSource#

class Text3DSource(*args, **kwargs)[source]#

3D text from a string.

Generate 3D text from a string with a specified width, height, or depth.

Added in version 0.43.

Changed in version 0.48: This class no longer inherits from vtkVectorText, and uses composition instead.

Parameters:
stringstr, default: “”

Text string of the source.

depthfloat, optional

Depth of the text. If None, the depth is set to half the height by default. Set to 0.0 for planar text.

widthfloat, optional

Width of the text. If None, the width is scaled proportional to height.

heightfloat, optional

Height of the text. If None, the height is scaled proportional to width.

centerSequence[float] | None, default: (0.0, 0.0, 0.0)

Center of the text, defined as the middle of the axis-aligned bounding box of the text. If None, the text is not centered: its baseline starts at the origin and its back face lies in the plane through the origin perpendicular to normal.

Changed in version 0.50: Allow None to keep the text at its origin.

normalSequence[float], default: (0.0, 0.0, 1.0)

Normal direction of the text. The direction is parallel to the depth of the text and points away from the front surface of the text. A normal alone does not uniquely specify the text’s rotation about that direction. See pyvista.Text3D() for an example using an explicit transform to control the full orientation.

process_empty_stringbool, default: True

If True, when string is empty the output is a single point located at center instead of an empty mesh. See process_empty_string for details.

See Also#

pyvista.Text3D

Create a text mesh, with examples of explicit orientation.

Attributes#

Text3DSource.center

Return or set the center of the text.

Text3DSource.depth

Return or set the depth of the text.

Text3DSource.height

Return or set the height of the text.

Text3DSource.normal

Return or set the normal direction of the text.

Text3DSource.output

Get the output of the source.

Text3DSource.process_empty_string

Return or set flag to control behavior when empty strings are set.

Text3DSource.string

Return or set the text string.

Text3DSource.width

Return or set the width of the text.

Methods#

Text3DSource.update()

Update the output of the source.