#include <StepGeom_Polyline.hxx>
#include <StepToGeom_MakePolyline.hxx>
#include <StepToGeom_MakeTrimmedCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_HArray1OfReal.hxx>
// STEP BSplineCurve before being mapped onto CAS.CADE/SF
if (SC->IsKind(STANDARD_TYPE(StepGeom_BezierCurve))) {
const Handle(StepGeom_BezierCurve) BzC = Handle(StepGeom_BezierCurve)::DownCast(SC);
+ Standard_Integer aDegree = BzC->Degree();
+ if (aDegree < 1 || aDegree > Geom_BSplineCurve::MaxDegree())
+ return Standard_False;
const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
- BSPL->SetDegree(BzC->Degree());
+ BSPL->SetDegree(aDegree);
BSPL->SetControlPointsList(BzC->ControlPointsList());
BSPL->SetCurveForm(BzC->CurveForm());
BSPL->SetClosedCurve(BzC->ClosedCurve());
}
if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve))) {
const Handle(StepGeom_UniformCurve) UC = Handle(StepGeom_UniformCurve)::DownCast(SC);
+ Standard_Integer aDegree = UC->Degree();
+ if (aDegree < 1 || aDegree > Geom_BSplineCurve::MaxDegree())
+ return Standard_False;
const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
- BSPL->SetDegree(UC->Degree());
+ BSPL->SetDegree(aDegree);
BSPL->SetControlPointsList(UC->ControlPointsList());
BSPL->SetCurveForm(UC->CurveForm());
BSPL->SetClosedCurve(UC->ClosedCurve());
if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve))) {
const Handle(StepGeom_QuasiUniformCurve) QUC =
Handle(StepGeom_QuasiUniformCurve)::DownCast(SC);
+ Standard_Integer aDegree = QUC->Degree();
+ if (aDegree < 1 || aDegree > Geom_BSplineCurve::MaxDegree())
+ return Standard_False;
const Handle(StepGeom_BSplineCurveWithKnots) BSPL = new StepGeom_BSplineCurveWithKnots;
- BSPL->SetDegree(QUC->Degree());
+ BSPL->SetDegree(aDegree);
BSPL->SetControlPointsList(QUC->ControlPointsList());
BSPL->SetCurveForm(QUC->CurveForm());
BSPL->SetClosedCurve(QUC->ClosedCurve());
if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve))) {
const Handle(StepGeom_UniformCurveAndRationalBSplineCurve) RUC =
Handle(StepGeom_UniformCurveAndRationalBSplineCurve)::DownCast(SC);
+ Standard_Integer aDegree = RUC->Degree();
+ if (aDegree < 1 || aDegree > Geom_BSplineCurve::MaxDegree())
+ return Standard_False;
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL =
new StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
// Compute Knots and KnotsMultiplicity
- const Standard_Integer nbK = RUC->NbControlPointsList() + RUC->Degree() + 1;
+ const Standard_Integer nbK = RUC->NbControlPointsList() + aDegree + 1;
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);
for (Standard_Integer iUC = 1 ; iUC <= nbK ; iUC ++) {
Knots->SetValue(iUC, iUC - 1.);
}
// Initialize the BSplineCurveWithKnotsAndRationalBSplineCurve
- RBSPL->Init(RUC->Name(), RUC->Degree(), RUC->ControlPointsList(), RUC->CurveForm(),
+ RBSPL->Init(RUC->Name(), aDegree, RUC->ControlPointsList(), RUC->CurveForm(),
RUC->ClosedCurve(), RUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
RUC->WeightsData());
return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve))) {
const Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve) RQUC =
Handle(StepGeom_QuasiUniformCurveAndRationalBSplineCurve)::DownCast(SC);
+ Standard_Integer aDegree = RQUC->Degree();
+ if (aDegree < 1 || aDegree > Geom_BSplineCurve::MaxDegree())
+ return Standard_False;
const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) RBSPL =
new StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
// Compute Knots and KnotsMultiplicity
- const Standard_Integer nbK = RQUC->NbControlPointsList() - RQUC->Degree() + 1;
+ const Standard_Integer nbK = RQUC->NbControlPointsList() - aDegree + 1;
const Handle(TColStd_HArray1OfInteger) Kmult = new TColStd_HArray1OfInteger(1,nbK);
const Handle(TColStd_HArray1OfReal) Knots = new TColStd_HArray1OfReal(1,nbK);
for (Standard_Integer iRQUC = 1 ; iRQUC <= nbK ; iRQUC ++) {
Kmult->SetValue(iRQUC, 1);
Knots->SetValue(iRQUC, iRQUC - 1.);
}
- Kmult->SetValue(1, RQUC->Degree() + 1);
- Kmult->SetValue(nbK, RQUC->Degree() + 1);
+ Kmult->SetValue(1, aDegree + 1);
+ Kmult->SetValue(nbK, aDegree + 1);
// Initialize the BSplineCurveWithKnotsAndRationalBSplineCurve
- RBSPL->Init(RQUC->Name(), RQUC->Degree(), RQUC->ControlPointsList(), RQUC->CurveForm(),
+ RBSPL->Init(RQUC->Name(), aDegree, RQUC->ControlPointsList(), RQUC->CurveForm(),
RQUC->ClosedCurve(), RQUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
RQUC->WeightsData());
return StepToGeom_MakeBSplineCurve::Convert(RBSPL,*((Handle(Geom_BSplineCurve)*)&CC));
set ref_data {
DATA : Faulties = 6 ( 0 ) Warnings = 0 ( 0 ) Summary = 6 ( 0 )
-TPSTAT : Faulties = 12 ( 238 ) Warnings = 470 ( 2526 ) Summary = 482 ( 2764 )
+TPSTAT : Faulties = 12 ( 238 ) Warnings = 470 ( 2529 ) Summary = 482 ( 2767 )
CHECKSHAPE : Wires = 3 ( 3 ) Faces = 3 ( 3 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
-NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1346 ( 1345 ) Summary = 22207 ( 22290 )
-STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1346 ( 1345 ) FreeWire = 96 ( 170 ) FreeEdge = 1061 ( 1061 ) SharedEdge = 9265 ( 9275 )
-TOLERANCE : MaxTol = 0.8630766579 ( 1.367916315 ) AvgTol = 0.00803262355 ( 0.008257993798 )
-LABELS : N0Labels = 27 ( 27 ) N1Labels = 2100 ( 6099 ) N2Labels = 0 ( 0 ) TotalLabels = 2127 ( 6126 ) NameLabels = 2127 ( 2596 ) ColorLabels = 2114 ( 6125 ) LayerLabels = 2114 ( 6125 )
+NBSHAPES : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1346 ( 1345 ) Summary = 22209 ( 22292 )
+STATSHAPE : Solid = 0 ( 0 ) Shell = 0 ( 0 ) Face = 1346 ( 1345 ) FreeWire = 96 ( 170 ) FreeEdge = 1061 ( 1061 ) SharedEdge = 9267 ( 9277 )
+TOLERANCE : MaxTol = 0.8099726869 ( 1.367966665 ) AvgTol = 0.008047307184 ( 0.008376960654 )
+LABELS : N0Labels = 27 ( 27 ) N1Labels = 2100 ( 6101 ) N2Labels = 0 ( 0 ) TotalLabels = 2127 ( 6128 ) NameLabels = 2127 ( 2596 ) ColorLabels = 2114 ( 6127 ) LayerLabels = 2114 ( 6127 )
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
NCOLORS : NColors = 11 ( 12 )
COLORS : Colors = BLUE1 CYAN1 CYAN2 DARKGOLDENROD GREEN MAGENTA1 PALEVIOLETRED1 RED TURQUOISE2 WHITE YELLOW ( BLUE1 CYAN1 CYAN2 DARKGOLDENROD GRAY53 GREEN MAGENTA1 PALEVIOLETRED1 RED TURQUOISE2 WHITE YELLOW )