I have a triangular mesh containing vertices that I would like to filter. I am able to filter based on the scalar values of the mean curvature, using vtkThreshold with Python3:
The nice thing about vtkThreshold is that it deletes all vertices and corresponding edges that do not meet the requirement. I would like to do a similar thing based on the normal vectors of the vertices. For example, remove a vertex if the x-value is higher than the y-value of the normal vector.
You can use vtkArrayCalculator to perform various scalar and vector operations on point data and store results in a new array that you can use for thresholding.
What is your end goal with this? Would you like to extract “one side” of a surface? There are much better methods for this than filtering based on normal vector direction.
It would be useful if you could give a context of your question (what is your application area, problem you want to solve, approach that you are implementing), and not just write about the very specific technical issue.
I obtain the last image by adding the coordinates of every vertex that satisfies the condition for the normal vector to a vtkVertexGlyphFilter. However, I would like to maintain/include the corresponding edges between the vertices. In this way, I would be able to cluster the vertices that are connected to each other.
Hi Andras, the objective of the post you referred to is different from what I am trying to accomplish for this experiment.
As you suggested, I now added an additional array to the polydata which has 1 for every index/vertex that should be considered and a 0 otherwise. If I visualize it with Paraview it looks like this:
This is exactly what I want. However, Paraview’s threshold filter allows specifying the scalar array to which the threshold should be applied. I cannot find this in vtk, so I was wondering if you’d know how to specify the array for the threshold filter in vtk (python3)?