-## 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 *
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())
Origin = Sketch_1.addPoint(model.selection("VERTEX", "Origin"))
Sketch_1.setCoincident(SketchAPI_Line(Line_1).endPoint(), Origin.result())
Sketch_1.setLength(SketchAPI_Line(Line_1).result(), "w")
signedDist2 = model.signedDistancePointLine(Point_2, line)
# change rectangle width and check distances
-widthParam.setValue(2000)
+widthParam.setValue(300)
model.do()
curDist = model.signedDistancePointLine(Point_1, line)
assert(math.fabs(signedDist1 - curDist) < TOLERANCE), "Expected {}, actual {}".format(signedDist1, curDist)
assert Sketch_1.solverError().value() == "", "FAILED: Sketch should NOT report over-constrained situation"
# revert rectangle width and check distances again
-widthParam.setValue(200)
+widthParam.setValue(300)
model.do()
curDist = model.signedDistancePointLine(Point_1, line)
assert(math.fabs(signedDist1 - curDist) < TOLERANCE), "Expected {}, actual {}".format(signedDist1, curDist)
assert Sketch_1.solverError().value() == "", "FAILED: Sketch should NOT report over-constrained situation"
model.end()
+