mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0026884: Cylinder/Cylinder intersection algorithm throws an exception
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
This commit is contained in:
@@ -125,8 +125,8 @@ class AxeOperator {
|
||||
//=======================================================================
|
||||
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;
|
||||
//---------------------------------------------------------------------
|
||||
@@ -275,12 +275,12 @@ IntAna_QuadQuadGeo::IntAna_QuadQuadGeo(void)
|
||||
//=======================================================================
|
||||
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
|
||||
|
@@ -1022,7 +1022,13 @@ stCoeffsValue::stCoeffsValue( const gp_Cylinder& theCyl1,
|
||||
}
|
||||
}
|
||||
|
||||
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)!!!!");
|
||||
}
|
||||
|
34
tests/bugs/moddata_3/bug26884
Normal file
34
tests/bugs/moddata_3/bug26884
Normal file
@@ -0,0 +1,34 @@
|
||||
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"
|
||||
}
|
Reference in New Issue
Block a user