5 ################################################
6 # BREPExtrma DistShapeShape gives wrong result for Sphere and Line
7 ################################################
10 rotate s 0 0.5 1 1 1 0.5 34.9
11 line l -0.79 0.88 1.22 0.579 1.765 0.576
13 set extrema_res [extrema l s]
14 set extrema_length [llength ${extrema_res} ]
17 if {${extrema_length} != 18 } {
18 puts "Error: expected only two lines as result of extrema!"
21 # Distance check on ext_1
23 regexp {Extrema 1 is point : +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $extrema_res full x1 y1 z1
25 set good_x1 -2.2838350838816694
26 set good_y1 -3.6737459810900646
27 set good_z1 -0.2660950057268425
28 checkreal "Intersection point x:" ${x1} ${good_x1} 0.01 0.01
29 checkreal "Intersection point y:" ${y1} ${good_y1} 0.01 0.01
30 checkreal "Intersection point z:" ${z1} ${good_z1} 0.01 0.01
33 # Distance check on ext_2
34 regexp {Extrema 2 is point : +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $extrema_res full x2 y2 z2
36 set good_x2 0.29086178559218934
37 set good_y2 4.1748550113475211
38 set good_z2 2.2952614654595873
39 checkreal "Intersection point x:" ${x2} ${good_x2} 0.01 0.01
40 checkreal "Intersection point y:" ${y2} ${good_y2} 0.01 0.01
41 checkreal "Intersection point z:" ${z2} ${good_z2} 0.01 0.01