File: bug23706_5

package info (click to toggle)
oce 0.17.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 297,992 kB
  • ctags: 203,291
  • sloc: cpp: 1,176,369; ansic: 67,206; sh: 11,647; tcl: 6,890; cs: 5,221; python: 2,867; java: 1,522; makefile: 338; xml: 292; perl: 37
file content (34 lines) | stat: -rw-r--r-- 1,204 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
puts "============"
puts "OCC23706"
puts "============"
puts ""
#########################################################################
# Cannot project point on curve
#########################################################################

2dbsplinecurve c1 2 5 0 3 0.2 1 0.3 1 0.4 1 0.5 3 2 0 1 3 -1 1 5 5 1 5 5 1 6 8 1 4 7 1
2dbsplinecurve c2 2 4 1 3 2 1 3 1 5 3 6 3 1 5 5 1 5 5 1 3 9 1 2 11 1
set info [2dintersect c1 c2]

if { [regexp "Intersection point 1" $info] != 1  } {
   puts "Error : Intersection should have two points"
} else {
   regexp {Intersection point 1 +: +([-0-9.+eE]+)} $info full p11
   regexp {Intersection point 1 +: +[-0-9.+eE]+ +([-0-9.+eE]+)} $info full p12
}

if { [regexp "Intersection point 2" $info] != 1  } {
   puts "Error : Intersection should have two points"
} else {
   regexp {Intersection point 2 +: +([-0-9.+eE]+)} $info full p21t
   regexp {Intersection point 2 +: +[-0-9.+eE]+ +([-0-9.+eE]+)} $info full p22t
}

set p21 [expr int($p21t)]
set p22 [expr int($p22t)]

if { ${p11} != 5 || ${p12} != 5 || ${p21} != 4 || ${p22} != 7 } {
    puts "Error : Points of intersection have wrong coordinates"
} else {
    puts "OK: Points of intersection are right"
}