project_points_to_plane

PolyDataFilters.project_points_to_plane(origin=None, normal=(0, 0, 1), inplace=False)

Project points of this mesh to a plane.

Parameters
originnumpy.ndarray or collections.abc.Sequence, optional

Plane origin. Defaults to the approximate center of the input mesh minus half the length of the input mesh in the direction of the normal.

normalnumpy.ndarray or collections.abc.Sequence, optional

Plane normal. Defaults to +Z, i.e. [0, 0, 1].

inplacebool, optional

Whether to overwrite the original mesh with the projected points.

Returns
pyvista.PolyData

The points of this mesh projected onto a plane.

Examples

Flatten a sphere to the XY plane.

>>> import pyvista as pv
>>> sphere = pv.Sphere()
>>> projected = sphere.project_points_to_plane()
>>> projected.plot(show_edges=True, line_width=3)
../../../_images/pyvista-PolyDataFilters-project_points_to_plane-1_00_00.png