import pandas as pd
import pyvista as pv
import numpy as np

df = pd.read_csv("../data/spatial_grid.csv")

t0 = 8
df = df[df["time"] == t0].copy()

points = df[["x", "y", "z"]].to_numpy()

cloud = pv.PolyData(points)
cloud["temperature"] = df["temperature"].to_numpy()

clipped = cloud.clip(
    normal="y",
    origin=(0, 0, 0),
    invert=False
)
plotter = pv.Plotter()

plotter.add_mesh(
    clipped,
    scalars="temperature",
    cmap="jet",
    point_size=14,
    render_points_as_spheres=True,
    show_scalar_bar=True
)

plotter.add_axes()
plotter.show_grid()
plotter.show()
