Construction of edge from BSplineCurve

I would like to reproduce a B_SPLINE_CURVE_WITH_KNOTS entity from a STEP file as a Geom_BSplineCurve in OCCT. My function fails when the STEP bspline entity represents a straight line - typical example:
degree = 1
nbPoles = 2 (same as corresponding edge vertices)
knots = (0., 1.)
mults = (2, 2)

This seems to conflict with the OCCT Geom_BSplineCurve requirement of:
1 although it says in documentation: on non-periodic curve the first and last mults may be degree+1 (recommended if you want the curve to start and finish on the first and last pole).

The program does not return an error when the curve is constructed, however, when I make an edge using this curve and the two vertices (reproduced from the STEP file), an exception is raised.

Any thoughts would be appreciated.

Pawel's picture

Hi Christian,

I guess there is something wrong during the parameter initialization. I just tried creating a linear spline and it works.


chrisvdv's picture

Hi Pawel, thanks for your reply.
The problem appears to be one of precision. The STEP file has a small discrepency between the B-Spline pole coordinates and vertices that bound the corresponding edge. This caused the edge not to be built by the BRepBuilderAPI_MakeEdge object.
I will have to look into reasons for the differences.