mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0024108: Boolean fuse fails
Tolerance of checking distance between vertex and edge in BOPInt_Context::ComputeVE() increased by additional Precision::Confusion() to allow for interference to be detected in this particular case. Two tests added for this issue: one with original shapes and another in rotated co-ordinates
This commit is contained in:
parent
acccace3fb
commit
42ff8f5bd3
@ -466,10 +466,13 @@
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
aDist=aProjector.LowerDistance();
|
aDist=aProjector.LowerDistance();
|
||||||
//
|
|
||||||
|
// tolerance of check for coincidence is sum of tolerances of edge and vertex
|
||||||
|
// extended by additional Precision::Confusion() to allow for interference where
|
||||||
|
// it is very close but not fit to tolerance (see #24108)
|
||||||
aTolV1=BRep_Tool::Tolerance(aV1);
|
aTolV1=BRep_Tool::Tolerance(aV1);
|
||||||
aTolE2=BRep_Tool::Tolerance(aE2);
|
aTolE2=BRep_Tool::Tolerance(aE2);
|
||||||
aTolSum=aTolV1+aTolE2;
|
aTolSum = aTolV1 + aTolE2 + Precision::Confusion();
|
||||||
//
|
//
|
||||||
aT=aProjector.LowerDistanceParameter();
|
aT=aProjector.LowerDistanceParameter();
|
||||||
if (aDist > aTolSum) {
|
if (aDist > aTolSum) {
|
||||||
|
@ -25,12 +25,16 @@
|
|||||||
#include <Standard_NotImplemented.hxx>
|
#include <Standard_NotImplemented.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
//=============================================================================
|
//function : Extrema_ExtPElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
Extrema_ExtPElC::Extrema_ExtPElC () { myDone = Standard_False; }
|
Extrema_ExtPElC::Extrema_ExtPElC () { myDone = Standard_False; }
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : Extrema_ExtPElC
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
Extrema_ExtPElC::Extrema_ExtPElC (const gp_Pnt& P,
|
Extrema_ExtPElC::Extrema_ExtPElC (const gp_Pnt& P,
|
||||||
const gp_Lin& L,
|
const gp_Lin& L,
|
||||||
const Standard_Real Tol,
|
const Standard_Real Tol,
|
||||||
@ -39,7 +43,10 @@ Extrema_ExtPElC::Extrema_ExtPElC (const gp_Pnt& P,
|
|||||||
{
|
{
|
||||||
Perform(P, L, Tol, Uinf, Usup);
|
Perform(P, L, Tol, Uinf, Usup);
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Perform
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
void Extrema_ExtPElC::Perform(const gp_Pnt& P,
|
void Extrema_ExtPElC::Perform(const gp_Pnt& P,
|
||||||
const gp_Lin& L,
|
const gp_Lin& L,
|
||||||
const Standard_Real Tol,
|
const Standard_Real Tol,
|
||||||
@ -48,7 +55,7 @@ void Extrema_ExtPElC::Perform(const gp_Pnt& P,
|
|||||||
{
|
{
|
||||||
myDone = Standard_False;
|
myDone = Standard_False;
|
||||||
myNbExt = 0;
|
myNbExt = 0;
|
||||||
gp_Vec V1 = gp_Vec(L.Direction());
|
gp_Vec V1 (L.Direction());
|
||||||
gp_Pnt OR = L.Location();
|
gp_Pnt OR = L.Location();
|
||||||
gp_Vec V(OR, P);
|
gp_Vec V(OR, P);
|
||||||
Standard_Real Mydist = V1.Dot(V);
|
Standard_Real Mydist = V1.Dot(V);
|
||||||
@ -124,7 +131,6 @@ Method:
|
|||||||
Usol[1] = Usol[0] + M_PI;
|
Usol[1] = Usol[0] + M_PI;
|
||||||
|
|
||||||
Standard_Real myuinf = Uinf;
|
Standard_Real myuinf = Uinf;
|
||||||
//modified by NIZNHY-PKV Fri Apr 20 15:03:28 2001 f
|
|
||||||
//Standard_Real TolU = Tol*C.Radius();
|
//Standard_Real TolU = Tol*C.Radius();
|
||||||
Standard_Real TolU, aR;
|
Standard_Real TolU, aR;
|
||||||
aR=C.Radius();
|
aR=C.Radius();
|
||||||
@ -132,7 +138,7 @@ Method:
|
|||||||
if (aR > gp::Resolution()) {
|
if (aR > gp::Resolution()) {
|
||||||
TolU= Tol/aR;
|
TolU= Tol/aR;
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Fri Apr 20 15:03:32 2001 t
|
//
|
||||||
ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[0]);
|
ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[0]);
|
||||||
ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[1]);
|
ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[1]);
|
||||||
if (((Usol[0]-2*M_PI-Uinf) < TolU) && ((Usol[0]-2*M_PI-Uinf) > -TolU)) Usol[0] = Uinf;
|
if (((Usol[0]-2*M_PI-Uinf) < TolU) && ((Usol[0]-2*M_PI-Uinf) > -TolU)) Usol[0] = Uinf;
|
||||||
|
40
tests/bugs/moddata_3/bug24108
Normal file
40
tests/bugs/moddata_3/bug24108
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR24108"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Boolean fuse fails
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
puts "Load first shape ..."
|
||||||
|
restore [locate_data_file bug24108_face_411.brep] b1
|
||||||
|
puts "Load second shape ..."
|
||||||
|
restore [locate_data_file bug24108_face_514.brep] b2
|
||||||
|
|
||||||
|
explode b1 f
|
||||||
|
explode b2 f
|
||||||
|
|
||||||
|
copy b1_1 b1
|
||||||
|
copy b2_1 b2
|
||||||
|
|
||||||
|
puts "Prepare boolean operation ..."
|
||||||
|
bop b1 b2
|
||||||
|
|
||||||
|
puts "Start boolean operation ..."
|
||||||
|
bopfuse result
|
||||||
|
puts "Finish boolean operation ..."
|
||||||
|
|
||||||
|
set square 1328.78
|
||||||
|
|
||||||
|
# Analysis of "nbshapes result"
|
||||||
|
set nb_v_good 37
|
||||||
|
set nb_e_good 39
|
||||||
|
set nb_w_good 4
|
||||||
|
set nb_f_good 3
|
||||||
|
set nb_sh_good 1
|
||||||
|
set nb_sol_good 0
|
||||||
|
set nb_compsol_good 0
|
||||||
|
set nb_compound_good 1
|
||||||
|
set nb_shape_good 85
|
||||||
|
|
||||||
|
set 3dviewer 1
|
45
tests/bugs/moddata_3/bug24108_2
Normal file
45
tests/bugs/moddata_3/bug24108_2
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR24108"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Boolean fuse fails
|
||||||
|
# -- test #2: in rotated co-ordinates --
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
puts "Load first shape ..."
|
||||||
|
restore [locate_data_file bug24108_face_411.brep] b1
|
||||||
|
puts "Load second shape ..."
|
||||||
|
restore [locate_data_file bug24108_face_514.brep] b2
|
||||||
|
|
||||||
|
puts "Rotate shapes by 45 deg around Z .."
|
||||||
|
trotate b1 0 0 0 0 0 1 45.
|
||||||
|
trotate b2 0 0 0 0 0 1 45.
|
||||||
|
|
||||||
|
explode b1 f
|
||||||
|
explode b2 f
|
||||||
|
|
||||||
|
copy b1_1 b1
|
||||||
|
copy b2_1 b2
|
||||||
|
|
||||||
|
puts "Prepare boolean operation ..."
|
||||||
|
bop b1 b2
|
||||||
|
|
||||||
|
puts "Start boolean operation ..."
|
||||||
|
bopfuse result
|
||||||
|
puts "Finish boolean operation ..."
|
||||||
|
|
||||||
|
set square 1328.78
|
||||||
|
|
||||||
|
# Analysis of "nbshapes result"
|
||||||
|
set nb_v_good 37
|
||||||
|
set nb_e_good 39
|
||||||
|
set nb_w_good 4
|
||||||
|
set nb_f_good 3
|
||||||
|
set nb_sh_good 1
|
||||||
|
set nb_sol_good 0
|
||||||
|
set nb_compsol_good 0
|
||||||
|
set nb_compound_good 1
|
||||||
|
set nb_shape_good 85
|
||||||
|
|
||||||
|
set 3dviewer 1
|
Loading…
x
Reference in New Issue
Block a user