0023119: TNaming_Selector::Solve() fails (changes from single face to compound of...
[occt.git] / tests / caf / named_shape / F4
CommitLineData
efd4b232 1# =================== OCAF ======================
2# Naming
3#
4# Testing purpose: Naming selection mechanism
5#
6# Test case: F4 (ShapeOrientation is not used)
7# 1. Create box $B2
8# 2. Create prism Pr1 ($Prism1)
9# 3. Create prism Pr2 ($Prism2)
10# 4. $FS1 = Fuse ($Prism1, $Prism2)
11# 5. Make selections for all sub-shapes
12# 6. Modify B2
13# 7. Recompute modeling functions
14# 8. Recompute selections
15# ===============================================
16
40093367 17#pload FULL
40093367 18erase
19Close D
20unset D
21NewDocument D MDTV-Standard
22
23#Drivers' nick-names:
24#Box|Sph|Cyl|Cut|Fuse|Prism|SecRevol|FulRevol|PTxyz|PTALine|PRLine|PMirr|Fillet|Attach|XAttach
25# order of functions recomputation should be defined out of the tool (by end user)
40093367 26AddDriver D Box Attach PTxyz PTALine PRLine PMirr Sph Prism FulRevol SecRevol
efd4b232 27
40093367 28#1 - create box using more flexible set of commands
29NewCommand D
30isos 12
31set B2 [AddObject D]; ## add object
32set F2 [AddFunction D $B2 Box]; ## add function
33BoxDX D $B2 190; ## set argumets of this function
34BoxDY D $B2 290
35BoxDZ D $B2 390
36InitLogBook D; ## initialize (clean) internal maps of labels
37ComputeFun D $F2; ## compute the function
38GetShape D $F2:2 Box2; ## check result
39fit
40whatis Box2
41GetReference D $B2; ## referes to result NS
42
43
44#2 Prism 1
45NewCommand D
46explode Box2 F
47set Bas1 [AttachShape D Box2_1 ${B2} ${B2} 0]
48set Prism1 [AddPrism D $Bas1 300 0]
49ComputeFun D $Prism1:1
50GetShape D $Prism1:1:2 Pr1
51
52PrismHeight D $Prism1 500
53ComputeFun D $Prism1:1
54GetShape D $Prism1:1:2 Pr1
55fit
56
57
58#3 Prism 2
59NewCommand D
60explode Pr1 F
61set Bas2 [AttachShape D Pr1_1 ${Prism1} ${Prism1} 0]
62set Prism2 [AddPrism D $Bas2 500 0]
63ComputeFun D $Prism2:1
64GetShape D $Prism2:1:2 Pr2
65
66#4 => fuse
67NewCommand D
68AddDriver D Fuse
69set FS1 [AddFuse D $Prism1 $Prism2]
70ComputeFun D $FS1
71GetShape D $FS1:2 Pr1
72
73
74
75#5
76NewCommand D
77set SL [TestSingleSelection D $Prism1 0]
78set SL2 [TestMultipleSelection D $Prism1 0]
79# both have failed units!!!
80
efd4b232 81#6
40093367 82NewCommand D
83BoxDZ D $B2 420
84
efd4b232 85#7 order of recomputation
40093367 86NewCommand D
87InitLogBook D; ## to be initialized before any recomputation of impacted functions set (if attachments are presented)
88ComputeFun D $F2;
89ComputeFun D $Bas1:1
90ComputeFun D $Prism1:1
91ComputeFun D $Bas2:1
92ComputeFun D $Prism2:1
93ComputeFun D $FS1
94
efd4b232 95
96#8
40093367 97SolveFlatFrom D $SL
98NewCommand D