Jump to content

Best match to align polygon with the x axis


AntoineSfx

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.

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...