Jump to content

Clustering points based on neighbours attributes and conditions using VEX


Recommended Posts

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@dirI 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? :(

 

query.jpg

 

 

clusterbyattribute.hip

Edited by mois23
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...