static
gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D);
+static
+ void RefineDir(gp_Dir& aDir);
//=======================================================================
//class :
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;
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();
{
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]);
+ }
+}
--- /dev/null
+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