Jump to content
AntoineSfx

Best match to align polygon with the x axis

Recommended Posts

I 'm using Houdini for actual woodworking, i.e I have a furniture that I split into primitives, and those primitives are meant to be used as inputs for UVLayout, using my available stock in input 2 as islands.

 

Now I would like to limit UVLayout to 90 degrees rotations (because wood grain, patterns in the stock, and so on), and align each primitive in the input 1 along their principal direction.

I defined principal direction like this: each segment votes with its angle, and its vote count is multiplied by its length. The winner is the angle with most votes. This should give 135 degrees in this example:

 

polygon.thumb.png.ce7f09e0d33b264f117d2dcca879467e.png

I can't find a hash table in VEX. What data structure is available in VEX to do that, or what other solution is available ? I feel like this is something that can be solved with attribute promotion or some abused Fuse but I can't figure it out.

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

×