a9810829 |
1 | puts "========" |
2 | puts "OCC29484" |
3 | puts "========" |
4 | puts "" |
5 | ################################################# |
6 | # Avoid inheritance of the BRepAlgoAPI_Check from BRepBuilderAPI_MakeShape |
7 | ################################################# |
8 | |
9 | puts "check simple box" |
10 | |
11 | box b1 2 2 2 |
12 | if {![regexp "The shape seems to be valid" [bopapicheck b1]]} { |
13 | puts "Error: The simple box is considered as invalid by BRepAlgoAPI_Check" |
14 | } |
15 | |
16 | puts "add another box" |
17 | |
18 | box b2 1 1 1 2 2 2 |
19 | compound b1 b2 c |
20 | |
21 | puts "check si compound" |
22 | |
23 | if {![regexp "The shape is invalid" [bopapicheck c]]} { |
24 | puts "Error: Self-intersection is not detected" |
25 | } |
26 | |
27 | if {![regexp "The shape seems to be valid" [bopapicheck c -si]]} { |
28 | puts "Error: Check on self-intersection is still enabled" |
29 | } |
30 | |
31 | |
32 | puts "increase tolerance of the vertices of the box to test Small edges detection" |
33 | |
34 | foreach v [explode b1 v] {settolerance $v 5.} |
35 | |
36 | if {![regexp "The shape is invalid" [bopapicheck b1 -si]]} { |
37 | puts "Error: Small edges are not detected" |
38 | } |
39 | |
40 | if {![regexp "The shape seems to be valid" [bopapicheck c -si -se]]} { |
41 | puts "Error: Check on small edges is still enabled" |
42 | } |
43 | |
44 | puts "b1 - invalid, b2 - ok" |
45 | |
46 | if {![regexp "The first shape is invalid" [bopapicheck b1 b2]]} { |
47 | puts "Error: The check is invalid" |
48 | } |
49 | |
50 | if {![regexp "The second shape is invalid" [bopapicheck b2 b1]]} { |
51 | puts "Error: The check is invalid" |
52 | } |
53 | |
54 | |
55 | puts "test types" |
56 | |
57 | if {![regexp "The shapes seem to be valid" [bopapicheck b1 b2 -op fuse -se -si]]} { |
58 | puts "Error: The check on types is invalid" |
59 | } |
60 | |
61 | puts "check empty shape" |
62 | compound c |
63 | |
64 | if {![regexp "The shape is empty" [bopapicheck c]]} { |
65 | puts "Error: Empty shape is not detected" |
66 | } |
67 | |
68 | if {![regexp "The shapes are not valid for Boolean operation" [bopapicheck b2 c]]} { |
69 | puts "Error: Empty shape is not detected" |
70 | } |
71 | |
72 | |
73 | puts "check vertex/solid BOPs" |
74 | vertex v 1 1 1 |
75 | |
76 | if {![regexp "The shapes seem to be valid" [bopapicheck b2 v -op common]]} { |
77 | puts "Error: The check on types is invalid" |
78 | } |
79 | |
80 | if {![regexp "The shapes are not valid for Boolean operation" [bopapicheck b2 v -op fuse]]} { |
81 | puts "Error: The check on types is invalid" |
82 | } |
83 | |
84 | if {![regexp "The shapes are not valid for Boolean operation" [bopapicheck b2 v -op cut]]} { |
85 | puts "Error: The check on types is invalid" |
86 | } |
87 | |
88 | if {![regexp "The shapes seem to be valid" [bopapicheck b2 v -op tuc]]} { |
89 | puts "Error: The check on types is invalid" |
90 | } |