1d7ca641 |
1 | puts "============" |
2 | puts "CR24351" |
3 | puts "============" |
4 | puts "" |
5 | ####################################################################### |
6 | # Test AIS Radius dimensions: label position and arrow orientation |
7 | ####################################################################### |
8 | pload VISUALIZATION |
9 | |
6fb1a930 |
10 | vfont add [locate_data_file DejaVuSans.ttf] SansFont |
11 | |
1d7ca641 |
12 | vinit |
27af3052 |
13 | vfront |
1d7ca641 |
14 | |
15 | set hpos "left hcenter" |
16 | set vpos "above vcenter below" |
17 | |
18 | # --------------------------------------------------------------------- |
19 | # create dimensions with different arrow orientation and fit algorithm |
20 | # --------------------------------------------------------------------- |
21 | |
fe83e1ea |
22 | # test forced internal arrow orientation |
1d7ca641 |
23 | vpoint circle1_p1 0 0 30 |
24 | vpoint circle1_p2 30 0 0 |
25 | vpoint circle1_p3 60 0 30 |
26 | vcircle circle1 circle1_p1 circle1_p2 circle1_p3 0 |
6fb1a930 |
27 | vdimension rad1 -radius -shapes circle1 -text 3d -plane zox -label hfit -flyout 0 -arrow internal -font SansFont |
1d7ca641 |
28 | |
fe83e1ea |
29 | # test forced external arrow orientation |
30 | vpoint circle2_p1 100 0 35 |
31 | vpoint circle2_p2 135 0 0 |
32 | vpoint circle2_p3 170 0 35 |
1d7ca641 |
33 | vcircle circle2 circle2_p1 circle2_p2 circle2_p3 0 |
6fb1a930 |
34 | vdimension rad2 -radius -shapes circle2 -text 3d -plane zox -label hfit -flyout 0 -arrow external -font SansFont |
1d7ca641 |
35 | |
fe83e1ea |
36 | # test that auto-fit for arrow places them externally for small geometry |
1d7ca641 |
37 | vpoint circle3_p1 0 0 113 |
38 | vpoint circle3_p2 33 0 80 |
39 | vpoint circle3_p3 66 0 113 |
40 | vcircle circle3 circle3_p1 circle3_p2 circle3_p3 0 |
6fb1a930 |
41 | vdimension rad3 -radius -shapes circle3 -text 3d -plane zox -label hcenter -flyout 0 -arrow fit -font SansFont |
1d7ca641 |
42 | |
fe83e1ea |
43 | # test that auto-fit for text places the label externally for small geometry |
1d7ca641 |
44 | vpoint circle4_p1 120 0 95 |
45 | vpoint circle4_p2 135 0 80 |
46 | vpoint circle4_p3 150 0 95 |
47 | vcircle circle4 circle4_p1 circle4_p2 circle4_p3 0 |
6fb1a930 |
48 | vdimension rad4 -radius -shapes circle4 -text 3d -plane zox -label hfit -flyout 0 -arrow fit -font SansFont |
1d7ca641 |
49 | vfit |
50 | |
51 | # ------------------------------------------------ |
52 | # create dimension with different label positions |
53 | # ------------------------------------------------ |
54 | |
55 | vinit Viewer2/View2 |
27af3052 |
56 | vfront |
1d7ca641 |
57 | |
58 | set idx 0 |
59 | for {set r 0} {$r < 3} {incr r} { |
60 | for {set c 0} {$c < 2} {incr c} { |
61 | |
62 | set point1 p_[expr "$idx * 3 + 0"] |
63 | set point2 p_[expr "$idx * 3 + 1"] |
64 | set point3 p_[expr "$idx * 3 + 2"] |
65 | set circle c_[expr "$idx"] |
66 | |
67 | vpoint $point1 [expr "90.0 * $c + 0"] 0.0 [expr "80.0 * $r + 33"] |
68 | vpoint $point2 [expr "90.0 * $c + 33"] 0.0 [expr "80.0 * $r + 0"] |
69 | vpoint $point3 [expr "90.0 * $c + 66"] 0.0 [expr "80.0 * $r + 33"] |
70 | vcircle $circle $point1 $point2 $point3 0 |
71 | |
72 | set dimension r_$idx |
73 | |
6fb1a930 |
74 | vdimension $dimension -radius -shapes $circle -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 0.0 -font SansFont |
1d7ca641 |
75 | vdisplay $dimension |
76 | |
77 | incr idx |
78 | } |
79 | } |
80 | vfit |
81 | |
5747059b |
82 | checkview -screenshot -3d -path ${imagedir}/${test_image}.png |