For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

OCCT BSpline curve returning wrong or incorrect Knots vector from OCCT 7.2 version.

Vishwas Mane's picture

We use open cascade in C# code for reading STEP with XCAFDoc_ShapeTool (OCCCSharp library)

After reading STEP file when we iterate each entity, for Spline entities we are facing issue.

Suppose we have Ellipse hole(2 Spline curves) on sheet body. We get proper knot values for 1 Spline and for another Open cascade returning knot vector with same value as explained in below code snippet.

Attached sample file. 
BRepAdaptor_Curve adaptor = new BRepAdaptor_Curve(occEdge);
CurveType type = (CurveType)adaptor.GetCurveType();
 if (type == CurveType.GeomAbs_BSplineCurve)
                Geom_BSplineCurve spline = adaptor.BSpline();
                TColStd_Array1OfReal knotArray = new TColStd_Array1OfReal(0,spline.NbKnots()-1);
                spline.Knots(ref knotArray); // OpenCascade 7.2 returning same KnotArray values e.e (0, 0) or (1, 1, 1, 1, 1) . Before OCCT 7.2 upgrade it was working fine.

Need knot vector with correct values.

Vishwas Mane's picture

Can anyone please help me on this at the earliest? I am not able to find any API change or release notes info on Knot values. Or may be i am using it in wrong way.

Alexander Luger's picture

I think you are misusing the TColStd_Array1OfReal class, try it that way:

TColStd_Array1OfReal knotArray = new TColStd_Array1OfReal(1,spline.NbKnots())

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.