0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / tests / v3d / dimensions / bug24351_1
1 puts "============"
2 puts "CR24351: Test AIS Length dimensions: label position and arrow orientation"
3 puts "============"
4 puts ""
5
6 pload VISUALIZATION
7 vfont add [locate_data_file DejaVuSans.ttf] SansFont
8
9 vinit View1
10 vfront
11
12 set hpos "left hcenter right"
13 set vpos "above vcenter below"
14
15 # ---------------------------------------------------------------------
16 # create dimensions with different arrow orientation and fit algorithm
17 # ---------------------------------------------------------------------
18
19 vpoint arrow_p1  0 0 0
20 vpoint arrow_p2 50 0 0
21
22 vpoint arrow_p3 100 0 0
23 vpoint arrow_p4 150 0 0
24
25 vpoint arrow_p5 100 0 50
26 vpoint arrow_p6 127 0 50
27
28 vpoint arrow_p7  0 0 50
29 vpoint arrow_p8 10 0 50
30
31 # test forced internal arrow orientation
32 vdimension arrow_d1 -length -shapes arrow_p1 arrow_p2 -text 3d -plane zox -label hfit -flyout 10.0 -arrow internal -font SansFont
33
34 # test forced external arrow orientation
35 vdimension arrow_d2 -length -shapes arrow_p3 arrow_p4 -text 3d -plane zox -label hfit -flyout 10.0 -arrow external -font SansFont
36
37 # test that auto-fit for arrow places them externally for small geometry
38 vdimension arrow_d3 -length -shapes arrow_p5 arrow_p6 -text 3d -plane zox -label hcenter -flyout 10.0 -arrow fit -font SansFont
39
40 # test that auto-fit for text places the label externally for small geometry
41 vdimension arrow_d4 -length -shapes arrow_p7 arrow_p8 -text 3d -plane zox -label hfit -flyout 10.0 -arrow fit -font SansFont
42
43 vfit
44
45 # ------------------------------------------------
46 # create dimension with different label positions
47 # ------------------------------------------------
48
49 vinit Viewer2/View2
50 vfront
51
52 set idx 0
53 for {set r 0} {$r < 3} {incr r} {
54   for {set c 0} {$c < 3} {incr c} {
55
56     set point1 p_[expr "$idx * 2 + 0"]
57     set point2 p_[expr "$idx * 2 + 1"]
58
59     vpoint $point1 [expr "50.0 * ($c*2 + 0)"] 0.0 [expr "50.0 * $r"]
60     vpoint $point2 [expr "50.0 * ($c*2 + 1)"] 0.0 [expr "50.0 * $r"]
61
62     set dimension d_$idx
63
64     vdimension $dimension -length -shapes $point1 $point2 -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 10.0 -font SansFont
65     vdisplay $dimension
66
67     incr idx
68   }
69 }
70 vfit
71
72 vdump $imagedir/${casename}.png