Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Potential bug in Adaptor3d_CurveOnSurface.cxx

Potential bug in Adaptor3d_CurveOnSurface.cxx
Cauchy Ding 2012/09/07 18:26
Thread http://www.opencascade.org/org/forum/thread_20187/?forum=3 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;
while((i<=Arr.Upper())&&(Abs(Coord-Arr(i))>Tol)){
i++;}

if(Abs(Coord-Arr(i))<Tol)
Iloc = i;
else
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.

Thanks.
Ding
 
 
Latest news
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map