Commit 734e132f authored by Lukas Vollmer's avatar Lukas Vollmer
Browse files

Added test for points inside convex hull

parent f9e75258
......@@ -33,7 +33,8 @@ bool TestIntersectedTriangleDetection(const CTriangulation* triangulation)
VistaVector3D(0, 0, -1), // case node match
VistaVector3D(-0.088826996301291, 0.392029462242860, -0.797359488602036), // case on triangle edge
VistaVector3D( 0.193729508443099, 0.453823535457991, -0.631990887330380), // case inside triangle
VistaVector3D(2*0.193729508443099, 2*0.453823535457991, 2*-0.631990887330380) // not on radius inside triangle
VistaVector3D(2*0.193729508443099, 2*0.453823535457991, 2*-0.631990887330380), // outside hull inside triangle
VistaVector3D(0.5 * 0.193729508443099, 0.5 * 0.453823535457991, 0.5 * -0.631990887330380) // outside hull inside triangle
};
float ab, ac;
......@@ -50,26 +51,37 @@ bool TestIntersectedTriangleDetection(const CTriangulation* triangulation)
if (i == 0 && bInside)
{
cout << "Test case 1: Node match -- OK" << endl;
cout << "Weights - " << v3BarycentricCoords << endl;
passed = passed && true;
}
else if (i == 1 && bInside)
{
cout << "Test case 2: Triangle edge -- OK" << endl;
cout << "Weights - " << v3BarycentricCoords << endl;
passed = passed && true;
}
else if (i == 2 && bInside)
{
cout << "Test case 3: Inside triangle -- OK" << endl;
cout << "Weights - " << v3BarycentricCoords << endl;
passed = passed && true;
}
else if (i == 3 && bInside)
{
cout << "Test case 4: Inside triangle, at radius 2 -- OK" << endl;
cout << "Weights - " << v3BarycentricCoords << endl;
passed = passed && true;
}
else if (i == 4 && bInside)
{
cout << "Test case 5: Inside triangle, at radius 0.5 -- OK" << endl;
cout << "Weights - " << v3BarycentricCoords << endl;
passed = passed && true;
}
else
{
cout << "Error in test case " << i+1 << ": Found triangle is not intersected by point direction" << endl;
cout << "Weights - " << v3BarycentricCoords << endl;
passed = passed && false;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment