X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_MAT2d.cxx;fp=src%2FSMESHUtils%2FSMESH_MAT2d.cxx;h=5469f476c6a70c901c0b5af5caf315739ce038bf;hp=f925422c3fa6f62801183e815dbb46b1f32c8940;hb=31fce7937dd5d934ec890da3d5031cbcec3040c0;hpb=ce56cca5177c94ff857383602c3c308565e9ece3 diff --git a/src/SMESHUtils/SMESH_MAT2d.cxx b/src/SMESHUtils/SMESH_MAT2d.cxx index f925422c3..5469f476c 100644 --- a/src/SMESHUtils/SMESH_MAT2d.cxx +++ b/src/SMESHUtils/SMESH_MAT2d.cxx @@ -673,14 +673,12 @@ namespace // make 'scale' such that to have coordinates precise enough when converted to int gp_XY uvMin = uvBox.CornerMin(), uvMax = uvBox.CornerMax(); - uvMin.ChangeCoord(1) = uvMin.X() * scale[0]; - uvMin.ChangeCoord(2) = uvMin.Y() * scale[1]; - uvMax.ChangeCoord(1) = uvMax.X() * scale[0]; - uvMax.ChangeCoord(2) = uvMax.Y() * scale[1]; + uvMin *= gp_XY( scale[0], scale[1] ); + uvMax *= gp_XY( scale[0], scale[1] ); double vMax[2] = { Max( Abs( uvMin.X() ), Abs( uvMax.X() )), Max( Abs( uvMin.Y() ), Abs( uvMax.Y() )) }; int iMax = ( vMax[0] > vMax[1] ) ? 0 : 1; - const double precision = Min( 1e-5, minSegLen * 1e-2 ); + const double precision = Min( 1e-5, Min( minSegLen * 1e-2, vMax[iMax] * 1e-5 )); double preciScale = Min( vMax[iMax] / precision, std::numeric_limits::max() / vMax[iMax] ); preciScale /= scale[iMax];