1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-09 18:50:54 +03:00

0023733: PCurve for edge on face creation failure Adding test case for this fix

Signed-off-by: skv <skv@opencascade.com>
This commit is contained in:
skv 2013-02-15 16:55:25 +04:00
parent 3436ee9aed
commit 02cf3438e4
3 changed files with 74 additions and 7 deletions

View File

@ -228,8 +228,9 @@ Method:
Us = Sol.Value(NoSol);
Cu = ElCLib::Value(Us,C);
mySqDist[myNbExt] = Cu.SquareDistance(P);
myIsMin[myNbExt] = (NoSol == 1);
myPoint[myNbExt] = Extrema_POnCurv(Us,Cu);
Cu = ElCLib::Value(Us + 0.1, C);
myIsMin[myNbExt] = mySqDist[myNbExt] < Cu.SquareDistance(P);
myNbExt++;
}
myDone = Standard_True;

View File

@ -365,7 +365,13 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P)
newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * M_PI);
if (newV > myvsup) {
newV = myvsup;
newV -= 2. * M_PI;
if (newV + mytolv < myvinf) {
newV = myvsup;
} else if (newV < myvinf) {
newV = myvinf;
}
}
}
V = newV;
@ -384,8 +390,15 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P)
(anACurve->GetType() == GeomAbs_Ellipse)) {
newV = ElCLib::InPeriod(V, myvsup - 2. * M_PI, myvsup);
if(newV < myvinf)
newV = myvinf;
if(newV < myvinf) {
newV += 2. * M_PI;
if (newV - mytolv > myvsup) {
newV = myvinf;
} else if (newV > myvsup) {
newV = myvsup;
}
}
}
V = newV;
@ -424,7 +437,13 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P)
newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * M_PI);
if (newV > myvsup) {
newV = myvsup;
newV -= 2. * M_PI;
if (newV + mytolv < myvinf) {
newV = myvsup;
} else if (newV < myvinf) {
newV = myvinf;
}
}
}
V = newV;
@ -440,8 +459,15 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P)
(anACurve->GetType() == GeomAbs_Ellipse)) {
newV = ElCLib::InPeriod(V, myvsup - 2. * M_PI, myvsup);
if(newV < myvinf)
newV = myvinf;
if(newV < myvinf) {
newV += 2. * M_PI;
if (newV - mytolv > myvsup) {
newV = myvinf;
} else if (newV > myvsup) {
newV = myvsup;
}
}
}
V = newV;

40
tests/bugs/moddata/bug23733 Executable file
View File

@ -0,0 +1,40 @@
puts "================"
puts "CR23733"
puts "================"
puts ""
###############################################
## PCurve for edge on face creation failure
###############################################
pload DCAF TOPTEST
Open [locate_data_file bug_glue_edges_GEOM.sgd] D
GetShape D 0:1:9686:1:1:2 s1
GetShape D 0:1:9449:1:1:2 s2
explode s1 e
explode s2 f
#should create pcurve
bhaspc s1_100 s2_2 do
#should report OK
set info1 [bhaspc s1_100 s2_2]
if { [regexp {No} ${info1}] == 1 } {
puts "Faulty: No 2D curves detected"
}
#should create pcurve
bhaspc s1_40 s2_54 do
#should report OK
set info2 [bhaspc s1_40 s2_54]
if { [regexp {No} ${info2}] == 1 } {
puts "Faulty: No 2D curves detected"
}
#should create pcurve
bhaspc s1_22 s2_123 do
#should report OK
set info3 [bhaspc s1_22 s2_123]
if { [regexp {No} ${info3}] == 1 } {
puts "Faulty: No 2D curves detected"
}