mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0023738: Boolean Fuse between two faces fails
This commit is contained in:
parent
ab4a555430
commit
77088633a2
@ -51,6 +51,8 @@
|
||||
|
||||
static
|
||||
gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D);
|
||||
static
|
||||
void RefineDir(gp_Dir& aDir);
|
||||
|
||||
//=======================================================================
|
||||
//class :
|
||||
@ -129,7 +131,9 @@ class AxeOperator {
|
||||
gp_Dir V2=Axe2.Direction();
|
||||
gp_Pnt P1=Axe1.Location();
|
||||
gp_Pnt P2=Axe2.Location();
|
||||
|
||||
//
|
||||
RefineDir(V1);
|
||||
RefineDir(V2);
|
||||
thecoplanar= Standard_False;
|
||||
thenormal = Standard_False;
|
||||
|
||||
@ -1609,9 +1613,13 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D)
|
||||
const gp_Cone& Con,
|
||||
const Standard_Real)
|
||||
{
|
||||
|
||||
//
|
||||
done=Standard_True;
|
||||
//
|
||||
AxeOperator A1A2(Con.Axis(),Sph.Position().Axis());
|
||||
gp_Pnt Pt=Sph.Location();
|
||||
//
|
||||
if((A1A2.Intersect() && (Pt.Distance(A1A2.PtIntersect())==0.0))
|
||||
|| A1A2.Same()) {
|
||||
gp_Pnt ConApex= Con.Apex();
|
||||
@ -1936,7 +1944,54 @@ const gp_Pnt& IntAna_QuadQuadGeo::PChar() const
|
||||
{
|
||||
return myPChar;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : RefineDir
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RefineDir(gp_Dir& aDir)
|
||||
{
|
||||
Standard_Integer k, m, n;
|
||||
Standard_Real aC[3];
|
||||
//
|
||||
aDir.Coord(aC[0], aC[1], aC[2]);
|
||||
//
|
||||
m=0;
|
||||
n=0;
|
||||
for (k=0; k<3; ++k) {
|
||||
if (aC[k]==1. || aC[k]==-1.) {
|
||||
++m;
|
||||
}
|
||||
else if (aC[k]!=0.) {
|
||||
++n;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (m && n) {
|
||||
Standard_Real aEps, aR1, aR2, aNum;
|
||||
//
|
||||
aEps=RealEpsilon();
|
||||
aR1=1.-aEps;
|
||||
aR2=1.+aEps;
|
||||
//
|
||||
for (k=0; k<3; ++k) {
|
||||
m=(aC[k]>0.);
|
||||
aNum=(m)? aC[k] : -aC[k];
|
||||
if (aNum>aR1 && aNum<aR2) {
|
||||
if (m) {
|
||||
aC[k]=1.;
|
||||
}
|
||||
else {
|
||||
aC[k]=-1.;
|
||||
}
|
||||
//
|
||||
aC[(k+1)%3]=0.;
|
||||
aC[(k+2)%3]=0.;
|
||||
break;
|
||||
}
|
||||
}
|
||||
aDir.SetCoord(aC[0], aC[1], aC[2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
34
tests/bugs/moddata/bug23738
Executable file
34
tests/bugs/moddata/bug23738
Executable file
@ -0,0 +1,34 @@
|
||||
puts "============"
|
||||
puts "CR23738"
|
||||
puts "============"
|
||||
puts ""
|
||||
#######################################################################
|
||||
#
|
||||
#######################################################################
|
||||
|
||||
puts "Load first shape ..."
|
||||
restore [locate_data_file bug23738_b1.brep] b1
|
||||
puts "Load second shape ..."
|
||||
restore [locate_data_file bug23738_b2.brep] b2
|
||||
|
||||
puts "Prepare boolean operation ..."
|
||||
bop b1 b2
|
||||
|
||||
puts "Start boolean operation ..."
|
||||
bopfuse result
|
||||
puts "Finish boolean operation ..."
|
||||
|
||||
set square 225009
|
||||
|
||||
# Analysis of "nbshapes result"
|
||||
set nb_v_good 8
|
||||
set nb_e_good 12
|
||||
set nb_w_good 8
|
||||
set nb_f_good 6
|
||||
set nb_sh_good 1
|
||||
set nb_sol_good 0
|
||||
set nb_compsol_good 0
|
||||
set nb_compound_good 1
|
||||
set nb_shape_good 36
|
||||
|
||||
set 3dviewer 1
|
Loading…
x
Reference in New Issue
Block a user