algorithm – How to find the smallest distance between two 4-sided objects in 3D space?


I was wondering if there is a way to calculate the smallest distance between two 4-sided objects in space. In this specific scenario, the only information I know about both of them are the 4 points that make up their vertices (so 8 points in total). Is there a way to achieve this?

Also, I’m considering that both shapes have a non-zero volume and that they do not intersect each other.