0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / bugs / caf / bug23766_4
1 puts "=========="
2 puts "OCC23766"
3 puts "=========="
4 puts ""
5 ########################################################
6 # Shape orientation processing mechanism, redesign
7 ########################################################
8
9 ## test for keeping Orientation (cbf)
10
11 erase
12 NewDocument D BinOcaf
13
14 #1 - create box
15 NewCommand D
16 set B2 [AddObject D];                   ## add object
17 set F2 [AddFunction D $B2 Box];         ## add function
18 BoxDX D $B2 190;                        ## set arguments of this function
19 BoxDY D $B2 290
20 BoxDZ D $B2 390
21 InitLogBook D;                          ## initialize (clean) internal maps of labels
22 AddDriver D Box Attach  
23 ComputeFun D $F2;                       ## compute the function
24 GetShape D $F2:2 Box2;                  ## check result
25
26 #2 - make selections keeping orientation
27 explode Box2 F
28 explode Box2_1 E
29 explode Box2_3 E
30 don Box2_1_1 Box2_3_4
31 set Sel1 [AttachShape D Box2_1_1 ${B2} ${B2} 1]; ## set attachment
32 set Sel2 [AttachShape D Box2_3_4 ${B2} ${B2} 1]; ## set attachment
33
34 #3 - check orientation of the selected shapes
35 GetShape D 0:1:2:1:2 E1
36 set info1 [whatis E1]
37 ## to be: E1 is a shape EDGE FORWARD Modified Orientable
38 if { [regexp "FORWARD" $info1] != 1 } {
39     puts "Error: orientation of E1 is incorrect"
40 } else {
41     puts "OK: orientation of E1 is correct"
42 }
43
44 GetShape D 0:1:3:1:2 E2
45 set info2 [whatis E2]
46 ## to be: E2 is a shape EDGE REVERSED Modified Orientable
47 if { [regexp "REVERSED" $info2] != 1 } {
48     puts "Error: orientation of E2 is incorrect"
49 } else {
50     puts "OK: orientation of E2 is correct"
51 }
52
53 #4 -  test persistence: check orientation after retrieving (to be the same as before)
54 file delete -force ${imagedir}/bug23766_ttt1.cbf
55 NewCommand D
56 SaveAs D ${imagedir}/bug23766_ttt1.cbf
57 Close D
58 ##unset D
59 Open ${imagedir}/bug23766_ttt1.cbf D
60 GetShape D 0:1:2:1:2 E1
61 set info3 [whatis E1]
62 ## to be: E1 is a shape EDGE FORWARD Modified Orientable
63 if { [regexp "FORWARD" $info3] != 1 } {
64     puts "Error: orientation of E1 is incorrect"
65 } else {
66     puts "OK: orientation of E1 is correct"
67 }
68
69 GetShape D 0:1:3:1:2 E2
70 set info4 [whatis E2]
71 ## to be: E2 is a shape EDGE REVERSED Modified Orientable
72 if { [regexp "REVERSED" $info4] != 1 } {
73     puts "Error: orientation of E2 is incorrect"
74 } else {
75     puts "OK: orientation of E2 is correct"
76 }
77