Hi, I have a structured grid whose cells have a property ‘Pressure’ which I have converted to polydata and am building an app for interacting with. One goal is for the user of my app to be able to interact with a slider that is mapped to the range of the Pressure data to threshold (not display) polygons that are below that threshold. Here is the general setup:
let vtpReader = vtkXMLPolyDataReader.newInstance(); vtpReader.parseAsArrayBuffer(file);
const source = vtpReader.getOutputData(0);
const data = source.getCellData().getArrayByName(‘Pressure’); //This is the data I want to threshold
I am struggling to decide how the best way to go about this. My intuition would be to use vtkCalculator to create a derived dataset which only contains polygons above the given Pressure threshold. But I am a little lost as to how this would be implemented. My other idea would be to loop through the data and manually define new polydata, which seems a bit excessive.
Does anyone have suggestions on the best way to approach this? I am relatively new to VTK so any advice is appreciated.