From dc161d81d31dfac38c78b946c9094559df111a5b Mon Sep 17 00:00:00 2001 From: AMA <> Date: Thu, 29 Dec 2011 11:34:34 +0000 Subject: [PATCH] 0022846: Following from issue 0022804 (regression on test case) --- src/BRepTest/BRepTest_SurfaceCommands.cxx | 25 +++++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/BRepTest/BRepTest_SurfaceCommands.cxx b/src/BRepTest/BRepTest_SurfaceCommands.cxx index e34582a052..7c59750378 100755 --- a/src/BRepTest/BRepTest_SurfaceCommands.cxx +++ b/src/BRepTest/BRepTest_SurfaceCommands.cxx @@ -278,7 +278,8 @@ static Standard_Integer sewing (Draw_Interpretor& theDi, Standard_Boolean aSameParameterMode = Standard_True; Standard_Boolean aFloatingEdgesMode = Standard_False; Standard_Boolean aFaceMode = Standard_True; - Standard_Real aMinTol = aTol*1e-4; + Standard_Boolean aSetMinTol = Standard_False; + Standard_Real aMinTol = 0.; Standard_Real aMaxTol = Precision::Infinite(); for (Standard_Integer i = 2; i < theArgc; i++) @@ -293,7 +294,10 @@ static Standard_Integer sewing (Draw_Interpretor& theDi, if (tolower(theArgv[i][2]) == 'i' && i+1 < theArgc) { if (atof (theArgv[i+1])) - aMinTol = atof (theArgv[i+1]); + { + aMinTol = atof (theArgv[++i]); + aSetMinTol = Standard_True; + } else { theDi << "Error! min tolerance can't possess the null value" << "\n"; @@ -303,7 +307,7 @@ static Standard_Integer sewing (Draw_Interpretor& theDi, if (tolower(theArgv[i][2]) == 'a' && i+1 < theArgc) { if (atof (theArgv[i+1])) - aMaxTol = atof (theArgv[i+1]); + aMaxTol = atof (theArgv[++i]); else { theDi << "Error! max tolerance can't possess the null value" << "\n"; @@ -323,16 +327,17 @@ static Standard_Integer sewing (Draw_Interpretor& theDi, } else { - if (atof (theArgv[i])) - aTol = atof (theArgv[i]); - else + TopoDS_Shape aShape = DBRep::Get (theArgv[i]); + if (!aShape.IsNull()) { - TopoDS_Shape aShape = DBRep::Get (theArgv[i]); - if (aShape.IsNull()) - continue; aSeq.Append (aShape); aPar++; } + else + { + if (atof (theArgv[i])) + aTol = atof (theArgv[i]); + } } } @@ -357,6 +362,8 @@ static Standard_Integer sewing (Draw_Interpretor& theDi, return (1); } + if (!aSetMinTol) + aMinTol = aTol*1e-4; if (aTol < Precision::Confusion()) aTol = Precision::Confusion(); if (aMinTol < Precision::Confusion())