pyvista.Text3D

目次

pyvista.Text3D#

Text3D(
string: str,
depth: float | None = None,
width: float | None = None,
height: float | None = None,
center: VectorLike[float] = (0.0, 0.0, 0.0),
normal: VectorLike[float] = (0.0, 0.0, 1.0),
) PolyData[ソース]#

文字列から3 Dテキストを作成します.

テキストは,指定された幅,高さ,または深さを持つように構成することができます.

パラメータ:
stringstr

String to generate 3D text from. If None or an empty string, the output mesh will have a single point at center.

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.

バージョン 0.43 で変更: デフォルトの深さは,高さの半分として動的に計算されるようになりました.以前は,デフォルトの深さは 0.5 という固定値でした.

widthfloat, optional

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

Added in version 0.43.

heightfloat, optional

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

Added in version 0.43.

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

テキストの中心.テキストの軸合わせされたバウンディングボックスの中央として定義されます.

Added in version 0.43.

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.

Added in version 0.43.

戻り値:
pyvista.PolyData

3Dテキストメッシュ.

>>> import pyvista as pv
>>> text_mesh = pv.Text3D('PyVista')
>>> text_mesh.plot(cpos='xy')
../../../_images/pyvista-Text3D-1_00_00.png