pyvista_wasm.Line#
- pyvista_wasm.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 ofresolution + 1evenly spaced points frompointatopointb.- Parameters:
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 + 1points). Default is 1.
- Returns:
A line mesh.
- Return type:
- Raises:
ValueError – If
resolutionis less than 1.
Examples
>>> import pyvista_wasm as pv >>> line = pv.Line(pointa=(0, 0, 0), pointb=(1, 0, 0), resolution=1) >>> line.n_points 2
>>> line.plot(color="black")