MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / TEST

Function TEST

source/MRTest/MRPolyline2IntersectTests.cpp:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8{
9
10TEST( 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
25TEST( MRMesh, Polyline2RayIntersectFloat )
26{

Callers

nothing calls this directly

Calls 6

rayPolylineIntersectFunction · 0.85
isPointInsidePolylineFunction · 0.85
addFromPointsMethod · 0.80
normalizedMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected