gp_Pnt& aPOut,
Handle(IntTools_Context)& theContext,
GeomAPI_ProjectPointOnSurf& aProjPL,
- const Standard_Real aDt);
+ const Standard_Real aDt,
+ const Standard_Real aTolE);
static
Standard_Real MinStep3D(const TopoDS_Edge& theE1,
const TopoDS_Face& theF1,
GeomAPI_ProjectPointOnSurf& aProjPL,
const Standard_Real aDt)
{
+ Standard_Real aTolE;
+ gp_Pnt aPx;
+ //
BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN);
if (aF.Orientation()==TopAbs_REVERSED){
aDN.Reverse();
}
+ //
+ aTolE=BRep_Tool::Tolerance(aE);
aDB = aDN^aDTgt;
//
- gp_Pnt aPx;
- if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt)) {
+ if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt, aTolE)) {
BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx,
aDN, theContext);
aProjPL.Perform(aPx);
aDB.SetXYZ(aVec.XYZ());
}
}
-
//=======================================================================
//function : FindPointInFace
//purpose : Find a point in the face in direction of <aDB>
gp_Pnt& aPOut,
Handle(IntTools_Context)& theContext,
GeomAPI_ProjectPointOnSurf& aProjPL,
- const Standard_Real aDt)
+ const Standard_Real aDt,
+ const Standard_Real aTolE)
{
Standard_Integer aNbItMax;
Standard_Real aDist, aDTol, aPM;
Standard_Boolean bRet;
- gp_Pnt aP1;
+ gp_Pnt aP1, aPS;
//
aDTol = Precision::Angular();
aPM = aP.XYZ().Modulus();
//
GeomAPI_ProjectPointOnSurf& aProj=theContext->ProjPS(aF);
//
+ aPS=aP;
+ aProj.Perform(aPS);
+ if (!aProj.IsDone()) {
+ return bRet;
+ }
+ aPS=aProj.NearestPoint();
+ aProjPL.Perform(aPS);
+ aPS=aProjPL.NearestPoint();
+ //
+ aPS.SetXYZ(aPS.XYZ()+2.*aTolE*aDB.XYZ());
+ aProj.Perform(aPS);
+ if (!aProj.IsDone()) {
+ return bRet;
+ }
+ aPS=aProj.NearestPoint();
+ aProjPL.Perform(aPS);
+ aPS=aProjPL.NearestPoint();
+ //
+ //
do {
- aP1.SetCoord(aP.X()+aDt*aDB.X(),
- aP.Y()+aDt*aDB.Y(),
- aP.Z()+aDt*aDB.Z());
+ aP1.SetXYZ(aPS.XYZ()+aDt*aDB.XYZ());
//
aProj.Perform(aP1);
if (!aProj.IsDone()) {
aProjPL.Perform(aPOut);
aPOut = aProjPL.NearestPoint();
//
- gp_Vec aV(aP, aPOut);
+ gp_Vec aV(aPS, aPOut);
aDB.SetXYZ(aV.XYZ());
} while (aDist > aDTol && --aNbItMax);
//
//function : IsInvertedSolid
//purpose :
//=======================================================================
-Standard_Boolean
- BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& aSolid)
+Standard_Boolean BOPTools_AlgoTools::IsInvertedSolid
+ (const TopoDS_Solid& aSolid)
{
Standard_Real aTolS;
TopAbs_State aState;
--- /dev/null
+puts "============"
+puts "OCC25432"
+puts "============"
+puts ""
+#########################################################################
+# Wrong result obtained by MakerVolume operator.
+#########################################################################
+
+restore [locate_data_file bug25432_qz.brep] q
+
+explode q f
+mkvolume result q_1 q_2 q_3 q_4 q_5 q_6 q_7 q_8 q_9 q_10 q_11 -ni
+
+regexp {Mass +: +([-0-9.+eE]+)} [vprops result] full volume
+
+set expected_volume 0.26776
+set tol_abs_volume 1.0e-4
+set tol_rel_volume 0.0001
+checkreal "Volume" ${volume} ${expected_volume} ${tol_abs_volume} ${tol_rel_volume}
+
+set square 3.59972
+
+set nb_v_good 12
+set nb_e_good 20
+set nb_w_good 11
+set nb_f_good 11
+set nb_sh_good 2
+set nb_sol_good 2
+set nb_compsol_good 0
+set nb_compound_good 1
+set nb_shape_good 59
+
+set 2dviewer 1