Help with finding the axes of symmetry of tilted object

Hello,
I am new to this forum so I hope I am placing this question in the correct area :slight_smile:

I am trying to take an object that has its local coordinate axis (blue line) rotated away from the axis of symmetry (red line) (check the attached image) and find that angle between the local coordinate axis and the axis of symmetry. I am unsure how to go about doing this. I have read somewhere about trying to compare pixels on the right side with the pixels on the left side but I feel like there is a more efficient way (plus I am not sure how to compare those pixels either ). The easiest way would be to change the model to align it but I am simply a student for this project in a company so I do not really have a say in that :stuck_out_tongue:

Any suggestions/help would be much appreciated! <3

Thanks!

try this:

float angle = Vector3.Angle(Vector3.up, yourTransform.up);
1 Like

Ahh, that is helpful for the angle part, but I guess I didn’t make it clear enough. The big part is trying to find the red line vector because it is the true axis of symmetry but I don’t have it since the coordinate system of the part is not rotated to align with it. The coordinate system shown in the middle is the one for the part, but I essentially want the part to be aligned visually with the world coordinate system. So somehow I need to find that red vector showing the symmetry so I can use your code to get the angle to adjust it. Essentially, how could I find the axis of symmetry?

You just want the local X axis for the object?

That would be:

Vector3 localPositiveX = transform.right
Vector3 localNegativeX = -transform.right;

Ok let’s back up - I think I misread your whole problem. Your 3D model is actually tilted before it was imported into Unity? If so none of the advice I gave above will help you. If this is just a one-off thing I would probably do something silly like put a mesh collider and Rigidbody on the object, rest it nicely on a flat surface, then print the resulting angle between Vector3.up and transform.up.

Yeah haha, I think the color thing is confusing I mean, for the picture I posted (the screw), essentially I want to find the vector that is normal to the top of the screw, which not one of the x, y, or z axes. The vector normal to the top of the screw would be the axis of symmetry. This screw is just one example of objects that I would want to try to find the axis of symmetry for, but thought it would be the easiest case :stuck_out_tongue: Thanks again for helping :slight_smile:

It sounds like that would solve the problem for this one component, but I would like to find some way that it can be done for multiple components without doing it by hand. The problem is really the symmetry part. If I can find the axis of symmetry, then it becomes much easier.