anicg 12 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 Share this post Link to post Share on other sites
konstantin magnus 1,163 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 Share this post Link to post Share on other sites
vinyvince 117 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? Share this post Link to post Share on other sites
konstantin magnus 1,163 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 Share this post Link to post Share on other sites
vinyvince 117 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 Share this post Link to post Share on other sites
konstantin magnus 1,163 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 Share this post Link to post Share on other sites
animatrix 287 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. Share this post Link to post Share on other sites