We have a website using VTK.js that calls VTK-python functions in the backend. The problem is that both versions of VTK read STLs in a different way. VTK-python will merge vertices of the STL (good), and VTK.js will keep a copy of each vertex per triangle.
I tried to make python behave like js by calling MergingOff(); but this causes the script to quit without warning.
import vtk stlReader = vtk.vtkSTLReader() stlReader.SetFileName("mesh.stl") stlReader.MergingOff() # gives a silent crash stlReader.Update() polyData = stlReader.GetOutput() pdd = vtk.vtkImplicitPolyDataDistance() pdd.SetInput(polyData) print("test") # won't reach this statement
I tested with multiple STLs.
Any idea why it crashes like this? Is there a way I could merge vertices in VTK.js?