Salome HOME
Issue #2130: arc is done not as desired
[modules/shaper.git] / src / SketchPlugin / Test / TestHighload.py
index f8fed6087f82e0ddf6147a1696b4aecdb97ab8b7..0825ff115aa2cf69acf95747700baaedb3754d47 100644 (file)
@@ -41,6 +41,7 @@ def createNAngle(theSketch, theN, theRadius, theEdgeLength=0):
         anEndPoint = geomDataAPI_Point2D(aSketchLine.attribute("EndPoint"))
         aStartPoint.setValue(begin[0], begin[1])
         anEndPoint.setValue(end[0], end[1])
+        aSketchLine.execute()
         allStartPoints.append(aStartPoint)
         allEndPoints.append(anEndPoint)
         allLines.append(aSketchLine)
@@ -90,19 +91,18 @@ aDocument = aSession.moduleDocument()
 #=========================================================================
 aSession.startOperation()
 aSketchCommonFeature = aDocument.addFeature("Sketch")
-aSketchFeature = modelAPI_CompositeFeature(aSketchCommonFeature)
+aSketchFeature = featureToCompositeFeature(aSketchCommonFeature)
 origin = geomDataAPI_Point(aSketchFeature.attribute("Origin"))
 origin.setValue(0, 0, 0)
 dirx = geomDataAPI_Dir(aSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
-diry = geomDataAPI_Dir(aSketchFeature.attribute("DirY"))
-diry.setValue(0, 1, 0)
 norm = geomDataAPI_Dir(aSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
 aSession.finishOperation()
 #=========================================================================
 # Create 4x4 polygons N = {5, 21}
 #=========================================================================
+aDOF = 0
 deltaX = deltaY = 50.
 n = 5
 aSession.startOperation()
@@ -111,6 +111,7 @@ for i in xrange(4):
         allNangleLines = createNAngle(aSketchFeature, n, 50)
         fixLineLength(aSketchFeature, allNangleLines)
         moveTo(allNangleLines, deltaX, deltaY)
+        aDOF += n
         n += 1
         deltaX += 110.
     deltaY += 110.
@@ -121,3 +122,7 @@ aSession.finishOperation()
 #=========================================================================
 # End of test
 #=========================================================================
+
+from salome.shaper import model
+assert(model.dof(aSketchFeature) == aDOF)
+assert(model.checkPythonDump())