1d7ca641 |
1 | puts "============" |
2 | puts "CR24351" |
3 | puts "============" |
4 | puts "" |
5 | ####################################################################### |
6 | # Test AIS Diameter dimensions: label position and arrow orientation |
7 | ####################################################################### |
8 | pload VISUALIZATION |
9 | |
10 | vinit |
11 | vright |
12 | |
13 | set hpos "left hcenter right" |
14 | set vpos "above vcenter below" |
15 | |
16 | # --------------------------------------------------------------------- |
17 | # create dimensions with different arrow orientation and fit algorithm |
18 | # --------------------------------------------------------------------- |
19 | |
fe83e1ea |
20 | # test forced internal arrow orientation |
1d7ca641 |
21 | vpoint circle1_p1 0 0 30 |
22 | vpoint circle1_p2 30 0 0 |
23 | vpoint circle1_p3 60 0 30 |
24 | vcircle circle1 circle1_p1 circle1_p2 circle1_p3 0 |
0499eb06 |
25 | vdimension diam1 -diameter -shapes circle1 -text 3d -plane zox -label hfit -flyout 0 -arrow internal |
1d7ca641 |
26 | |
fe83e1ea |
27 | # test forced external arrow orientation |
1d7ca641 |
28 | vpoint circle2_p1 100 0 30 |
29 | vpoint circle2_p2 130 0 0 |
30 | vpoint circle2_p3 160 0 30 |
31 | vcircle circle2 circle2_p1 circle2_p2 circle2_p3 0 |
0499eb06 |
32 | vdimension diam2 -diameter -shapes circle2 -text 3d -plane zox -label hfit -flyout 0 -arrow external |
1d7ca641 |
33 | |
fe83e1ea |
34 | # test that auto-fit for arrow places them externally for small geometry |
1d7ca641 |
35 | vpoint circle3_p1 0 0 102 |
36 | vpoint circle3_p2 22 0 80 |
37 | vpoint circle3_p3 44 0 102 |
38 | vcircle circle3 circle3_p1 circle3_p2 circle3_p3 0 |
0499eb06 |
39 | vdimension diam3 -diameter -shapes circle3 -text 3d -plane zox -label hcenter -flyout 0 -label hfit -arrow fit |
1d7ca641 |
40 | |
fe83e1ea |
41 | # test that auto-fit for text places the label externally for small geometry |
1d7ca641 |
42 | vpoint circle4_p1 100 0 92 |
43 | vpoint circle4_p2 112 0 80 |
44 | vpoint circle4_p3 124 0 92 |
45 | vcircle circle4 circle4_p1 circle4_p2 circle4_p3 0 |
0499eb06 |
46 | vdimension diam4 -diameter -shapes circle4 -text 3d -plane zox -label hfit -flyout 0 -label hfit -arrow fit |
1d7ca641 |
47 | |
1d7ca641 |
48 | vfit |
49 | |
50 | # ------------------------------------------------ |
51 | # create dimension with different label positions |
52 | # ------------------------------------------------ |
53 | |
54 | vinit Viewer2/View2 |
55 | vright |
56 | |
57 | set idx 0 |
58 | for {set r 0} {$r < 3} {incr r} { |
59 | for {set c 0} {$c < 3} {incr c} { |
60 | |
61 | set point1 p_[expr "$idx * 3 + 0"] |
62 | set point2 p_[expr "$idx * 3 + 1"] |
63 | set point3 p_[expr "$idx * 3 + 2"] |
64 | set circle c_[expr "$idx"] |
65 | |
66 | vpoint $point1 [expr "80.0 * $c + 0"] 0.0 [expr "60.0 * $r + 22"] |
67 | vpoint $point2 [expr "80.0 * $c + 22"] 0.0 [expr "60.0 * $r + 0"] |
68 | vpoint $point3 [expr "80.0 * $c + 44"] 0.0 [expr "60.0 * $r + 22"] |
69 | vcircle $circle $point1 $point2 $point3 0 |
70 | |
71 | set dimension d_$idx |
72 | |
0499eb06 |
73 | vdimension $dimension -diameter -shapes $circle -text 3d -plane zox -label [lindex $hpos $c] [lindex $vpos $r] -arrow external -flyout 0.0 |
1d7ca641 |
74 | vdisplay $dimension |
75 | |
76 | incr idx |
77 | } |
78 | } |
79 | vfit |
80 | |
81 | set only_screen 1 |