0031517: Data Exchange - wrong result of ShapeTool::UpdateAssemblies()
[occt.git] / tests / bugs / xde / bug28055_2
1 pload QAcommands
2
3 puts "============"
4 puts "CR28055"
5 puts "============"
6 puts ""
7
8 ##########################################################################
9 # Add UpdateAssemblies() method for top-down update of assembly compounds
10 ##########################################################################
11
12 ##########################################################################
13 proc IsSame {s1 s2} {
14   global $s1 $s2
15   if {[IsSameShapes $s1 $s2] == 1} {return 1}
16   return 0
17 }
18 ##########################################################################
19
20 ReadStep d [locate_data_file trj3_as1-tc-214.stp]
21 XShow d
22 vfit
23 vsetdispmode 1
24
25 # Explode on solids for comparison
26 XGetOneShape model1 d
27 explode model1 So
28
29 checkview -screenshot -3d -path ${imagedir}/${::casename}_1.png
30
31 # Update part's geometry
32 box box_nut -2 -2 0 22 18 8;
33 XSetShape d 0:1:1:5 box_nut
34 XUpdateAssemblies d
35 XShow d
36
37 # Explode on solids for comparison
38 XGetOneShape model2 d
39 explode model2 So
40
41 # 0 means "different", 1 means "same"
42 set same_mask {1 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 0 0}; list
43 set n [llength $same_mask]
44
45 # Compare subshapes (exploded compounds) with respect to the reference mask
46 set i 1
47 foreach same_flag $same_mask {
48   set same [IsSame model1_$i model2_$i]
49   puts "Comparison result for subshape $i: $same"
50   if {$same!=$same_flag} {
51     if {$same_flag==1} {
52       puts "Error: shapes are expected to be identical"
53     } else {
54       puts "Error: shapes are expected to be different"
55     }
56   }
57   incr i
58 }
59
60 checkview -screenshot -3d -path ${imagedir}/${::casename}_2.png