0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tests / bugs / modalg_7 / bug29824
CommitLineData
3306fdd9 1puts "========"
2puts "0029824: Intersection of cylinder and sphere is incorrect"
3puts "========"
4puts ""
5
6restore [locate_data_file OCC20964_revsolid.brep] b1
7restore [locate_data_file OCC20964_sphere.brep] b2
8explode b1 f
9explode b2 f
10donly b1_7 b2_1
11
12bop b1_7 b2_1
13bopsection result
14
15checknbshapes result -edge 3
16
17foreach a [explode result e] {
18 mkcurve cc $a
19 bounds cc U1 U2
20
21 if {[dval U2-U1] < 1.0e-9} {
22 puts "Error: Wrong curve's range!"
23 }
24
25 set aStep [expr [dval U2-U1]/100.0 ]
26 set isFirst 1
27 set aCosPrev 1.0
28 dset dx1 0.0
29 dset dy1 0.0
30 dset dz1 0.0
31 for {set aU [dval U1]} {$aU <= [dval U2]} {set aU [expr $aU + $aStep]} {
32 cvalue cc $aU xx yy zz dx dy dz
33
34 if {!$isFirst} {
35 set m1 [module dx1 dy1 dz1]
36 set m2 [module dx dy dz]
37 set aCos [dval dx1*dx+dy1*dy+dz1*dz]
38 set aCos [expr $aCos/($m1*$m2)]
39
40 if {abs([expr $aCos - $aCosPrev]) > 0.05} {
41 puts "Error: It seems that the curve $a change it direction at the point $aU. Please recheck."
42 break
43 }
44
45 set aCosPrev $aCos
46 }
47
48 set isFirst 0
49
50 dset dx1 dx
51 dset dy1 dy
52 dset dz1 dz
53 }
54}