0027341: Incorrect exact HLR results
[occt.git] / tests / bugs / modalg_6 / bug25613_1
CommitLineData
769fb6a4 1puts "========="
2puts "CR25613"
3puts "========="
4puts ""
5###############################
6## Wrong distance found by xdistef command for attached shapes
7###############################
8
243505b8 9set Tol 5.0e-14
10set dist_good 8.512706220911343e-006
769fb6a4 11
12restore [locate_data_file bug698_f.brep] f
13nexplode f e
14copy f_4 e
15don f e
16
17set log [xdistef e f]
18
19regexp {Max Distance = +([-0-9.+eE]+); Parameter on curve = +([-0-9.+eE]+)} ${log} full dist param
20
21if { [ expr ($dist - $dist_good) ] < -$Tol } {
22 puts "Error in xdistef command (cannot find maximal distance)"
23}
24
25if { $dist > $dist_good } {
26#Check if distance found is correct
27
28 mkcurve c3d e
29 mk2dcurve c2d e f
30 mksurface ss f
31
32 cvalue c3d $param xx yy zz
33 vertex v1 xx yy zz
34
35 2dcvalue c2d $param uu vv
36 svalue ss uu vv xx yy zz
37 vertex v2 xx yy zz
38
39 distmini dm v1 v2
40
41 if { [ expr abs([dval dm_val] - $dist) ] > $Tol } {
42 if { [dval dm_val] != $dist } {
43 puts "Error. xdistef has failed when computing (dist_V1V2 =[dval dm_val], FoundDist=$dist)"
44 } else {
45 puts "Error. xdistef command works better than on MASTER. Please set \"dist_good\" value to $dist."
46 }
47 } else {
48 puts "OK: xdistef algorithm works properly"
49 }
50}