mois23 Posted 11 hours ago Share Posted 11 hours ago (edited) Hey everyone I'm stuck on a really simple problem that I can't seem to figure out how to solve. I have a group of points, each of which has a float speed and a direction: f@speed and v@dir. I would like Houdini to identify i@clusters based on the direction orientation and the speed value. Basically I want to iterate the code over all the points: if the angle formed by the dir vectors is less than a certain threshold, the code also checks the speed value. If the speed difference is also less than a certain threshold then those points are part of the same cluster (see attached image). I tried a code, where at each iteration I identify the neighboring points and if they are found then it removes them from the iteration queue to avoid infinite loops. But the clustering does not work, when I change the value of speed threshold and angle threshold I get no change. This only happens if I change search radius. Am I missing something? clusterbyattribute.hip Edited 10 hours ago by mois23 Quote Link to comment Share on other sites More sharing options...
mois23 Posted 10 hours ago Author Share Posted 10 hours ago I reviewed the code and I think I made some mistakes. The second condition, the speed difference check, I put it after the angle difference condition is verified. It works better now. What do you think? clusterbyattribute2_fix.hip 1 Quote Link to comment Share on other sites More sharing options...
Librarian Posted 9 hours ago Share Posted 9 hours ago @mois23 Try this maybe you can get some idea's. https://scikit-learn.org/dev/modules/generated/sklearn.cluster.AgglomerativeClustering.html + files https://github.com/Fe-Elf/FeELib-for-Houdini Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.