def test_output_lines(spline, with_scalars): pl = pyvista.Plotter() if with_scalars: pl.add_mesh(spline, scalars=range(spline.n_points), style='wireframe') else: pl.add_mesh(spline, style='wireframe') pv_pythreejs.convert_plotter(pl)
def test_output_point_scalars_rgba(sphere): colors = np.linspace(0, 255, sphere.n_points) rgba = np.vstack((colors, colors, colors)).T pl = pyvista.Plotter() pl.add_mesh(sphere, scalars=rgba, rgba=True) pv_pythreejs.convert_plotter(pl)
def test_export_after_show(): pl = pyvista.Plotter(shape=(2, 2)) # deleting rather than showing to save time del pl.ren_win with pytest.raises(AttributeError): pv_pythreejs.convert_plotter(pl)
def test_output_point_cloud(sphere): pl = pyvista.Plotter() pl.add_points(sphere.points, scalars=range(sphere.n_points)) pv_pythreejs.convert_plotter(pl) # points but no active point scalars pl = pyvista.Plotter() pl.add_points(sphere, scalars=range(sphere.n_cells)) pv_pythreejs.convert_plotter(pl)
def test_output_face_scalars(sphere): pl = pyvista.Plotter() pl.add_mesh(sphere, scalars=range(sphere.n_cells)) pv_pythreejs.convert_plotter(pl)
def test_non_standard_shape(): pl = pyvista.Plotter(shape='2|3') with pytest.raises(RuntimeError, match='Unsupported plotter shape'): pv_pythreejs.convert_plotter(pl)
def test_grid_layout(): pl = pyvista.Plotter(shape=(2, 2)) pv_pythreejs.convert_plotter(pl)
def test_add_axes(): pl = pyvista.Plotter() pl.add_axes() pv_pythreejs.convert_plotter(pl)
def test_not_polydata(hexbeam): pl = pyvista.Plotter() pl.add_mesh(hexbeam) pv_pythreejs.convert_plotter(pl)
def test_show_edges(sphere): pl = pyvista.Plotter() pl.add_mesh(sphere, show_edges=True) pv_pythreejs.convert_plotter(pl)
def test_no_lighting(sphere): pl = pyvista.Plotter() pl.add_mesh(sphere, lighting=False) pv_pythreejs.convert_plotter(pl)
def test_output_texture(globe): pl = pyvista.Plotter() pl.add_mesh(globe) pv_pythreejs.convert_plotter(pl)
def test_output_point_scalars(sphere): scalars = np.linspace(0, 255, sphere.n_points) pl = pyvista.Plotter() pl.add_mesh(sphere, scalars=scalars) pv_pythreejs.convert_plotter(pl)
def test_pbr(sphere): pl = pyvista.Plotter() pl.add_mesh(sphere, scalars=range(sphere.n_cells), pbr=True) pv_pythreejs.convert_plotter(pl)