Solve for CFrame given

Solve for CFrame given a few parameters:
1.) Part (assume 6 faced rectangular prism - standard roblox part)
2.) 2 attachments in the part static relative to the part
3.) 2 target points (Vector3s) that attachments must line up with
4.) unit vector perpendicular to the line created from the two target points

Solve for the part’s CFrame so that the 2 attachment points fit exactly to the 2 target points, and the [part’s lookVector cross the line created by the 2 target points (target1 - target2).Unit] is equal to the unit vector given.

I am currently able to solve this by first setting the CFrame of the part to be halfway between the target points, and setting the orientation so that (target1 - target2).Unit is the part’s YVector. Then adding on the rotation + offset of the differences between the part and the part’s attachment points. But I feel like there HAS to be a more elegant solution.

If anyone has any insight on how to approach this, I would greatly appreciate feedback. Thanks.