2 if { [info exists command] && [string compare $command "mkoffset"] == 0 } {
3 regexp {Mass +: +([-0-9.+eE]+)} [lprops s] full sm
4 regexp {Tolerance +MAX=([-0-9.+eE]+) +AVG=([-0-9.+eE]+) +MIN=[-0-9.+eE]+} [tolerance s] full MaxTol_s AvgTol_s
5 puts "Length of shape a is equal to $sm"
6 set theOff [expr $sm * $off_param ]
7 puts [format "Considered Offset value is %s " $theOff]
8 if { ![catch { mkoffset result s 1 $theOff } catch_res] } {
9 renamevar result_1 result
10 if { ![catch { set chsh [checkshape result] } catch_chsh] } {
13 puts "Error : $catch_chsh"
17 checkprops result -l ${length}
20 if { [isdraw result] && $mist == 0} {
21 if { [info exists command] && [string compare $command "mkoffset"] == 0 } {
22 regexp {Mass +: +([-0-9.+eE]+)} [lprops result] full m
23 set vertex_list [explode result v]
24 set ll_v [llength $vertex_list]
25 set edge_list [explode result e]
26 set ll_e [llength $edge_list]
28 set wire_list [explode result w]
29 if { [string compare $wire_list ""] == 0} {
32 set ll_w [llength $wire_list]
36 puts [format "Warning : The resulting shape is an empty COMPOUND"]
38 puts [format "Error : The resulting shape is an empty COMPOUND"]
41 puts [checksection result]
43 puts [format "The resulting shape contains %s wires" $ll_w]
44 foreach wire $wire_list {
45 puts "Info for $wire:"
46 regexp {Tolerance +MAX=([-0-9.+eE]+) +AVG=([-0-9.+eE]+) +MIN=[-0-9.+eE]+} [tolerance $wire] full MaxTol_res AvgTol_res
47 if { $MaxTol_res > $MaxTol_s } {
48 puts "Error : big tolerance of shape $wire"
50 regexp {nb +alone +Vertices +: +([-0-9.+eE]+)} [checksection $wire] full num
52 puts [format "Error : $wire is NOT a closed wire"]
54 mkplane res_plane $wire
55 set chsh_res_plane [checkshape res_plane]
56 if { [regexp {Faulty +shapes +in +variables +faulty_([-0-9.+eE]+) +to +faulty_([-0-9.+eE]+)} $chsh_res_plane full from_faulty to_faulty ] } {
57 puts "Shape $wire has self-intersection"
62 # check for number of vertexes
63 if { [info exists nbsh_v ] } {
64 if { ($ll_v != $nbsh_v) || ($nbsh_v == 0 && $ll_v != 0) } {
65 puts "Error : The resulting shape is WRONG because it must contain $nbsh_v vertexes instead of $ll_v"
67 puts "The resulting shape contains $ll_v vertexes"
70 # check for number of edges
71 if { [info exists nbsh_e ] } {
72 if { ($ll_e != $nbsh_e) || ($nbsh_e == 0 && $ll_e != 0) } {
73 puts "Error : The resulting shape is WRONG because it must contain $nbsh_e edges instead of $ll_e"
75 puts "The resulting shape contains $ll_e edges"
78 # check for number of wires
79 if { [info exists nbsh_w ] } {
80 if { ($ll_w != $nbsh_w) || ($nbsh_w == 0 && $ll_w != 0) } {
81 puts "Error : The resulting shape is WRONG because it must contain $nbsh_w wires instead of $ll_w"
83 puts "The resulting shape contains $ll_w wires"
86 } elseif {[info exists command] && [string compare $command "withintersect"] == 0} {
87 regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
90 #check if result is valid
91 puts [checkshape result]
93 regexp {Mass +: +([-0-9.+eE]+)} [vprops result] full m
95 #check of face's area value
96 foreach ResultFace [ explode result f ] {
97 regexp {Mass +: +([-0-9.+eE]+)} [sprops $ResultFace] full fmass
99 puts "Error : The area of face $ResultFace of the resulting shape is negative."
103 if { [info exists GlobFaces] && [llength $GlobFaces] == 0 } {
104 puts [ bsection re result s ]
105 if { [ isdraw re ] } {
106 regexp {Mass +: +([-0-9.+eE]+)} [lprops $re] full remass
107 if { $remass != 0 } {
108 puts "Error: bsection of the result and s is not equal to zero."
114 if {[info exists result_unif]} {
115 checkview -display result_unif -2d -path ${imagedir}/${test_image}.png
117 checkview -display result -2d -path ${imagedir}/${test_image}.png
121 puts "Error : The offset cannot be built."
124 # to end a test script
125 puts "TEST COMPLETED"