| 8 | { |
| 9 | |
| 10 | TEST( MRMesh, Polyline2RayIntersect ) |
| 11 | { |
| 12 | Vector2f as[2] = { { 0, 1 }, { 4, 5 } }; |
| 13 | Polyline2 polyline; |
| 14 | polyline.addFromPoints( as, 2, false ); |
| 15 | |
| 16 | Line2f line( { 0, 2 }, { 2, -2 } ); |
| 17 | |
| 18 | auto res = rayPolylineIntersect( polyline, line ); |
| 19 | ASSERT_TRUE( !!res ); |
| 20 | ASSERT_EQ( res->edgePoint.e, 0_e ); |
| 21 | ASSERT_EQ( res->edgePoint.a, 1.0f / 8 ); |
| 22 | ASSERT_EQ( res->distanceAlongLine, 1.0f / 4 ); |
| 23 | } |
| 24 | |
| 25 | TEST( MRMesh, Polyline2RayIntersectFloat ) |
| 26 | { |
nothing calls this directly
no test coverage detected