mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025706: SIGSEGV after making existing BSplineCurve rational
1. Eliminated exception after conversion non-rational B-spline to rational 2. Implemented DRAW command setweight to change weights of B-spline 3. Test cases were added
This commit is contained in:
@@ -1326,12 +1326,15 @@ void Geom2d_BSplineCurve::ValidateCache(const Standard_Real Parameter)
|
||||
//
|
||||
// check if the degree did not change
|
||||
//
|
||||
if (cachepoles->Upper() < deg + 1) {
|
||||
if (cachepoles->Upper() < deg + 1)
|
||||
cachepoles = new TColgp_HArray1OfPnt2d(1,deg + 1);
|
||||
if (rational) {
|
||||
cacheweights = new TColStd_HArray1OfReal(1,deg + 1);
|
||||
}
|
||||
if (rational)
|
||||
{
|
||||
if (cacheweights.IsNull() || cacheweights->Upper() < deg + 1)
|
||||
cacheweights = new TColStd_HArray1OfReal(1,deg + 1);
|
||||
}
|
||||
else if (!cacheweights.IsNull())
|
||||
cacheweights.Nullify();
|
||||
|
||||
BSplCLib::LocateParameter(deg,
|
||||
(flatknots->Array1()),
|
||||
|
Reference in New Issue
Block a user