pyvista.Text3DSource#

class Text3DSource(
string=None,
depth=None,
width=None,
height=None,
center=(0, 0, 0),
normal=(0, 0, 1),
process_empty_string=True,
)[source]#

3D text from a string.

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

Added in version 0.43.

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], default: (0.0, 0.0, 0.0)

Center of the text, defined as the middle of the axis-aligned bounding box of the text.

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.

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.

Methods

Text3DSource.update()

Update the output of the source.

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.