mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023738: Boolean Fuse between two faces fails
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user