Find angle between two edges of separate objects

I have two identical objects except one has been rotated in edit mode, and I want to find the angle in Euler or Quaternion format.

I tried using two vectors, one at a vertex of each object, however that approach can result in multiple angles where only the one vertex matches, while the rest of the object does not. I was thinking of selecting the same edge in the two objects and finding the angle between the two edges.

not 100% sure what you’re asking for- you say you want to get an angle, but it sounds like what you’re actually wanting is a rotation. getting an angle between two vectors is super easy: v1.angle(v2), but that will give you an angle that assumes v1 and v2 exist on the same plane and will not give you enough information to rotate object2 to match object1 (which is what I’m assuming you’re trying to do?). a direction vector can be used to get a quaternion like so:

edge_vector.to_track_quat('Z')

or an euler:
edge_vector.to_track_quat('Z').to_euler()

or a 3x3 matrix (with no location data):
edge_vector.to_track_quat('Z').to_matrix()

1 Like

Yes, I am trying to rotate Object1 to match Object2