Hello,
I’m trying to plot the outline of a 2d geometry in matplotlib using the point data from a feature edges filter. In ParaView, when I save the Feature Edge filter data as a vtk legacy file, it outputs a polydata dataset with the POINTS, LINES, OFFSETS, CONNECTIVITY, etc. In pvpython I can get all the point data from the feature edge filter by doing the following:
fetchData = servermanager.Fetch(featureEdges1)
edgePoints = npvtk.vtk_to_numpy(fetchData.GetPoints().GetData())
If I try to plot those points with connected lines in matplotlib, I get a filled in shape because the connectivity information is lost and the points are distributed roughly from y-min to y-max. I need the connectivity array to reproduce the outline that I see in the ParaView render view.
How do I get the CONNECTIVITY array that I see in the vtk legacy output file? I tried
fetchData.GetPolys().GetConnectivityArray()
but that returns an empty array. In fact fetchData.GetNumberOfPolys() returns zero, so that doesn’t seem to be the right path. Are there other functions that I’m missing? Is this possible without taking the indirect route of saving the file and then reading from the file?
Thank you!