1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0025163: Wrong result of common operation for faces.

Changes:
class BOPAlgo_WireSplitter
static function:
Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
                               const TopoDS_Edge& aE,
                               const TopoDS_Face& myFace,
                               const Standard_Real aA1,
                               const Standard_Real aA2,
                               Standard_Real& aA)
The contents of Domain 2D for the straight line has been changed.

class BOPTools_AlgoTools2D
method:
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
  (const TopoDS_Face& aF,
   const Standard_Real aFirst,
   const Standard_Real aLast,
   const Handle(Geom2d_Curve)& aC2D,
   Handle(Geom2d_Curve)& aC2DA)
The treatment of cylindrical surfaces has been changed taking into account
existing values of tolerances of the edges.

Test cases for issue CR25163
This commit is contained in:
pkv 2014-08-21 12:14:53 +04:00 committed by bugmaster
parent 1d33d22bd7
commit fc88faf18a
3 changed files with 78 additions and 2 deletions

View File

@ -1036,7 +1036,6 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV,
aLi=new Geom2d_Line(aPV, aDiri);
//
aGAC2.Load(aLi);
aDomain2.SetValues(aPV, 0., aTolInt, Standard_True);
//
aGInter.Perform(aGAC1, aDomain1, aGAC2, aDomain2, aTolInt, aTolInt);
if (!aGInter.IsDone()) {

View File

@ -71,6 +71,8 @@
#include <BOPTools.hxx>
#include <IntTools_Tools.hxx>
#include <gp_Cylinder.hxx>
#include <TopExp_Explorer.hxx>
static
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& );
@ -88,6 +90,8 @@ static
Standard_Real& ,
Standard_Real& ,
Standard_Boolean& );
static
Standard_Real MaxToleranceEdge (const TopoDS_Face& );
//=======================================================================
//function : BuildPCurveForEdgeOnFace
@ -314,14 +318,36 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace
u2 = pC2D.X();
v2 = pC2D.Y();
//
// du
du = 0.;
if (aBAS.IsUPeriodic()) {
Standard_Real newu;
aUPeriod = aBAS.UPeriod();
//
IntTools_Tools::AdjustPeriodic(u2, UMin, UMax, aUPeriod, newu, du);
//
if (du==0.) {
if (aBAS.GetType()==GeomAbs_Cylinder) {
Standard_Real aR, dFi, aTol;
//
gp_Cylinder aCylinder=aBAS.Cylinder();
aR=aCylinder.Radius();
aTol=MaxToleranceEdge(aF);
dFi=aTol/aR;
if (dFi<aDelta) {
dFi=aDelta;
}
//
mincond = (UMin - u2 > dFi);
maxcond = (u2 - UMax > dFi);
if (mincond || maxcond) {
du = ( mincond ) ? aUPeriod : -aUPeriod;
}
}
}
}
// dv
dv = 0.;
if (aBAS.IsVPeriodic()) {
@ -779,3 +805,23 @@ Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface
return nullPCurve;
}
//=======================================================================
//function : MaxToleranceEdge
//purpose :
//=======================================================================
Standard_Real MaxToleranceEdge (const TopoDS_Face& aF)
{
Standard_Real aTol, aTolMax;
TopExp_Explorer aExp;
//
aTolMax=0.;
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Edge& aE=*((TopoDS_Edge *)&aExp.Current());
aTol=BRep_Tool::Tolerance(aE);
if (aTol>aTolMax) {
aTolMax=aTol;
}
}
return aTolMax;
}

View File

@ -0,0 +1,31 @@
puts "============"
puts "OCC25163"
puts "============"
puts ""
###############################################################################################
# Wrong result of common operation for faces.
###############################################################################################
restore [locate_data_file bug25163_qf_25_39.brep] b
explode b f
copy b_1 b1
copy b_2 b2
bop b1 b2
bopcommon result
set square 3417.71
# Analysis of "nbshapes result"
set nb_v_good 4
set nb_e_good 4
set nb_w_good 1
set nb_f_good 1
set nb_sh_good 1
set nb_sol_good 0
set nb_compsol_good 0
set nb_compound_good 1
set nb_shape_good 12
set 2dviewer 1