mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0031407: [Regression to 7.3.0] Extrema does not process parallel circles correctly
Use correct ranges of circles when processing the concentric case. Repeat the range comparison 3 times shifting each time for a half-period to process the extrema between boundary points of arcs.
This commit is contained in:
parent
e5c11edd7b
commit
d6e18114eb
@ -553,7 +553,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
|||||||
if ((aRange.Delta() > Precision::Angular()) &&
|
if ((aRange.Delta() > Precision::Angular()) &&
|
||||||
((aPar2 - aPar1) < Precision::Angular()))
|
((aPar2 - aPar1) < Precision::Angular()))
|
||||||
{
|
{
|
||||||
aPar1 -= aPeriod;
|
aPar2 += aPeriod;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -562,11 +562,13 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11,
|
|||||||
|
|
||||||
Standard_Real aMinSquareDist = RealLast();
|
Standard_Real aMinSquareDist = RealLast();
|
||||||
|
|
||||||
aProjRng1.Add(aPar1 - M_PI);
|
aProjRng1.Add(aPar1 - aPeriod);
|
||||||
aProjRng1.Add(aPar2 - M_PI);
|
aProjRng1.Add(aPar2 - aPeriod);
|
||||||
for (Standard_Integer i = 0; i < 2; i++)
|
for (Standard_Integer i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
// Repeat computation twice
|
// Repeat computation three times, shifting the range to PI on each step,
|
||||||
|
// to be able to find if the concentric arcs ranges are intersected in just one parameter
|
||||||
|
// (lower or upper boundary).
|
||||||
|
|
||||||
Bnd_Range aRng = aProjRng1;
|
Bnd_Range aRng = aProjRng1;
|
||||||
aRng.Common(aRange);
|
aRng.Common(aRange);
|
||||||
|
13
tests/bugs/modalg_7/bug31407_1
Normal file
13
tests/bugs/modalg_7/bug31407_1
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0031407: Extrema does not process parallel circles correctly"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
circle c1 0 0 0 0 0 1 5
|
||||||
|
circle c2 0 0 0 0 0 1 10
|
||||||
|
|
||||||
|
if { [regexp "Infinite number of extremas" [extrema c1 c2]] == 1} {
|
||||||
|
puts "OK : Circles are treated as concentric"
|
||||||
|
} else {
|
||||||
|
puts "Error : Extrema does not find the circles are parallel"
|
||||||
|
}
|
13
tests/bugs/modalg_7/bug31407_2
Normal file
13
tests/bugs/modalg_7/bug31407_2
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0031407: Extrema does not process parallel circles correctly"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
circle c1 0 0 0 0 0 -1 5
|
||||||
|
circle c2 0 0 0 0 0 1 10
|
||||||
|
|
||||||
|
if { [regexp "Infinite number of extremas" [extrema c1 c2]] == 1} {
|
||||||
|
puts "OK : Circles are treated as concentric"
|
||||||
|
} else {
|
||||||
|
puts "Error : Extrema does not find the circles are parallel"
|
||||||
|
}
|
20
tests/bugs/modalg_7/bug31407_3
Normal file
20
tests/bugs/modalg_7/bug31407_3
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0031407: Extrema does not process parallel circles correctly"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
circle c1 0 0 0 0 0 1 5
|
||||||
|
circle c2 0 0 0 0 0 1 10
|
||||||
|
|
||||||
|
trim cc1 c1 0 2
|
||||||
|
trim cc2 c2 2 4
|
||||||
|
|
||||||
|
set res_extrema [extrema cc1 cc2]
|
||||||
|
|
||||||
|
if { [regexp "Infinite number of extremas" $res_extrema] == 0} {
|
||||||
|
if {[llength $res_extrema] != 1} {
|
||||||
|
puts "Error : expected 1 extrema, but found [llength $res_extrema]"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
puts "Error : Infinite number of extremas is found"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user