0029311: Implementation of the Oriented Bounding Boxes (OBB) functionality
[occt.git] / tests / caf / named_shape / D3
CommitLineData
40093367 1#INTERFACE CAF
2# NamedShape
3#
4# Testing attribute: TNaming_NamedShape
5#
6# Testing command: SelectGeometry (VERTEX)
7#
8
9puts "caf002-D3"
10set QA_DUP 0
11
12set ter _*
13foreach OS [directory [concat aBox1$ter]] {
14 unset $OS
15}
16
17# Create a box
18set aSetX1 10
19set aSetY1 20
20set aSetZ1 30
21set aSetDX1 100
22set aSetDY1 200
23set aSetDZ1 300
24
25box aBox1 ${aSetX1} ${aSetY1} ${aSetZ1} ${aSetDX1} ${aSetDY1} ${aSetDZ1}
26
27# Create a label
28set aLabel 0:4
29Label D ${aLabel}
30
31# Set a shape to the label
32ImportShape D ${aLabel} aBox1
33
34# Close/Open transaction
35NewCommand D
36
37# Select all the sub-shapes of type <aType>
38# aType = VERTEX
39set aType v
40explode ${aBox1} ${aType}
41
42set i 0
43set iSubLabel 3000
44foreach S [directory [concat $aBox1$ter]] {
45 incr i
46 incr iSubLabel
47 puts "SubShape=$S"
48
49 #Memorize a bounding box of the selected sub-shape
1a0339b4 50 bounding -s ${S} -save X1_Box1 Y1_Box1 Z1_Box1 X2_Box1 Y2_Box1 Z2_Box1
40093367 51
52 # Select a sub-shape
53 set LABEL [Label D 0:$iSubLabel]
54 SelectGeometry D ${LABEL} ${S} ${aBox1}
55
56 # Solve selected sub-shape
57 SolveSelection D ${LABEL}
58
59 # Get selected (and solved) sub-shape
60 GetShape D ${LABEL} aSubShape
61
62 # Get bounding box
1a0339b4 63 bounding -s aSubShape -save X1_Box2 Y1_Box2 Z1_Box2 X2_Box2 Y2_Box2 Z2_Box2
40093367 64
1a0339b4 65 if {[dval X1_Box1] != [dval X1_Box2] || [dval Y1_Box1] != [dval Y1_Box2] || [dval Z1_Box1] != [dval Z1_Box2] || [dval X2_Box1] != [dval X2_Box2] || [dval Y2_Box1] != [dval Y2_Box2] || [dval Z2_Box1] != [dval Z2_Box2]} {
40093367 66 puts "SelectGeometry command (${i}): Error"
67 }
68}
69
70puts "SelectGeometry command: OK"