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