mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-05-16 10:54:53 +03:00
0024040: The result of CUT operation is not correct
Changed the way of getting point inside face for detecting same domain faces. Adding test case for this fix
This commit is contained in:
parent
afed7fd721
commit
e656bcbe59
@ -840,7 +840,7 @@ static
|
||||
Handle(BOPInt_Context)& theContext)
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Integer iP;
|
||||
Standard_Integer iErr;
|
||||
Standard_Real aTolF1, aTolF2, aTol;
|
||||
gp_Pnt2d aP2D;
|
||||
gp_Pnt aP;
|
||||
@ -857,27 +857,22 @@ static
|
||||
//
|
||||
aTolF1=BRep_Tool::Tolerance(aF1);
|
||||
// 1
|
||||
iP=0;
|
||||
aExp.Init(aF1, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
aE1=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
if (!BRep_Tool::Degenerated(aE1)) {
|
||||
iP=1;
|
||||
//break;
|
||||
Standard_Real aTolE = BRep_Tool::Tolerance(aE1);
|
||||
aTolF1 = (aTolE > aTolF1) ? aTolE : aTolF1;
|
||||
}
|
||||
}
|
||||
if (!iP) {
|
||||
return bFlag;
|
||||
}
|
||||
//
|
||||
// 2
|
||||
aTolF2=BRep_Tool::Tolerance(aF2);
|
||||
aTol=aTolF1+aTolF2;
|
||||
//
|
||||
BOPTools_AlgoTools3D::PointNearEdge(aE1, aF1, aP2D, aP, theContext);
|
||||
bFlag=theContext->IsValidPointForFace(aP, aF2, aTol);
|
||||
iErr = BOPTools_AlgoTools3D::PointInFace(aF1, aP, aP2D, theContext);
|
||||
if (!iErr) {
|
||||
bFlag=theContext->IsValidPointForFace(aP, aF2, aTol);
|
||||
}
|
||||
//
|
||||
return bFlag;
|
||||
}
|
||||
|
25
tests/bugs/modalg_5/bug24040
Executable file
25
tests/bugs/modalg_5/bug24040
Executable file
@ -0,0 +1,25 @@
|
||||
puts "================"
|
||||
puts "OCC24040"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# The result of CUT operation is not correct
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug24040_b1.brep] b1
|
||||
restore [locate_data_file bug24040_b2.brep] b2
|
||||
|
||||
bop b1 b2
|
||||
bopcut result
|
||||
|
||||
#the result should be empty compound
|
||||
# Analysis of "nbshapes res"
|
||||
set nb_v_good 0
|
||||
set nb_e_good 0
|
||||
set nb_w_good 0
|
||||
set nb_f_good 0
|
||||
set nb_sh_good 0
|
||||
set nb_sol_good 0
|
||||
set nb_compsol_good 0
|
||||
set nb_compound_good 1
|
||||
set nb_shape_good 1
|
Loading…
x
Reference in New Issue
Block a user