]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update unit tests for the PlaneGCS solver. Bug fixes.
authorazv <azv@opencascade.com>
Tue, 26 Jan 2016 12:21:31 +0000 (15:21 +0300)
committerazv <azv@opencascade.com>
Tue, 26 Jan 2016 12:47:13 +0000 (15:47 +0300)
src/PythonAPI/examples/Platine.py
src/SketchPlugin/Test/TestConstraintConcidence.py
src/SketchPlugin/Test/TestConstraintMirror.py

index 966d6eeb942ff2a8a7198c7c8cd422723e544c8d..063e2c63949ed44e662990a215f38f276949fcf9 100644 (file)
@@ -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")
 
index 81e34ef70677d0cc3f38547135d6178809c517bf..43ef29837712a4dc19db8ccfecb06da66cf5524b 100644 (file)
@@ -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())
 
index 6c36789708f6f781bcaa7a1e207640dfda02ccd4..319a725d6cf4c2112bebc2685985de69488aa9c8 100644 (file)
@@ -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)
 
 
 #=========================================================================