@@ -1045,6 +1045,16 @@ void test_segment_triangle_distance()
10451045 const geode::Segment3D seg_bz0{ bplus, b };
10461046 const geode::Segment3D seg_bz1{ bminus, b };
10471047 const geode::Segment3D seg_hx{ h2, h };
1048+ const geode::Point3D t0{ { 481.283958699181 , 450.641409484767 ,
1049+ 16.0218597413699 } };
1050+ const geode::Point3D t1{ { 436.66619673526 , 410.956383185562 ,
1051+ -9.33593054802634 } };
1052+ const geode::Point3D t2{ { 437.005650057499 , 490.326435783972 ,
1053+ -9.33593054802634 } };
1054+ const geode::Point3D s0{ { 478.259567983804 , 448.24094898319 ,
1055+ 14.302289193253 } };
1056+ const geode::Point3D s1{ { 478.345179768413 , 450.641409484767 ,
1057+ 14.3452740537089 } };
10481058
10491059 double distance;
10501060 geode::Point3D closest_point0;
@@ -1087,6 +1097,15 @@ void test_segment_triangle_distance()
10871097 && closest_point0.inexact_equal ( result_t30 )
10881098 && closest_point1.inexact_equal ( g ),
10891099 " [Test] Wrong result for segment_triangle_distance with seg_hx" );
1100+
1101+ const geode::Triangle3D real_triangle{ t0, t1, t2 };
1102+ const geode::Segment3D real_segment{ s0, s1 };
1103+ std::tie ( distance, closest_point0, closest_point1 ) =
1104+ geode::segment_triangle_distance ( real_segment, real_triangle );
1105+ OPENGEODE_EXCEPTION ( distance <= geode::GLOBAL_EPSILON
1106+ && closest_point0.inexact_equal ( s0 )
1107+ && closest_point1.inexact_equal ( s0 ),
1108+ " [Test] Wrong result for segment_triangle_distance with real_segment" );
10901109}
10911110
10921111void test_point_ellipse_distance_2d ()
0 commit comments