0014531: Boolean Operation Algorithm fails
[occt.git] / tests / bugs / modalg_5 / bug24585_1
CommitLineData
c2c2f2b6 1puts "========="
2puts "OCC24585"
3puts "========="
4puts ""
5###########################################################
6# Wrong pcurve of the section curve
7###########################################################
4e14c88f 8
714c3bfc 9set ExpectedTol 5.6061116035240048e-005
c2c2f2b6 10set NbCurv_OK 1
11
12restore [locate_data_file bug24585_b1.brep] b1
13restore [locate_data_file bug24585_b2.brep] b2
14
15mksurface s1 b1
16bounds s1 U1f_exp U1l_exp V1f_exp V1l_exp
17
18set log [bopcurves b1 b2 -2d]
19
20regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
21
22if {${NbCurv} != ${NbCurv_OK}} {
23 puts "Error: ${NbCurv_OK} curve(s) expected, but ${NbCurv} found."
24}
25
714c3bfc 26set tol_abs 0.0
27set tol_rel 0.01
28checkreal "Tolerance Reached" ${Toler} ${ExpectedTol} ${tol_abs} ${tol_rel}
c2c2f2b6 29
631633a2 30bounds c2d1_1 U1 U2
312dcvalue c2d1_1 U1 U_begin V_begin
322dcvalue c2d1_1 U2 U_end V_end
c2c2f2b6 33
631633a2 34#Theoretically, c2d1_1 must cover U-diapason of surface s1 fully.
c2c2f2b6 35
36set delta_f [dval U1f_exp-U_begin]
37
38#ATTENTION!!! U_begin must be strictly equal U1f_exp (without any tolerance)
39if {${delta_f} != 0} {
40 puts "Error: Bad value. U_begin = [dval U_begin], Ufirst = [dval U1f_exp]."
41} else {
42 puts "OK: Good value. U_begin matches with Ufirst of surface."
43}
44
45puts ""
46
47set delta_l [dval U1l_exp-U_end]
48
49#ATTENTION!!! U_end must be strictly equal U1l_exp (without any tolerance)
50if {${delta_l} != 0} {
51 puts "Error: Bad value. U_end = [dval U_end], Ulast = [dval U1l_exp]."
52} else {
53 puts "OK: Good value. U_end matches with Ulast of surface."
4e14c88f 54}
55
56puts ""
57puts "Check if tangents in first and last point of line have the same directions"
58
59#See bug#26752
60cvalue c_1 U1 xx yy zz dx1 dy1 dz1
61cvalue c_1 U2 xx yy zz dx2 dy2 dz2
62
63set DP [dval dx1*dx2+dy1*dy2+dz1*dz2]
64if {${DP} < 0} {
65 puts "Error: Tangents are reversed. Bug 26752 is reproduced."
66} else {
67 puts "OK: Tangents are not reversed."
68}