0025138: SIGSEGV when sweeping along helix
[occt.git] / tests / bugs / moddata_2 / bug23165
CommitLineData
3bea4c16 1puts "================"
2puts "OCC23165"
3puts "================"
4puts ""
5###################################################################################################################
6# BndLib_Add3dCurve::Add incorrectly segmented original B-Spline what resulting in wrong bounding box or exception.
7###################################################################################################################
8
9catch { pload XDE }
10
11set BugNumber OCC23165
12
13smallview
14
15# 1 step
16set exception_status 0
3bea4c16 17
18restore [locate_data_file OCC23165-edge1.brep] e1
19
20donly e1
21catch { bounding e1 } msg
22fit
23
24set index [lsearch $msg exception]
25if {$index > -1} {
26 set exception_status 1
27} else {
28 set e1_result [bounding e1]
29
30 set e1_x1 [lindex ${e1_result} 0]
31 set e1_y1 [lindex ${e1_result} 1]
32 set e1_z1 [lindex ${e1_result} 2]
33 set e1_x2 [lindex ${e1_result} 3]
34 set e1_y2 [lindex ${e1_result} 4]
35 set e1_z2 [lindex ${e1_result} 5]
36
37 set e1_good_x1 -17.610622244944413
38 set e1_good_y1 -0.010622244944394899
39 set e1_good_z1 -3.0106222449443973
40 set e1_good_x2 -17.589377755055537
bcd19756 41 set e1_good_y2 5.700038816113608
42 set e1_good_z2 -1.6251884728673096
3bea4c16 43
cd718a73 44 checkreal "e1_x1" ${e1_x1} ${e1_good_x1} 0 0.001
45 checkreal "e1_y1" ${e1_y1} ${e1_good_y1} 0 0.001
46 checkreal "e1_z1" ${e1_z1} ${e1_good_z1} 0 0.001
47 checkreal "e1_x2" ${e1_x2} ${e1_good_x2} 0 0.001
48 checkreal "e1_y2" ${e1_y2} ${e1_good_y2} 0 0.001
49 checkreal "e1_z2" ${e1_z2} ${e1_good_z2} 0 0.001
3bea4c16 50}
51
52# 2 step
53restore [locate_data_file OCC23165-curve.rle] c
54mkedge result c 20 36
55
56donly result
1951a27c 57set res [bounding result]
3bea4c16 58fit
59
1951a27c 60set x1 [lindex ${res} 0]
61set y1 [lindex ${res} 1]
62set z1 [lindex ${res} 2]
63set x2 [lindex ${res} 3]
64set y2 [lindex ${res} 4]
65set z2 [lindex ${res} 5]
3bea4c16 66
67set good_x1 -17.6105835090592
68set good_y1 -4.7133570660117909
69set good_z1 -4.3679100133425806
70set good_x2 -17.589416490940806
bcd19756 71set good_y2 5.7000000802283299
72set good_z2 -1.6252272087525899
3bea4c16 73
cd718a73 74checkreal "x1" ${x1} ${good_x1} 0 0.001
75checkreal "y1" ${y1} ${good_y1} 0 0.001
76checkreal "z1" ${z1} ${good_z1} 0 0.001
77checkreal "x2" ${x2} ${good_x2} 0 0.001
78checkreal "y2" ${y2} ${good_y2} 0 0.001
79checkreal "z2" ${z2} ${good_z2} 0 0.001
3bea4c16 80
cd718a73 81if { ${exception_status} == 0 } {
3bea4c16 82 puts "${BugNumber}: OK"
83} else {
84 puts "${BugNumber}: Faulty"
85}
86
5747059b 87checkview -display result -2d -path ${imagedir}/${test_image}.png
58cf74e0 88checkprops result -l 15.8888
89checksection result