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()) {
#include <BOPTools.hxx>
#include <IntTools_Tools.hxx>
+#include <gp_Cylinder.hxx>
+#include <TopExp_Explorer.hxx>
static
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& );
Standard_Real& ,
Standard_Real& ,
Standard_Boolean& );
+static
+ Standard_Real MaxToleranceEdge (const TopoDS_Face& );
//=======================================================================
//function : BuildPCurveForEdgeOnFace
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()) {
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;
+}
--- /dev/null
+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