1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0026560: BRepBndLib build too large bounding box in Z direction for planar spline edge.

Poles bounding box for curve added for bezier and bspline curves.
Method Poles() for Bezier curve added.

Test case for issue CR26560

Function to compute subshape max tolerance has been added.
Fixed bounding box expanding at Face/Face step of boolean operation.
Test cases are updated to the new behavior.
This commit is contained in:
aml
2015-10-08 09:39:35 +03:00
committed by bugmaster
parent a521d90d5a
commit bcd1975693
18 changed files with 194 additions and 22 deletions

View File

@@ -1538,3 +1538,41 @@ Standard_Boolean IsPlane(const Handle(Geom_Surface)& aS)
return bRet;
}
//=======================================================================
//function : MaxTolerance
//purpose :
//=======================================================================
Standard_Real BRep_Tool::MaxTolerance (const TopoDS_Shape& theShape,
const TopAbs_ShapeEnum theSubShape)
{
Standard_Real aTol = 0.0;
// Explorer Shape-Subshape.
TopExp_Explorer anExpSS(theShape, theSubShape);
if (theSubShape == TopAbs_FACE)
{
for( ; anExpSS.More() ; anExpSS.Next() )
{
const TopoDS_Shape& aCurrentSubShape = anExpSS.Current();
aTol = Max(aTol, Tolerance(TopoDS::Face(aCurrentSubShape)));
}
}
else if (theSubShape == TopAbs_EDGE)
{
for( ; anExpSS.More() ; anExpSS.Next() )
{
const TopoDS_Shape& aCurrentSubShape = anExpSS.Current();
aTol = Max(aTol, Tolerance(TopoDS::Edge(aCurrentSubShape)));
}
}
else if (theSubShape == TopAbs_VERTEX)
{
for( ; anExpSS.More() ; anExpSS.Next() )
{
const TopoDS_Shape& aCurrentSubShape = anExpSS.Current();
aTol = Max(aTol, Tolerance(TopoDS::Vertex(aCurrentSubShape)));
}
}
return aTol;
}

View File

@@ -1,4 +1,4 @@
// Created on: 1993-07-07
;// Created on: 1993-07-07
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
@@ -31,6 +31,7 @@
#include <Poly_Polygon3D.hxx>
#include <Poly_Polygon2D.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <TopAbs_ShapeEnum.hxx>
class TopoDS_Shape;
class TopoDS_Face;
@@ -237,6 +238,11 @@ public:
//! Returns the parameters of the vertex on the face.
Standard_EXPORT static gp_Pnt2d Parameters (const TopoDS_Vertex& V, const TopoDS_Face& F);
//! Returns the maximum tolerance of input shape subshapes.
//@param theShape - Shape to search tolerance.
//@param theSubShape - Search subshape, only Face, Edge or Vertex are supported.
Standard_EXPORT static Standard_Real MaxTolerance (const TopoDS_Shape& theShape, const TopAbs_ShapeEnum theSubShape);
};
#endif // _BRep_Tool_HeaderFile