anicg Posted December 12, 2021 Share Posted December 12, 2021 I have attached a bgeo file. I have an object that needs to be oriented (procedurally) depending on its longest side, from which ever random orientation it has to standing straight in the Y axis with the longest side (see images from to). Any idea? orient_standing.bgeo Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 12, 2021 Share Posted December 12, 2021 (edited) You could apply the transformation matrix of the oriented bounding box. oriented_bounding_box.hiplc Edited December 12, 2021 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
vinyvince Posted December 12, 2021 Share Posted December 12, 2021 Im afraid, the sidefx orient bounding box is easy to fail, just a simple transform and it doesn't line the obj properly in Y I would useg eigen vectors for this . A more simple way will be to use labs did straighten sop were you have to select groups for orientation. or maybe you could measure the longest edge and use the rotation different with the Y axis to align with some matrix maths? Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 12, 2021 Share Posted December 12, 2021 Longest edge would work for this piece. @vinyvince Do you have an example file using eigenvectors? rotate_to_longest_edge.hiplc Quote Link to comment Share on other sites More sharing options...
vinyvince Posted December 13, 2021 Share Posted December 13, 2021 You such a gentleman @konstantin magnus, and i learn so much from you off course! i can't refuse you anything, excepted maybe to kiss my girlfriend i will send you one personal tool i have done Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 17, 2021 Share Posted December 17, 2021 Here is a Houdini-related article on orienting a mesh using covariance and eigenvalues: https://jakerice.design/2018/09/19/Covariance-and-Principal-Component-Analysis/ eigenvalues.hiplc Quote Link to comment Share on other sites More sharing options...
animatrix Posted December 18, 2021 Share Posted December 18, 2021 There are many ways to do this sort of thing, but one thing I would recommend is using the convex hull geo to compute it for speed. In this case it already looks convex but I am talking in an HDA sense. Also there are many assumptions and shortcuts one can take. For example to compute an MVB (Minimum Volume Box), at least of the faces in the convex hull will touch one of the faces on its MVB. Then there is brute force methods searching on all faces, vs other clever ways but sometimes brute force is actually faster. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.