Hello! I am currently trying to display vtkPolydata object in a dash_vtk.view. I tried to set the property of the geometric representation object containing the polydata to Phong so that the shading is smoother. However the resulting mesh is still using flat shading. I learned that phong/gouraud shading require vector normals, and I was able to compute the normals of the polydata with a vtkPolyDataNormals object, but I am unsure how to provide the normals to dash_vtk’s renderer. I tried two ways of stting up the polydata, one using dash_vtk.polydata and one using dash_vtk.mesh, but both didn’t work. I tested out phong shading with a vtkSphereSource using dash_vtk.algorithm and it worked fine, so what might I be missing? Any help is much appreciated!
dash_vtk.View(
pickingModes=["click", "hover"],
id="vtk_view",
children=[
dash_vtk.GeometryRepresentation(
id="model",
children=[
dash_vtk.PolyData(
id="polydata",
points=datapoints, #datapoints and faces are the points and polys of the vtkPolyData object
polys=face,
)
# dash_vtk.Mesh(
# id="polydata",
# state=to_mesh_state(polydata),
# )
],
property={"interpolation" : "Phong", "backfaceCulling": True, "color": (1, 1, 1)},
),]