1puts "========" 2puts "OCC29712" 3puts "========" 4puts "" 5################################################# 6# Extrema algorithm raises exception 7################################################# 8 9# Curves c1 and c2 are concentric circles. 10# However, they are bounded (trimmed) curves 11# and are shifted relatively to each other. 12 13circle c1 0 0 0 0 0 1 100 14circle c2 0 0 0 0 0 1 50 15trim c1 c1 0 pi 16trim c2 c2 pi 2*pi 17 18smallview 19 20# Case 1 21 22don c1 c2 23 24foreach a [ directory ext_* ] { unset $a } 25extrema c1 c2 26if { [llength [ directory ext_* ] ] != 2 } { 27 puts "Error: Wrong number of solutions (c1 c2)" 28} 29 30fit 31checkview -2d -screenshot -path ${imagedir}/${test_image}_1.png 32 33regexp {The length ext_1 is +([-0-9.+eE]+)} [length ext_1] full l11 34regexp {The length ext_2 is +([-0-9.+eE]+)} [length ext_2] full l12 35 36if { $l11 > $l12} { 37 set tmp1 $l11 38 set l11 $l12 39 set l12 $tmp1 40} 41 42checkreal MinL1 $l11 50.0 1.0e-7 0.0 43checkreal MaxL1 $l12 150.0 1.0e-7 0.0 44 45# Case 2 46 47don c1 c2 48 49foreach a [ directory ext_* ] { unset $a } 50extrema c2 c1 51if { [llength [ directory ext_* ] ] != 2 } { 52 puts "Error: Wrong number of solutions (c2 c1)" 53} 54 55fit 56checkview -2d -screenshot -path ${imagedir}/${test_image}_2.png 57 58regexp {The length ext_1 is +([-0-9.+eE]+)} [length ext_1] full l21 59regexp {The length ext_2 is +([-0-9.+eE]+)} [length ext_2] full l22 60 61if { $l21 > $l22} { 62 set tmp2 $l11 63 set l21 $l22 64 set l22 $tmp2 65} 66 67checkreal MinL2 $l21 50.0 1.0e-7 0.0 68checkreal MaxL2 $l22 150.0 1.0e-7 0.0 69