5b14f800 |
1 | puts "========" |
2 | puts "CR24817" |
3 | puts "========" |
4 | puts "" |
5 | ######################################### |
6 | ## Can not sew two circular faces in non-manifold mode |
7 | ######################################### |
8 | |
9 | # Create first face |
10 | circle c 0 1 0 1 |
11 | trim c c 0.5*pi 1.5*pi |
12 | mkedge e1 c |
13 | line l 0 0 0 0 1 0 |
14 | trim l l 0 2 |
15 | mkedge e2 l |
16 | wire w e1 e2 |
17 | mkplane plane1 w |
18 | |
19 | # Create second face |
20 | circle c 0 1 0 1 |
21 | trim c c 1.5*pi 2.5*pi |
22 | mkedge e1 c |
23 | line l 0 0 0 0 1 0 |
24 | trim l l 0 2 |
25 | mkedge e2 l |
26 | wire w e1 e2 |
27 | mkplane plane2 w |
28 | |
29 | # Create third face |
30 | circle c 0 1 0 1 0 0 1 |
31 | trim c c 1.5*pi 2.5*pi |
32 | mkedge e1 c |
33 | line l 0 0 0 0 1 0 |
34 | trim l l 0 2 |
35 | mkedge e2 l |
36 | wire w e1 e2 |
37 | mkplane plane3 w |
38 | |
39 | # Sew faces |
40 | sewing sr1 plane1 plane2 +n |
41 | sewing sr2 plane1 plane2 plane3 +n |
42 | |
43 | # |
44 | set list1 [nbshapes sr1] |
45 | regexp {VERTEX +: +([-0-9.+eE]+)} ${list1} full nb_v1 |
46 | regexp {EDGE +: +([-0-9.+eE]+)} ${list1} full nb_e1 |
47 | regexp {WIRE +: +([-0-9.+eE]+)} ${list1} full nb_w1 |
48 | regexp {FACE +: +([-0-9.+eE]+)} ${list1} full nb_f1 |
49 | regexp {SHELL +: +([-0-9.+eE]+)} ${list1} full nb_sh1 |
50 | regexp {SOLID +: +([-0-9.+eE]+)} ${list1} full nb_sol1 |
51 | regexp {COMPSOLID +: +([-0-9.+eE]+)} ${list1} full nb_compsol1 |
52 | regexp {COMPOUND +: +([-0-9.+eE]+)} ${list1} full nb_compound1 |
53 | regexp {SHAPE +: +([-0-9.+eE]+)} ${list1} full nb_shape1 |
54 | |
55 | regexp {Mass +: +([-0-9.+eE]+)} [sprops sr1] full square1 |
56 | |
57 | set square1_good 3.14159 |
58 | set nb_v1_good 2 |
59 | set nb_e1_good 3 |
60 | set nb_w1_good 2 |
61 | set nb_f1_good 2 |
62 | set nb_sh1_good 1 |
63 | set nb_sol1_good 0 |
64 | set nb_compsol1_good 0 |
65 | set nb_compound1_good 0 |
66 | set nb_shape1_good 10 |
67 | |
68 | if { ${nb_v1} != ${nb_v1_good} |
69 | || ${nb_e1} != ${nb_e1_good} |
70 | || ${nb_w1} != ${nb_w1_good} |
71 | || ${nb_f1} != ${nb_f1_good} |
72 | || ${nb_sh1} != ${nb_sh1_good} |
73 | || ${nb_sol1} != ${nb_sol1_good} |
74 | || ${nb_compsol1} != ${nb_compsol1_good} |
75 | || ${nb_compound1} != ${nb_compound1_good} |
76 | || ${nb_shape1} != ${nb_shape1_good} } { |
77 | puts "Error 1: Number of shapes is faulty" |
78 | } |
79 | |
80 | if { ${square1} != ${square1_good} } { |
81 | puts "Error 2: Square is not valid" |
82 | } |
83 | |
84 | clear |
85 | smallview |
86 | donly sr1 |
87 | fit |
88 | xwd $imagedir/${test_image}_1.png |
89 | |
90 | # |
91 | set list2 [nbshapes sr2] |
92 | regexp {VERTEX +: +([-0-9.+eE]+)} ${list2} full nb_v2 |
93 | regexp {EDGE +: +([-0-9.+eE]+)} ${list2} full nb_e2 |
94 | regexp {WIRE +: +([-0-9.+eE]+)} ${list2} full nb_w2 |
95 | regexp {FACE +: +([-0-9.+eE]+)} ${list2} full nb_f2 |
96 | regexp {SHELL +: +([-0-9.+eE]+)} ${list2} full nb_sh2 |
97 | regexp {SOLID +: +([-0-9.+eE]+)} ${list2} full nb_sol2 |
98 | regexp {COMPSOLID +: +([-0-9.+eE]+)} ${list2} full nb_compsol2 |
99 | regexp {COMPOUND +: +([-0-9.+eE]+)} ${list2} full nb_compound2 |
100 | regexp {SHAPE +: +([-0-9.+eE]+)} ${list2} full nb_shape2 |
101 | |
102 | regexp {Mass +: +([-0-9.+eE]+)} [sprops sr2] full square2 |
103 | |
104 | set square2_good 4.71239 |
105 | set nb_v2_good 2 |
106 | set nb_e2_good 4 |
107 | set nb_w2_good 3 |
108 | set nb_f2_good 3 |
109 | set nb_sh2_good 1 |
110 | set nb_sol2_good 0 |
111 | set nb_compsol2_good 0 |
112 | set nb_compound2_good 0 |
113 | set nb_shape2_good 13 |
114 | |
115 | if { ${nb_v2} != ${nb_v2_good} |
116 | || ${nb_e2} != ${nb_e2_good} |
117 | || ${nb_w2} != ${nb_w2_good} |
118 | || ${nb_f2} != ${nb_f2_good} |
119 | || ${nb_sh2} != ${nb_sh2_good} |
120 | || ${nb_sol2} != ${nb_sol2_good} |
121 | || ${nb_compsol2} != ${nb_compsol2_good} |
122 | || ${nb_compound2} != ${nb_compound2_good} |
123 | || ${nb_shape2} != ${nb_shape2_good} } { |
124 | puts "Error 3: Number of shapes is faulty" |
125 | } |
126 | |
127 | if { ${square2} != ${square2_good} } { |
128 | puts "Error 4: Square is not valid" |
129 | } |
130 | |
131 | donly sr2 |
132 | fit |
133 | xwd $imagedir/${test_image}_2.png |