Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtkThresholdPoints Implementation faulty? #110

Open
markus-ifg opened this issue Feb 14, 2024 · 5 comments
Open

vtkThresholdPoints Implementation faulty? #110

markus-ifg opened this issue Feb 14, 2024 · 5 comments

Comments

@markus-ifg
Copy link

Hi there,

I'm trying to us the "VTK To Blender Particles" node on a subset of points from a vtkPolyDataReader based on a property called "time".
The vtkThresholdPoints successfully filters values above the (somewhat misleading name) UpperThreshold, but apparently does not filter values below the "LowerThreshold" value. (See attached image)
Is this a bug or am I using it wrong?

grafik

@tkeskita
Copy link
Owner

Hi,
ObjectName I think only gives a name to the VTK object created by that class, it does not specify the thresholding field name. I haven't used vtkThresholdPoints, but I guess you might need to activate the field you intend to threshold with Custom Code command Assign like in this example.

The Info node shows the name of the point data field if you make it wider, is that "time"?

@markus-ifg
Copy link
Author

Yes, it is called "time". And the filter does seem to work (look at the second info box, the values of the point data array are now starting from 100), but it does seem to ignore the other threshold.
Maybe the problem is, that the vtkThresholdPoints can do three things (values above, values below and values in between) and the differentiation is not correct?

@tkeskita
Copy link
Owner

When doubting about the usage of VTK class, check the official documentation, here for vtkThresholdPoints. This is apparently one of the non-trivial VTK functions. Looking at the function list, I guess you have to call explicitly ThresholdBetween() (probably with min and max arguments) with Custom Code to get the between thresholding.

@markus-ifg
Copy link
Author

Thanks for the reply.
I will try to use it with Custom Code, although I'm never really sure how to use that properly.

Still (from a user perspective) I would think, that a threshold node with min and max value fields should be able to extract the values between those, shouldn't it? Otherwise, why have these inputs? If the underlying function has three modes (only above, only below and inbetween), maybe a corresponding dropdown selection could be introduced to disambiguate?

Thanks again for the help and your work on this great addon! :)

@tkeskita
Copy link
Owner

VTK has many unintuitive classes, and there is room for improvement. As BVTKNodes is downstream, the strategy with least cost is to accept VTK as it is, as there are not many active BVTKNodes developers currently. If you wish, you can also pursue changes in the upstream VTK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants