1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0033179: Modeling Algorithms - Crash in ShapeFix_Shape with the attached object, when healing for fixing SameParameterFlag

BSplCLib_2.cxx - method MergeBSplineKnots is modified in order to have always not empty result.
Geom2dConvert.cxx - in static function MultNumandDenom tolerance for comparing knots is decreased.

tests/bugs/modalg_8/bug33179 test case added
This commit is contained in:
ifv 2022-10-24 12:25:03 +03:00 committed by vglukhik
parent 1eb623f2ba
commit 8c7a2aa65f
3 changed files with 78 additions and 72 deletions
src
BSplCLib
Geom2dConvert
tests/bugs/modalg_8

@ -1234,5 +1234,20 @@ void BSplCLib::MergeBSplineKnots
}
NumPoles = index - degree - 1;
}
else
{
degree = Degree1 + Degree2;
num_knots = 2;
NewKnots =
new TColStd_HArray1OfReal(1, num_knots);
NewKnots->ChangeArray1()(1) = StartValue;
NewKnots->ChangeArray1()(num_knots) = EndValue;
NewMults =
new TColStd_HArray1OfInteger(1, num_knots);
NewMults->ChangeArray1()(1) = degree + 1;
NewMults->ChangeArray1()(num_knots) = degree + 1;
NumPoles = BSplCLib::NbPoles(degree, Standard_False, NewMults->Array1());
}
}

@ -515,7 +515,6 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu
Handle(TColStd_HArray1OfReal) resKnots;
Handle(TColStd_HArray1OfInteger) resMults;
Standard_Real start_value,end_value;
Standard_Real tolerance=Precision::Confusion();
Standard_Integer resNbPoles,degree,
ii,jj,
aStatus;
@ -527,6 +526,7 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu
BS->KnotSequence(BSFlatKnots);
start_value = BSKnots(1);
end_value = BSKnots(BS->NbKnots());
Standard_Real tolerance = 10.*Epsilon(Abs(end_value));
a->Knots(aKnots);
a->Poles(aPoles);
@ -565,22 +565,6 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu
degree,
resDenPoles,
aStatus);
// BSplCLib::FunctionMultiply(law_evaluator,
// BS->Degree(),
// BSFlatKnots,
// BSPoles,
// resFlatKnots,
// degree,
// resNumPoles,
// aStatus);
// BSplCLib::FunctionMultiply(law_evaluator,
// BS->Degree(),
// BSFlatKnots,
// BSWeights,
// resFlatKnots,
// degree,
// resDenPoles,
// aStatus);
for (ii=1;ii<=resNbPoles;ii++)
for(jj=1;jj<=2;jj++)
resPoles(ii).SetCoord(jj,resNumPoles(ii).Coord(jj)/resDenPoles(ii));
@ -1339,7 +1323,6 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
Curve1Poles(ii).SetCoord(jj,Curve1Poles(ii).Coord(jj)*Curve1Weights(ii));
//POP pour NT
Geom2dConvert_reparameterise_evaluator ev (aPolynomialCoefficient);
// BSplCLib::FunctionReparameterise(reparameterise_evaluator,
BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(),
Curve1FlatKnots,
@ -1350,7 +1333,6 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
aStatus
);
TColStd_Array1OfReal NewWeights(1, FlatKnots.Length() - (aNewCurveDegree + 1));
// BSplCLib::FunctionReparameterise(reparameterise_evaluator,
BSplCLib::FunctionReparameterise(ev,
Curve1->Degree(),
Curve1FlatKnots,

@ -0,0 +1,9 @@
puts "================================"
puts "0033179: Modeling Algorithms - Crash in in ShapeFix_Shape with the attached object, when healing for fixing SameParameterFlag"
puts "================================"
restore [locate_data_file bug33179.brep] s
fsameparameter s
checkshape s