mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0025432: Wrong result obtained by MakerVolume operator.
Changes: class BOPTools_AlgoTools static function: Standard_Boolean FindPointInFace(const TopoDS_Face& aF, const gp_Pnt& aP, gp_Dir& aDB, gp_Pnt& aPOut, Handle(IntTools_Context)& theContext, GeomAPI_ProjectPointOnSurf& aProjPL, const Standard_Real aDt, const Standard_Real aTolE) Binormal calculation starts from the point located outside the tolerance circle of the edge Test case for issue CR25432 Correction of test cases for issue CR25432
This commit is contained in:
parent
7da00517d4
commit
393598ebd6
@ -99,7 +99,8 @@ static
|
||||
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,
|
||||
@ -1825,14 +1826,18 @@ void GetFaceDir(const TopoDS_Edge& aE,
|
||||
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);
|
||||
@ -1841,7 +1846,6 @@ void GetFaceDir(const TopoDS_Edge& aE,
|
||||
aDB.SetXYZ(aVec.XYZ());
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FindPointInFace
|
||||
//purpose : Find a point in the face in direction of <aDB>
|
||||
@ -1852,12 +1856,13 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
|
||||
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();
|
||||
@ -1869,10 +1874,27 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
|
||||
//
|
||||
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()) {
|
||||
@ -1884,7 +1906,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
|
||||
aProjPL.Perform(aPOut);
|
||||
aPOut = aProjPL.NearestPoint();
|
||||
//
|
||||
gp_Vec aV(aP, aPOut);
|
||||
gp_Vec aV(aPS, aPOut);
|
||||
aDB.SetXYZ(aV.XYZ());
|
||||
} while (aDist > aDTol && --aNbItMax);
|
||||
//
|
||||
@ -2006,8 +2028,8 @@ Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
|
||||
//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;
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Original bug : pro14942
|
||||
# Date : 26Aout98
|
||||
|
||||
#CR23958 puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
#CR23958 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
|
||||
puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
puts "TODO #22911 ALL: Error : The area of the resulting shape is"
|
||||
|
||||
restore [locate_data_file CTO904_pro14942a.rle] a
|
||||
restore [locate_data_file pro14942b.rle] b
|
||||
|
@ -1,4 +1,5 @@
|
||||
puts "TODO ?OCC24157 ALL: Error : The area of the resulting shape is"
|
||||
puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
# cts17861
|
||||
|
||||
restore [locate_data_file CTO900_cts17861a.rle] a
|
||||
|
3
tests/boolean/bopcommon_complex/J1
Normal file → Executable file
3
tests/boolean/bopcommon_complex/J1
Normal file → Executable file
@ -1,3 +1,6 @@
|
||||
puts "TODO #22911 ALL: Error : The bopcommon is not valid. The area is"
|
||||
puts "TODO #22911 ALL: Error : The area of the resulting shape is"
|
||||
|
||||
restore [locate_data_file a158] a
|
||||
restore [locate_data_file b148] b
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
#puts "TODO OCC12345 ALL: Error : The square of result shape is"
|
||||
puts "TODO OCC12345 ALL: Error : The command is not valid"
|
||||
puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains"
|
||||
#puts "TODO OCC12345 ALL: Error : The command is not valid"
|
||||
#puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains"
|
||||
|
||||
puts "========================"
|
||||
puts " OCC472 "
|
||||
@ -20,8 +20,8 @@ checkshape b2
|
||||
|
||||
bfuse result b1 b2
|
||||
|
||||
set nb_v_good 5
|
||||
set nb_e_edge 7
|
||||
set square 0
|
||||
set nb_v_good 66
|
||||
set nb_e_edge 107
|
||||
set square 31657.5
|
||||
set 2dviewer 0
|
||||
|
||||
|
@ -12,18 +12,19 @@ restore [locate_data_file bug24154_b.brep] b2
|
||||
bop b1 b2
|
||||
bopcut result
|
||||
|
||||
set square 2.68434e+06
|
||||
#set square 2.68434e+06
|
||||
set square 5.21269e+06
|
||||
set volume 7.35468e+07
|
||||
|
||||
# Analysis of "nbshapes res"
|
||||
set nb_v_good 18
|
||||
set nb_e_good 27
|
||||
set nb_w_good 11
|
||||
set nb_f_good 11
|
||||
set nb_e_good 36
|
||||
set nb_w_good 18
|
||||
set nb_f_good 18
|
||||
set nb_sh_good 1
|
||||
set nb_sol_good 1
|
||||
set nb_compsol_good 0
|
||||
set nb_compound_good 1
|
||||
set nb_shape_good 70
|
||||
set nb_shape_good 93
|
||||
|
||||
set 2dviewer 1
|
||||
|
33
tests/bugs/modalg_5/bug25432
Normal file
33
tests/bugs/modalg_5/bug25432
Normal file
@ -0,0 +1,33 @@
|
||||
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
|
@ -1,3 +1,5 @@
|
||||
puts "TODO CR25432 ALL: Error : The square of result shape is"
|
||||
|
||||
puts "================"
|
||||
puts "OCC26"
|
||||
puts "================"
|
||||
|
@ -1,3 +1,5 @@
|
||||
puts "TODO CR25432 ALL: Error : The square of result shape is"
|
||||
|
||||
puts "================"
|
||||
puts "OCC26"
|
||||
puts "================"
|
||||
|
Loading…
x
Reference in New Issue
Block a user