Extrema_ExtPC2d fails to find min distance for straight BSpline line and point lying on line

I have a high-degree bspline going straight from (0,s) to (0,-s) and I'm using Extrema_ExtPC2d to project the starting point of the BSpline itself onto it (actually BRepBuilderAPI_MakeEdge2d is doing that) and the routine fails to find the minimum parameter. The ExtPC2d object ends up in state "done", but claims there are no extremal values. This screws up BRepProj_Projector initialization. The BSpline was created by ProjLib_ProjectOnPlane.

The problem seems to be connected to the given tolerance (though using a tolerance as big as 1.0 does not solve the problem) as well as the fact that the spline contains coincident poles. I tried to reproduce the problem using reduced degree splines as well as reduced multiplicities in the knot vector - without a clear result. Could someone please have a look if this a bug in ExtPC2d or an inevitable instability of the ExtPC2d algorithm for such high-degree, partly-degenerated splines? What's arousing my suspicion about a bug in ExtPC2d is, that it ends up in state "done" without providing a minimum - though there should always be at least one point on the curve being closest to a specific point...

Attached is source code reproducing the problem by creating the spline and running ExtPC2d on it.

Fabian Hachenberg's picture

(sorry, correction: it screws up BRepBuilderAPI_MakeEdge2d initialization)