Jump to content

Detecting Edge Points through Vex


Recommended Posts

Hi;

I've been desperately meddling with edges which are (somewhat reasonably) not implicitly recognized as geometry components in Houdini.

My aim is to detect the edges of a given geometry (open or closed) through their respective start and end points, which would then make it possible to create a vector between those to points, and after having created an up-vector, I wish to be able to align objects along all the edges of that very object.

I've so far come as far as being able to get the edge count through Vex making use of half-edges, but am lost as to how I can be able to achieve the aforementioned goal effectively.

I want to end up with a set of vectors driven from the points of the detected edges like:

Edge 01: v(point0-point2)
Edge 02: v(point0-point4)
Edge 03: v(point3-point7)

And help would be wildly appreciated.

Cheers;

AJ

Link to comment
Share on other sites

3 hours ago, tamagochy said:

Try group unshared edge -> isolate them -> sort pts - > then use foreach to get edge vectors

Thank you your reply. But I couldn't really comprehend what you meant by the procedure you recommended. Could you elaborate a little?

cheers;

AJ

Link to comment
Share on other sites

calculating the edge vector is not a problem but you can't store it on edges since houdini doesn't support edges as regular geometry elements. what you could do instead is to use convertLine and do all the computations on prims which you could then lookup by points from the actual mesh. or you could just write all the edge vectors into a detail array. please take a look at the attached file.

hth. petz

edge_vec.hipnc

  • Like 2
Link to comment
Share on other sites

21 minutes ago, petz said:

calculating the edge vector is not a problem but you can't store it on edges since houdini doesn't support edges as regular geometry elements. what you could do instead is to use convertLine and do all the computations on prims which you could then lookup by points from the actual mesh. or you could just write all the edge vectors into a detail array. please take a look at the attached file.

hth. petz

edge_vec.hipnc

Awesome! Thank you so much for your help, that really helped. I guess this is a whole lot better than trying to detect every edge's points through hedge functions. At least for a noob like myself :) I must say, that I especially liked what you came up with in the second Attrib Wrangle where you made use of expandededgegroup. I will definitely study this. Thank you so much once again petz, for taking the time to help me out and especially for the example scene. 

Cheers;

AJ

Edited by noc2
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...