0021507: Bug in BOP: bcut produces invalid result without notice
[occt.git] / tests / bugs / modalg_6 / bug21507
1 puts "=========="
2 puts "OCC21507"
3 puts "=========="
4 puts ""
5 ############################################################
6 # Bug in BOP: bcut produces invalid result without notice 
7 ############################################################
8
9 # Demonstrates bug in bcut command
10 pload XDE
11
12 # Load face
13 puts "Loading face"
14 restore [locate_data_file bug21507_bcut_bug_face.brep] face
15
16 # Make tool - an elliptic cylinder
17 puts "Constructing tool"
18 ellipse c 10000 0 0 0 1 0 600 300
19 mkedge e c
20 wire w e
21 tcopy w w1
22 tcopy w w2
23 ttranslate w1 0  5000 0
24 ttranslate w2 0 -5000 0
25 thrusections tool 1 1 w1 w2
26
27 # Check validity of face and tool
28 puts "Checking face: [checkshape face]; [lrange [tolerance face] 0 1]"
29 puts "Checking tool: [checkshape tool]; [lrange [tolerance tool] 0 1]"
30 bopcheck face
31 bopcheck tool
32
33 # Do cut
34 puts "Running bcut"
35 bcut result face tool
36
37 # Evaluate result by number of faces (bcut)
38 set rfaces [explode result f]
39 if { [llength $rfaces] != 1 } {
40   puts "Error: [llength $rfaces] faces instead of 1"
41 } else {
42   puts "Result is as expected"
43 }
44
45 # Do the same using cut
46 puts "Now running old cut"
47 cut rcut face tool
48
49 # Evaluate result by number of faces (cut)
50 set rcfaces [explode rcut f]
51 if { [llength $rcfaces] != 1 } {
52   puts "Error: [llength $rcfaces] faces instead of 1"
53 } else {
54   puts "Result is as expected"
55 }
56
57 set 2dviewer 1