Check, if cylinder axes are parallel is made more carefully.
This check is brought to conformity with check if axes are parallel (see constructor AxeOperator::AxeOperator(...) in IntAna_QuadQuadGeo.cxx file)
Test case for issue CR26884
//=======================================================================
AxeOperator::AxeOperator(const gp_Ax1& A1,const gp_Ax1& A2)
{
- myEPSILON_DISTANCE=0.00000000000001;
- myEPSILON_AXES_PARA=0.000000000001;
+ myEPSILON_DISTANCE=1.0e-14;
+ myEPSILON_AXES_PARA=Precision::Angular();
Axe1=A1;
Axe2=A2;
//---------------------------------------------------------------------
//=======================================================================
void IntAna_QuadQuadGeo::InitTolerances()
{
- myEPSILON_DISTANCE = 0.00000000000001;
- myEPSILON_ANGLE_CONE = 0.000000000001;
- myEPSILON_MINI_CIRCLE_RADIUS = 0.000000001;
- myEPSILON_CYLINDER_DELTA_RADIUS = 0.0000000000001;
- myEPSILON_CYLINDER_DELTA_DISTANCE= 0.0000001;
- myEPSILON_AXES_PARA = 0.000000000001;
+ myEPSILON_DISTANCE = 1.0e-14;
+ myEPSILON_ANGLE_CONE = Precision::Angular();
+ myEPSILON_MINI_CIRCLE_RADIUS = 0.01*Precision::Confusion();
+ myEPSILON_CYLINDER_DELTA_RADIUS = 1.0e-13;
+ myEPSILON_CYLINDER_DELTA_DISTANCE= Precision::Confusion();
+ myEPSILON_AXES_PARA = Precision::Angular();
}
//=======================================================================
//function : IntAna_QuadQuadGeo
}
}
- if(Abs(aDetV1V2) < aNulValue)
+ // In point of fact, every determinant (aDelta1, aDelta2 and aDelta3) is
+ // cross-product between directions (i.e. sine of angle).
+ // If sine is too small then sine is (approx.) equal to angle itself.
+ // Therefore, in this case we should compare sine with angular tolerance.
+ // This constant is used for check if axes are parallel (see constructor
+ // AxeOperator::AxeOperator(...) in IntAna_QuadQuadGeo.cxx file).
+ if(Abs(aDetV1V2) < Precision::Angular())
{
Standard_Failure::Raise("Error. Exception in divide by zerro (IntCyCyTrim)!!!!");
}
--- /dev/null
+puts "================"
+puts "OCC26884"
+puts "================"
+puts ""
+##############################################################
+# Cylinder/Cylinder intersection algorithm throws an exception
+##############################################################
+
+set max_time 0.1
+
+restore [locate_data_file bug26884-f1.brep] f1
+restore [locate_data_file bug26884-f2.brep] f2
+
+dchrono cr reset
+dchrono cr start
+
+set info [bopcurves f1 f2 -2d]
+
+dchrono cr stop
+
+if {![regexp {has no 3d curves} $info] ||
+ ![regexp {has no 3d points} $info] } {
+ puts "Error: wrong output"
+}
+
+set logTime [dchrono cr show]
+
+regexp {CPU user time: ([-0-9.+eE]+) seconds} $logTime full z
+
+if { $z > ${max_time} } {
+ puts "Elapsed time ($z) is more than ${max_time} seconds - Error"
+} else {
+ puts "Elapsed time ($z) is less than ${max_time} seconds - OK"
+}