Jump to content
anicg

Orient object procedurally (make it stand) based on its longest side

Recommended Posts

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

from.JPG

to.JPG

Share this post


Link to post
Share on other sites

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?

 

image.thumb.png.2561c309e2b625b7ae487233ffaf5e95.png

Share this post


Link to post
Share on other sites

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

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

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

×