+# Copyright (C) 2014-2023 CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
"""
TestHighload.py
"""
# Create an N-Angle at (0,0)
rad = 2. * math.pi / theN
points = []
- for a in xrange(theN):
+ for a in range(theN):
x = round(math.cos(rad * a), 10) * theRadius
y = round(math.sin(rad * a), 10) * theRadius
points.append((x, y))
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)
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()
-for i in xrange(4):
- for j in xrange(4):
+for i in range(4):
+ for j in range(4):
allNangleLines = createNAngle(aSketchFeature, n, 50)
fixLineLength(aSketchFeature, allNangleLines)
moveTo(allNangleLines, deltaX, deltaY)
+ aDOF += n
n += 1
deltaX += 110.
deltaY += 110.
#=========================================================================
# End of test
#=========================================================================
+
+from salome.shaper import model
+assert(model.dof(aSketchFeature) == aDOF)
+assert(model.checkPythonDump())