Salome HOME
updated copyright message
[modules/shaper.git] / src / BuildPlugin / Test / TestSubShapes.py
index dbe6d695def133e29d108d1fc80c5a00be6e8cc3..5ecd81c73d52ee2a89e993fa98094cbb8445f877 100644 (file)
@@ -1,3 +1,22 @@
+# 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
+#
+
 # Initialization of the test
 from ModelAPI import *
 from GeomDataAPI import *
@@ -8,8 +27,8 @@ import random
 
 def createPoint(theSketchFeature):
     aSketchPointFeature = theSketchFeature.addFeature("SketchPoint")
-    aPointCoordindates = geomDataAPI_Point2D(aSketchPointFeature.attribute("PointCoordindates"))
-    aPointCoordindates.setValue(random.uniform(0, 50), random.uniform(0, 50))
+    aPointCoordinates = geomDataAPI_Point2D(aSketchPointFeature.attribute("PointCoordinates"))
+    aPointCoordinates.setValue(random.uniform(0, 50), random.uniform(0, 50))
     return aSketchPointFeature
 
 def createLine(theSketchFeature):
@@ -127,7 +146,7 @@ aSession.finishOperation()
 # Test results
 assert (len(aSubShapesFeature.results()) > 0)
 
-import model
+from salome.shaper import model
 
 model.begin()
 partSet = model.moduleDocument()
@@ -140,9 +159,9 @@ SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchCircle_1.center(),
 SketchPoint_1 = Sketch_1.addPoint(-490.566037735849, 50.600343053173)
 SketchPoint_2 = Sketch_1.addPoint(-423.670668953688, 50.600343053173)
 model.do()
-Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_1_2f")])
-Face_2 = model.addFace(Part_1_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchCircle_2_2r")])
-SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_1"), model.selection("VERTEX", "Sketch_1/Vertex-SketchPoint_2")])
+Face_1 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_1_2")])
+Face_2 = model.addFace(Part_1_doc, [model.selection("EDGE", "Sketch_1/SketchCircle_2_2")])
+SubShapes_1 = model.addSubShapes(Part_1_doc, model.selection("FACE", "Face_1_1"), [model.selection("VERTEX", "Sketch_1/SketchPoint_1"), model.selection("VERTEX", "Sketch_1/SketchPoint_2")])
 SubShapes_1.setBaseShape(model.selection("FACE", "Face_2_1"))
 model.end()