Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[bos #20282] EDF 22320 - general compute fails
[modules/smesh.git]
/
src
/
SMESHUtils
/
SMESH_Octree.cxx
diff --git
a/src/SMESHUtils/SMESH_Octree.cxx
b/src/SMESHUtils/SMESH_Octree.cxx
index 4c9d4dbefa8487d9230d3ed39ed7c5fa7f1ac3d0..85df6d93bcd2379f2167b8bff644187598fca096 100644
(file)
--- a/
src/SMESHUtils/SMESH_Octree.cxx
+++ b/
src/SMESHUtils/SMESH_Octree.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
19
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-20
20
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-28,6
+28,9
@@
//
#include "SMESH_Octree.hxx"
//
#include "SMESH_Octree.hxx"
+#include <Precision.hxx>
+#include <limits>
+
//===========================================================================
/*!
* Constructor. limit must be provided at tree root construction.
//===========================================================================
/*!
* Constructor. limit must be provided at tree root construction.
@@
-90,7
+93,12
@@
void SMESH_Octree::enlargeByFactor( Bnd_B3d* box, double factor ) const
{
gp_XYZ halfSize = 0.5 * ( box->CornerMax() - box->CornerMin() );
for ( int iDim = 1; iDim <= 3; ++iDim )
{
gp_XYZ halfSize = 0.5 * ( box->CornerMax() - box->CornerMin() );
for ( int iDim = 1; iDim <= 3; ++iDim )
- halfSize.SetCoord( iDim, factor * halfSize.Coord( iDim ));
+ {
+ double newHSize = factor * halfSize.Coord( iDim );
+ if ( newHSize < std::numeric_limits<double>::min() )
+ newHSize = Precision::Confusion(); // 1.e-7
+ halfSize.SetCoord( iDim, newHSize );
+ }
box->SetHSize( halfSize );
}
}
box->SetHSize( halfSize );
}
}