mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0025024: BSplCLib::PrepareInsertKnots reports incorrect number of poles
Added test bugs fclasses bug25024
This commit is contained in:
parent
34028c1ff3
commit
c1c03615f6
@ -1702,6 +1702,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots
|
|||||||
ak++;
|
ak++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Standard_Integer aLastKnotMult = Mults (Knots.Upper());
|
||||||
Standard_Real au,oldau = AddKnots(ak),Eps;
|
Standard_Real au,oldau = AddKnots(ak),Eps;
|
||||||
|
|
||||||
while (ak <= AddKnots.Upper()) {
|
while (ak <= AddKnots.Upper()) {
|
||||||
@ -1741,7 +1742,15 @@ Standard_Boolean BSplCLib::PrepareInsertKnots
|
|||||||
}
|
}
|
||||||
else if (amult > mult) {
|
else if (amult > mult) {
|
||||||
if (amult > Degree) amult = Degree;
|
if (amult > Degree) amult = Degree;
|
||||||
sigma += amult - mult;
|
if (k == Knots.Upper () && Periodic)
|
||||||
|
{
|
||||||
|
aLastKnotMult = Max (amult, mult);
|
||||||
|
sigma += 2 * (aLastKnotMult - mult);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sigma += amult - mult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
// on periodic curves if this is the last knot
|
// on periodic curves if this is the last knot
|
||||||
@ -1779,7 +1788,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots
|
|||||||
//instance);
|
//instance);
|
||||||
//respectively AddMults() must meet this requirement if AddKnots() contains
|
//respectively AddMults() must meet this requirement if AddKnots() contains
|
||||||
//knot(s) coincident with first or last
|
//knot(s) coincident with first or last
|
||||||
NbPoles = sigma - Mults(Knots.Upper());
|
NbPoles = sigma - aLastKnotMult;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
NbPoles = sigma - Degree - 1;
|
NbPoles = sigma - Degree - 1;
|
||||||
@ -1968,7 +1977,8 @@ void BSplCLib::InsertKnots
|
|||||||
if (Periodic) {
|
if (Periodic) {
|
||||||
// on periodic curve the first and last knot are delayed to the end
|
// on periodic curve the first and last knot are delayed to the end
|
||||||
if (curk == Knots.Lower() || (curk == Knots.Upper())) {
|
if (curk == Knots.Lower() || (curk == Knots.Upper())) {
|
||||||
firstmult += depth;
|
if (firstmult == 0) // do that only once
|
||||||
|
firstmult += depth;
|
||||||
depth = 0;
|
depth = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
tests/bugs/fclasses/bug25024
Normal file
11
tests/bugs/fclasses/bug25024
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC25024"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# BSplCLib::PrepareInsertKnots reports incorrect number of poles
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug25024_wires.brep] w
|
||||||
|
explode w
|
||||||
|
thrusections r 0 0 w_1 w_2
|
Loading…
x
Reference in New Issue
Block a user