Jump to content
noc2

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×