# Create 3D Text
# ==============

# Generate extruded text geometry with `pyvista.Text3D()`.
import pyvista as pv

# Create an extruded text mesh
# ============================

# The text is standard PolyData and can be transformed and plotted like any
# other surface.
text = pv.Text3D('PyVista', depth=0.3)
text

# Compare flat and extruded text
# ==============================

# `depth=0` produces flat glyphs; a positive depth extrudes them into 3D.
flat = pv.Text3D('PyVista', depth=0)
extruded = pv.Text3D('PyVista', depth=0.4)

pl = pv.Plotter(shape=(1, 2))
pl.subplot(0, 0)
pl.add_mesh(flat, color='royalblue')
pl.view_xy()
pl.subplot(0, 1)
pl.add_mesh(extruded, color='royalblue')
pl.view_xy()
pl.camera.azimuth = -25
pl.camera.elevation = 20
pl.camera.zoom(0.85)
pl.show()

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

