| 49 | |
| 50 | template<typename T> |
| 51 | T shortestPathInQuadrangle( const Vector3<T>& a, const Vector3<T>& b, const Vector3<T>& c, const Vector3<T>& d ) |
| 52 | { |
| 53 | auto vecB = b - a; |
| 54 | auto vecC = c - a; |
| 55 | auto vecD = d - a; |
| 56 | Vector2<T> unfoldB{ vecB.length(), 0 }; |
| 57 | auto unfoldC = unfoldOnPlane( vecB, vecC, unfoldB, true ); |
| 58 | auto unfoldD = unfoldOnPlane( vecC, vecD, unfoldC, true ); |
| 59 | return std::clamp( lineIsect( unfoldC, unfoldB, unfoldD ), T(0), T(1) ); |
| 60 | } |
| 61 | |
| 62 | template MRMESH_API float shortestPathInQuadrangle( const Vector3<float>& a, const Vector3<float>& b, const Vector3<float>& c, const Vector3<float>& d ); |
| 63 | template MRMESH_API double shortestPathInQuadrangle( const Vector3<double>& a, const Vector3<double>& b, const Vector3<double>& c, const Vector3<double>& d ); |