]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update test for centered rectangle to check modification of center point and corner.
authorArtem Zhidkov <Artem.Zhidkov@gmail.com>
Wed, 7 Apr 2021 19:58:53 +0000 (22:58 +0300)
committerArtem Zhidkov <Artem.Zhidkov@gmail.com>
Wed, 7 Apr 2021 19:59:05 +0000 (22:59 +0300)
src/PythonAddons/Test/TestRectangleCentered.py

index ff47827f07a1872293bc06e38a0134cca584402f..e8ec4a2c78fbc12d354d55011b22ac62c39cace3 100644 (file)
@@ -72,4 +72,25 @@ model.end()
 
 checkRectangle(lines_3, SketchAPI_Line(lines_1[0]).startPoint().pnt(), SketchAPI_Line(lines_2[0]).endPoint().pnt())
 
+# move center of rectangle
+SHIFT = 1.0
+center = SketchAPI_Line(lines_1[0]).startPoint().pnt()
+for i in range(0, 20):
+  center.setX(center.x() + SHIFT)
+  center.setY(center.y() + SHIFT)
+  model.begin()
+  sketch.move(SketchAPI_Line(lines_1[0]).startPoint(), center)
+  model.end()
+  checkRectangle(lines_3, center, SketchAPI_Line(lines_2[0]).endPoint().pnt())
+
+# move corner of rectangle
+corner = SketchAPI_Line(lines_2[0]).endPoint().pnt()
+for i in range(0, 20):
+  corner.setX(corner.x() + SHIFT)
+  corner.setY(corner.y() + SHIFT)
+  model.begin()
+  sketch.move(SketchAPI_Line(lines_2[0]).endPoint(), corner)
+  model.end()
+  checkRectangle(lines_3, SketchAPI_Line(lines_1[0]).startPoint().pnt(), corner)
+
 assert(model.checkPythonDump())