From: azv Date: Tue, 26 Jan 2016 12:21:31 +0000 (+0300) Subject: Update unit tests for the PlaneGCS solver. Bug fixes. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c64ba5c5743087857b440079d2b77c205d113a57;p=modules%2Fshaper.git Update unit tests for the PlaneGCS solver. Bug fixes. --- diff --git a/src/PythonAPI/examples/Platine.py b/src/PythonAPI/examples/Platine.py index 966d6eeb9..063e2c639 100644 --- a/src/PythonAPI/examples/Platine.py +++ b/src/PythonAPI/examples/Platine.py @@ -82,11 +82,6 @@ def bottom_body(): sketch.setEqual(top.result(), bottom.result()) sketch.setEqual(h1.result(), h2.result()) - sketch.setLength(top.result(), "P") - sketch.setLength(right.result(), 16) - sketch.setLength(v1.result(), 16) - sketch.setLength(h2.result(), 20) - sketch.setCoincident(arc.center(), v1.result()) sketch.setCoincident(arc.startPoint(), h2.endPoint()) sketch.setCoincident(arc.endPoint(), h1.startPoint()) @@ -98,6 +93,13 @@ def bottom_body(): model.do() #!!! + # Dimensions + sketch.setLength(v1.result(), 16) + sketch.setLength(h2.result(), 20) + sketch.setLength(right.result(), 16) + sketch.setLength(top.result(), "P") + model.do() + # Create extrusion body = model.addExtrusion(part, sketch.selectFace(), "-E") diff --git a/src/SketchPlugin/Test/TestConstraintConcidence.py b/src/SketchPlugin/Test/TestConstraintConcidence.py index 81e34ef70..43ef29837 100644 --- a/src/SketchPlugin/Test/TestConstraintConcidence.py +++ b/src/SketchPlugin/Test/TestConstraintConcidence.py @@ -133,7 +133,7 @@ aSession.startOperation() aDocument.removeFeature(aConstraint) aSession.finishOperation() aSession.startOperation() -aLineStartPoint.setValue(50., 0.) +aLineStartPoint.setValue(70., 0.) aSession.finishOperation() assert (anArcEndPoint.x() != aLineStartPoint.x() or anArcEndPoint.y() != aLineStartPoint.y()) diff --git a/src/SketchPlugin/Test/TestConstraintMirror.py b/src/SketchPlugin/Test/TestConstraintMirror.py index 6c3678970..319a725d6 100644 --- a/src/SketchPlugin/Test/TestConstraintMirror.py +++ b/src/SketchPlugin/Test/TestConstraintMirror.py @@ -22,6 +22,7 @@ __updated__ = "2015-03-17" # Auxiliary functions #========================================================================= def checkMirror(theListInit, theListMirr, theMirrorLine): + TOL = 1.e-8 aListSize = theListInit.size() aLineStartPoint = geomDataAPI_Point2D(theMirrorLine.attribute("StartPoint")) @@ -48,11 +49,11 @@ def checkMirror(theListInit, theListMirr, theMirrorLine): aDirX = aPointC.x() - aPointB.x() aDirY = aPointC.y() - aPointB.y() aDot = aLineDirX * aDirX + aLineDirY * aDirY - assert(math.fabs(aDot) < 1.e-10) + assert math.fabs(aDot) < TOL, "aDot = {0}".format(aDot) aDirX = aLineEndPoint.x() - 0.5 * (aPointB.x() + aPointC.x()) aDirY = aLineEndPoint.y() - 0.5 * (aPointB.y() + aPointC.y()) aCross = aLineDirX * aDirY - aLineDirY * aDirX - assert(math.fabs(aCross) < 1.e-10) + assert math.fabs(aCross) < TOL, "aCross = {0}".format(aCross) #=========================================================================