mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0024798: Boolean operation CUT produces incorrect result
Face classifier has been used to check adjustment of 2d curve for the face. Test case for issue CR24798
This commit is contained in:
parent
53ca691b7b
commit
d8a24e8394
@ -53,6 +53,7 @@
|
|||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||||
#include <BOPTools.hxx>
|
#include <BOPTools.hxx>
|
||||||
|
#include <BRepClass_FaceClassifier.hxx>
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
@ -348,6 +349,42 @@ static
|
|||||||
//xt
|
//xt
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
{
|
||||||
|
//check the point with classifier
|
||||||
|
Standard_Real u,v;
|
||||||
|
u = u2 + du;
|
||||||
|
v = v2 + dv;
|
||||||
|
if (aBAS.IsUPeriodic()) {
|
||||||
|
aUPeriod = aBAS.UPeriod();
|
||||||
|
if ((UMax - UMin - 2*aDelta) > aUPeriod) {
|
||||||
|
if ((u > (UMin + aDelta + aUPeriod)) ||
|
||||||
|
(u < (UMax - aDelta - aUPeriod))) {
|
||||||
|
BRepClass_FaceClassifier aClassifier;
|
||||||
|
aClassifier.Perform(aF, gp_Pnt2d(u, v), aDelta);
|
||||||
|
TopAbs_State Status = aClassifier.State();
|
||||||
|
if (Status == TopAbs_OUT) {
|
||||||
|
du += (u > (UMin + aDelta + aUPeriod)) ? -aUPeriod : aUPeriod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
u = u2 + du;
|
||||||
|
if (aBAS.IsVPeriodic()) {
|
||||||
|
Standard_Real aVPeriod = aBAS.VPeriod();
|
||||||
|
if ((VMax - VMin - 2*aDelta) > aVPeriod) {
|
||||||
|
if ((v > (VMin + aDelta + aVPeriod)) ||
|
||||||
|
(v < (VMax - aDelta - aVPeriod))) {
|
||||||
|
BRepClass_FaceClassifier aClassifier;
|
||||||
|
aClassifier.Perform(aF, gp_Pnt2d(u, v), aDelta);
|
||||||
|
TopAbs_State Status = aClassifier.State();
|
||||||
|
if (Status == TopAbs_OUT) {
|
||||||
|
dv += (v > (VMin + aDelta + aVPeriod)) ? -aVPeriod : aVPeriod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Translation if necessary
|
// Translation if necessary
|
||||||
Handle(Geom2d_Curve) aC2Dx=aC2D;
|
Handle(Geom2d_Curve) aC2Dx=aC2D;
|
||||||
|
|
||||||
|
28
tests/bugs/modalg_5/bug24798
Normal file
28
tests/bugs/modalg_5/bug24798
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24798"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
######################################################
|
||||||
|
# Boolean operation CUT produces incorrect result
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug24798_r1_cut.brep] b1
|
||||||
|
restore [locate_data_file bug24798_rectBranch.brep] b2
|
||||||
|
|
||||||
|
bop b1 b2
|
||||||
|
bopcut result
|
||||||
|
|
||||||
|
set square 1826.15
|
||||||
|
|
||||||
|
# Analysis of "nbshapes res"
|
||||||
|
set nb_v_good 44
|
||||||
|
set nb_e_good 67
|
||||||
|
set nb_w_good 29
|
||||||
|
set nb_f_good 22
|
||||||
|
set nb_sh_good 1
|
||||||
|
set nb_sol_good 1
|
||||||
|
set nb_compsol_good 0
|
||||||
|
set nb_compound_good 1
|
||||||
|
set nb_shape_good 165
|
||||||
|
|
||||||
|
set 2dviewer 1
|
Loading…
x
Reference in New Issue
Block a user