mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0031402: Modeling Data - Geom_BSplineSurface::Segment() produces wrong result
In the method Segment() index1 needs to be checked as well as index2 in Geom_BSplineSurface and Geom2d_BSplineCurve (Geom_BSplineCurve already has this check). New test cases bug31402_1, bug31402_2 has been added. The unnecessary code block in Geom2d_BSplineCurve has been deleted, and checking index2 block has beed extended.
This commit is contained in:
@@ -619,9 +619,11 @@ void Geom_BSplineSurface::segment(const Standard_Real U1,
|
||||
Standard_Integer ToU2 = uknots->Upper();
|
||||
BSplCLib::LocateParameter(udeg, uknots->Array1(), umults->Array1(),
|
||||
NewU1, uperiodic, FromU1, ToU2, index1U, U);
|
||||
if (Abs(uknots->Value(index1U + 1) - U) <= EpsU)
|
||||
index1U++;
|
||||
BSplCLib::LocateParameter(udeg, uknots->Array1(), umults->Array1(),
|
||||
NewU1 + deltaU, uperiodic, FromU1, ToU2, index2U, U);
|
||||
if (Abs(uknots->Value(index2U + 1) - U) <= EpsU)
|
||||
if (Abs(uknots->Value(index2U + 1) - U) <= EpsU || index2U == index1U)
|
||||
index2U++;
|
||||
|
||||
Standard_Integer nbuknots = index2U - index1U + 1;
|
||||
@@ -659,9 +661,11 @@ void Geom_BSplineSurface::segment(const Standard_Real U1,
|
||||
Standard_Integer ToV2 = vknots->Upper();
|
||||
BSplCLib::LocateParameter(vdeg, vknots->Array1(), vmults->Array1(),
|
||||
NewV1, vperiodic, FromV1, ToV2, index1V, V);
|
||||
if (Abs(vknots->Value(index1V + 1) - V) <= EpsV)
|
||||
index1V++;
|
||||
BSplCLib::LocateParameter(vdeg, vknots->Array1(), vmults->Array1(),
|
||||
NewV1 + deltaV, vperiodic, FromV1, ToV2, index2V, V);
|
||||
if (Abs(vknots->Value(index2V + 1) - V) <= EpsV)
|
||||
if (Abs(vknots->Value(index2V + 1) - V) <= EpsV || index2V == index1V)
|
||||
index2V++;
|
||||
|
||||
Standard_Integer nbvknots = index2V - index1V + 1;
|
||||
|
Reference in New Issue
Block a user