Manually Create PolyData in vtk.js

Instead of converting a JSON to an empty polydata, it might be easier to just do:

var polyData = vtk.Common.DataModel.vtkPolyData.newInstance()

Then I’m not sure why you are using vtkAppendPolyData as you just need to keep adding to your points and cells…

But the piece that is actually missing from your code, is the “cell size”. The layout of the array that compose the cellArray is [nbPoints, pIdx0, pIdx1, …, nbPoints, pIdx0, pIdx1, …]