1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/tests/lowalgos/2dinter/bug23706_4
nbv 4fe725a46a 0027976: Unstable work of 2d intersection algorithm for two lines
1. Test case for the issue has been created.
The problem is still reproduced on MASTER.

2. Some test cases have been moved to lowalgos/2dinter grid.
2018-12-21 15:38:03 +03:00

38 lines
1.3 KiB
Plaintext

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 c3 2 4 1 3 2 1 3 1 5 3 6 3 1 5.001 5.01 1 5.001 5.01 1 3 9 1 2 11 1
set info [2dintersect c1 c3]
if { [regexp "Intersection point 1" $info] != 1 } {
puts "Error : Intersection should have two points"
} else {
regexp {Intersection point 1 +: +([-0-9.+eE]+)} $info full p11t
regexp {Intersection point 1 +: +[-0-9.+eE]+ +([-0-9.+eE]+)} $info full p12t
}
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 p11 [expr round($p11t*10000)]
set p12 [expr round($p12t*10000)]
set p21 [expr round($p21t*10000)]
set p22 [expr round($p22t*10000)]
if { ${p11} != 50024 || ${p12} != 50072 || ${p21} != 40024 || ${p22} != 70012 } {
puts "Error : Points of intersection have wrong coordinates"
} else {
puts "OK: Points of intersection are right"
}