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