Bug in BRep_Tool::UVBox in Brep_tool.cxx

I was browsing in the OCC source. ( Brep_tool.cxx, see code below)
Maybe I am mistaken but it seems that this function is always returning a static empty bounding box?
Are there 2 missing return statements here?

Kind regards,

Guido

//=======================================================================
//function : UVBox
//purpose : Gets the UV box of the edge on the surface.
//=======================================================================

static Bnd_Box2d* STATIC_box2d_p = NULL;

const Bnd_Box2d& BRep_Tool::UVBox(const TopoDS_Edge& E,
const Handle(Geom_Surface)& S,
const TopLoc_Location& L)
{
TopLoc_Location l = L.Predivided(E.Location());
Standard_Boolean Eisreversed = (E.Orientation() == TopAbs_REVERSED);

// find the representation
BRep_ListIteratorOfListOfCurveRepresentation itcr
((*((Handle(BRep_TEdge)*)&E.TShape()))->ChangeCurves());

while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();
if (cr->IsCurveOnSurface(S,l)) {
if (cr->IsCurveOnClosedSurface() && Eisreversed)
(*((Handle(BRep_CurveOnClosedSurface)*) &cr))->Box2();
else
(*((Handle(BRep_CurveOnSurface)*) &cr))->Box();
}
itcr.Next();
}
if (STATIC_box2d_p == NULL) STATIC_box2d_p = new Bnd_Box2d();
return (*STATIC_box2d_p);
}

Forum supervisor's picture

Dear Guido,
The specified problem has been eliminated in version OCCT 6.3.1 (bug ID = 20959) http://www.opencascade.com/pub/doc/Release_Notes_6.3.1.pdf.
We suggest you and all other users of OCCT to use the latest version of OCCT.
Regards
Forum supervisor