0024275: Cppcheck warnings on uninitialized class members
[occt.git] / tests / geometry / begin
CommitLineData
18e25fc9 1if { [array get Draw_Groups "TOPOLOGY Check commands"] == "" } {
2 pload TOPTEST
3 pload AISV
4}
5# To prevent loops limit to 10 minutes
6cpulimit 600
7
8if { [info exists imagedir] == 0 } {
9 set imagedir .
10}
11
12if { [info exists test_image ] == 0 } {
13 set test_image photo
14}
15
16
17#
18#evaluate n points beetween u1 and u2 on the curve 2d c
19#
20
21proc val2d { c u1 u2 n } {
22
23 dset du ($u2-$u1)/$n
24 upvar $c cc
25
26 set i 1
27
28 for {dset u $u1} { [dval u] <= $u2} {dset u ($u1+$i*[dval du])} {
29 2dcvalue cc u x y dx dy d2x d2y ;
30 global p_$i d1_$i d2_$i
31 point p_$i x y;
32 puts "u = [dval u]"
33 puts "p_$i [dval x ] [dval y]"
34 puts "d1_$i [dval dx ] [dval dy]";
35 puts "d2_$i [dval d2x] [dval d2y]";
36
37 copy p_$i . ;
38 point d1_$i dx dy
39 point d2_$i d2x d2y
40 incr i 1
41 }
42}
43
44#
45#evaluate n points beetween u1 and u2 on the curve 3d c
46#
47proc val3d { c u1 u2 n } {
48
49 dset du ($u2-$u1)/$n
50 upvar $c cc
51
52 set i 1
53
54 for {dset u $u1} { [dval u] <= $u2} {dset u (u+[dval du])} {
55 cvalue cc u x y z dx dy dz d2x d2y d2z ;
56 point p_$i x y z;
57 puts "u = [dval u]"
58 puts "p_$i [dval x ] [dval y ] [dval z]";
59 puts "d1_$i [dval dx ] [dval dy ] [dval dz]";
60 puts "d2_$i [dval d2x] [dval d2y] [dval d2z]";
61 copy p_$i . ;
62 point d1_$i dx dy dz
63 point d2_$i d2x d2y d2z
64 incr i
65 }
66}
67
68proc compare {r1 r2 tol} {
69 if {$r1 - $r2 >= $tol} {
70 puts "Error : evalution"
71 }
72 if {$r2 - $r1 >= $tol} {
73 puts "Error : evalution"
74 }
75}
76
77proc comparepnt2d {p1 p2 tol} {
78 upvar $p1 pp1
79 upvar $p2 pp2
80 coord pp1 x1 y1
81 coord pp2 x2 y2
82 compare [dval x1] [dval x2] $tol
83 compare [dval y1] [dval y2] $tol
84}
85
86proc comparepnt3d {p1 p2 tol} {
87 upvar $p1 pp1
88 upvar $p2 pp2
89 coord pp1 x1 y1 z1
90 coord pp2 x2 y2 z2
91 compare [dval x1] [dval x2] $tol
92 compare [dval y1] [dval y2] $tol
93 compare [dval z1] [dval z2] $tol
94}
95