Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchPlugin / Test / TestConstraintCoincidenceEllipticArc.py
index c7eb7798f636d713a75d2fd1a8c088d3621d1db4..cb200c95bd2ed8acfbe47e141dc552f629640fe0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2019  CEA/DEN, EDF R&D
+# Copyright (C) 2019-2023  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -258,6 +258,43 @@ class TestCoincidenceEllipticArc(unittest.TestCase):
     self.checkPointOnEllipse(self.myOrigin.coordinates(), self.myEllipticArc)
 
 
+  def test_start_on_major_axis(self):
+    """ Test 22. Make coincident the start point of the arc and the end of its major axis
+    """
+    self.myEllipticArc.startPoint().setValue(38, -2)
+    model.do()
+    self.mySketch.setCoincident(self.myEllipticArc.startPoint(), self.myMajorAxis.endPoint())
+    self.myDOF -= 1
+    model.do()
+    self.assertPoints(self.myMajorAxis.endPoint(), self.myEllipticArc.startPoint())
+
+  def test_end_on_major_axis(self):
+    """ Test 23. Make coincident the end point of the arc and the start of its major axis
+    """
+    self.myEllipticArc.endPoint().setValue(-58, 12)
+    model.do()
+    self.mySketch.setCoincident(self.myMajorAxis.startPoint(), self.myEllipticArc.endPoint())
+    self.myDOF -= 1
+    model.do()
+    self.assertPoints(self.myMajorAxis.startPoint(), self.myEllipticArc.endPoint())
+
+  def test_start_on_minor_axis(self):
+    """ Test 22. Make coincident the start point of the arc and the end of its minor axis
+    """
+    self.mySketch.setCoincident(self.myMinorAxis.endPoint(), self.myEllipticArc.startPoint())
+    self.myDOF -= 1
+    model.do()
+    self.assertPoints(self.myMinorAxis.endPoint(), self.myEllipticArc.startPoint())
+
+  def test_end_on_minor_axis(self):
+    """ Test 23. Make coincident the end point of the arc and the start of its minor axis
+    """
+    self.mySketch.setCoincident(self.myEllipticArc.endPoint(), self.myMinorAxis.startPoint())
+    self.myDOF -= 1
+    model.do()
+    self.assertPoints(self.myMinorAxis.startPoint(), self.myEllipticArc.endPoint())
+
+
 if __name__ == "__main__":
     test_program = unittest.main(exit=False)
     assert test_program.result.wasSuccessful(), "Test failed"