pyvista_js.Line

目次

pyvista_js.Line#

pyvista_js.Line(pointa: tuple[float, float, float] = (0.0, 0.0, 0.0), pointb: tuple[float, float, float] = (1.0, 0.0, 0.0), resolution: int = 1) PolyData#

Create a line segment between two points.

This mirrors the pyvista.Line() API, producing a polyline of resolution + 1 evenly spaced points from pointa to pointb.

パラメータ:
  • pointa (tuple, optional) -- Start point of the line (x, y, z). Default is (0, 0, 0).

  • pointb (tuple, optional) -- End point of the line (x, y, z). Default is (1, 0, 0).

  • resolution (int, optional) -- Number of line segments (i.e. resolution + 1 points). Default is 1.

戻り値:

A line mesh.

戻り値の型:

PolyData

例外:

ValueError -- If resolution is less than 1.

サンプル

>>> import pyvista_js as pv
>>> line = pv.Line(pointa=(0, 0, 0), pointb=(1, 0, 0), resolution=1)
>>> line.n_points
2
>>> line.plot(color="black")