Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchPlugin / Test / TestDistanceSignedVsUnsigned04.py
index e26fd422187051253c848cdd9eea4c63f9f46def..5d4f8cd9818c0257418d4a99846aeab2ff6a504b 100644 (file)
@@ -1,22 +1,21 @@
-## Copyright (C) 2017  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
-## 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<mailto:webmaster.salome@opencascade.com>
-##
+# Copyright (C) 2017-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
+#
 
 from salome.shaper import model
 from SketchAPI import *
@@ -31,6 +30,7 @@ distParam = model.addParameter(partSet, "d", "30")
 Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
 Rectangle_1 = Sketch_1.addRectangle(0, 0, 200, 100)
 [Line_1, Line_2, Line_3, Line_4] = Rectangle_1.lines()
+Sketch_1.setVertical(Line_4.result())
 Point_1 = Sketch_1.addPoint(model.selection("VERTEX", "Origin"))
 Sketch_1.setCoincident(SketchAPI_Line(Line_1).endPoint(), Point_1.result())
 Sketch_1.setLength(SketchAPI_Line(Line_1).result(), "w")
@@ -47,7 +47,7 @@ signedDist1 = model.signedDistancePointLine(start, line)
 signedDist2 = model.signedDistancePointLine(end, line)
 
 # change rectangle width and check distances
-widthParam.setValue(1000)
+widthParam.setValue(300)
 model.do()
 curDist = model.signedDistancePointLine(start, line)
 assert(math.fabs(signedDist1 - curDist) < TOLERANCE), "Expected {}, actual {}".format(signedDist1, curDist)
@@ -67,3 +67,4 @@ model.assertArcValidity(Arc_1)
 assert Sketch_1.solverError().value() == "", "FAILED: Sketch should NOT report over-constrained situation"
 
 model.end()
+