pyvista.Triangle#
- Triangle(points: MatrixLike[float] | None = None) PolyData [source]#
Create a triangle defined by 3 points.
- Parameters:
- pointsarray_like[
float
],optional
Points of the triangle. Defaults to a right isosceles triangle (see example).
- pointsarray_like[
- Returns:
pyvista.PolyData
Triangle mesh.
Examples
>>> import pyvista as pv >>> pointa = [0, 0, 0] >>> pointb = [1, 0, 0] >>> pointc = [0.5, 0.707, 0] >>> triangle = pv.Triangle([pointa, pointb, pointc]) >>> triangle.plot(show_edges=True, line_width=5)