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

Potential bug in Adaptor3d_CurveOnSurface.cxx

Cauchy Ding's picture

Thread has fixed a bug in Hunt function in Adaptor3d_CurveOnSurface.cxx.

But the logic in Hunt still has some problem especiall when Abs(Coord-Arr(i))==Tol.
The raw Hunt function is:
static void Hunt(const TColStd_Array1OfReal& Arr,
const Standard_Real Coord,
Standard_Integer& Iloc)
{//Warning: Hunt is used to find number of knot which equals co-ordinate component,
// when co-ordinate component definitly equals a knot only.
Standard_Real Tol=Precision::PConfusion()/10;
Standard_Integer i=1;

if(Abs(Coord-Arr(i)) Iloc = i;
if(Abs(Coord-Arr(i))>Tol) Standard_NotImplemented::Raise("Adaptor3d_CurveOnSurface:Hunt");
When Abs(Coord-Arr(i))==Tol, the Iloc has a undefined value, so it may cause crash in release version.