anicg Posted March 7, 2019 Share Posted March 7, 2019 I'm running a for-each-connected loop, and need to rotate separate shape such that the largest face is down, for example the one marked L is the largest for the shape in the image. I have a theoretical idea, no clue how to implement it, and not sure if there is a faster or simpler way: (1) get the largest face (no idea how) (2) rotate till the normal of the largest face is facing down Again it's too theoretical, but if you have a way that would turn these flat on they largest face I'll be grateful Quote Link to comment Share on other sites More sharing options...
toadstorm Posted March 7, 2019 Share Posted March 7, 2019 This isn't too bad. What you want to do is, for each piece: measure the area of all primitives find the largest primitive (sort by area) compute the primitive normal use dihedral() to compute the matrix that rotates that primitive normal to face {0,-1,0} multiply all points in the piece by that matrix I'm attaching an example file. point_pieces_down_toadstorm.hip 1 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.