]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fixed measurements tests.
authordbv <dbv@opencascade.com>
Mon, 29 Oct 2018 15:10:38 +0000 (18:10 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/FeaturesPlugin/Test/TestMeasurementAngle.py
src/FeaturesPlugin/Test/TestMeasurementAngle3Points.py
src/FeaturesPlugin/Test/TestMeasurementDistance.py
src/FeaturesPlugin/Test/TestMeasurementLength.py
src/FeaturesPlugin/Test/TestMeasurementRadius.py

index bec25e1c22ec4a1e544afc74a0a15edb51fb6a5c..ec0b9d44498c66f85e8a3441e1fa82e65e1f3905 100644 (file)
@@ -1,4 +1,4 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+## Copyright (C) 2014-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
@@ -18,6 +18,8 @@
 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 ##
 
+# -*- coding: utf-8 -*-
+
 from SketchAPI import *
 
 from salome.shaper import model
@@ -28,9 +30,9 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-ParamR = model.addParameter(Part_1_doc, "R", "50")
-ParamL = model.addParameter(Part_1_doc, "L", "40")
-ParamH = model.addParameter(Part_1_doc, "H", "20")
+model.addParameter(Part_1_doc, "R", "50")
+model.addParameter(Part_1_doc, "L", "40")
+model.addParameter(Part_1_doc, "H", "20")
 Point_2 = model.addPoint(Part_1_doc, 0, 100, 100)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OX"), model.selection("VERTEX", "Point_1"), False)
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
@@ -59,8 +61,8 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
-Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 SketchLine_7 = Sketch_2.addLine(119.1454520140253, 130.0744845530344, 10, 0)
 SketchProjection_3 = Sketch_2.addProjection(model.selection("EDGE", "PartSet/OX"), False)
 SketchLine_8 = SketchProjection_3.createdFeature()
@@ -72,14 +74,14 @@ model.do()
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [("Sketch_1/Edge-SketchLine_3", "Sketch_1/Edge-SketchLine_6", [90]),
-            ("Extrusion_1_1/Generated_Face_5", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [45]),
-            ("Sketch_1/Edge-SketchCircle_1_2", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [0]),
-            ("Sketch_1/Edge-SketchLine_3", "Sketch_1/Edge-SketchCircle_1_2", []),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", []),
-            ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_4", [130]),
-            ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/To_Face_1&Extrusion_1_1/Generated_Face_1", [40]),
-            ("Sketch_2/Edge-SketchLine_7", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", [121.21205374, 84.80231126])
+REF_DATA = [("Sketch_1/SketchLine_3", "Sketch_1/SketchLine_6", [90]),
+            ("([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", [45]),
+            ("Sketch_1/SketchCircle_1_2", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", [0]),
+            ("Sketch_1/SketchLine_3", "Sketch_1/SketchCircle_1_2", []),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", []),
+            ("Sketch_2/SketchLine_7", "[Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]", [130]),
+            ("Sketch_2/SketchLine_7", "[Extrusion_1_1/To_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]", [40]),
+            ("Sketch_2/SketchLine_7", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", [121.21205374, 84.80231126])
            ]
 
 for ref in REF_DATA:
@@ -89,7 +91,7 @@ for ref in REF_DATA:
         assert(math.fabs(a - r) < TOLERANCE), "Angle {} differs from expected value {}".format(a, r)
 
 # select incorrect data
-angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("EDGE", "Sketch_2/Edge-SketchLine_7"))
+angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("EDGE", "Sketch_2/SketchLine_7"))
 assert(angle.size() == 0)
 
 model.end()
index c3f7fcc8e9aa553cf4a48b7985e03e3113ad4118..1e4fc4034961a96356638cb7321412da8ac59525 100644 (file)
@@ -1,4 +1,4 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+## Copyright (C) 2014-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
@@ -18,6 +18,8 @@
 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 ##
 
+# -*- coding: utf-8 -*-
+
 from SketchAPI import *
 
 from salome.shaper import model
@@ -55,43 +57,43 @@ SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/O
 SketchPoint_1 = SketchProjection_1.createdFeature()
 SketchConstraintCoincidence_7 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchAPI_Point(SketchPoint_1).coordinates())
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1f-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), 100, 0)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), 100, 0)
 model.do()
 
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1",
+REF_DATA = [("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]",
              120),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]",
              120),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6][Extrusion_1_1/From_Face]",
              60),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]",
              120),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]",
              104.9068234),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/To_Face]",
              90),
-            ("Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_4][Extrusion_1_1/From_Face]",
              52.91916441),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
-             "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1",
-             "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1",
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]",
+             "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]",
              0)
            ]
 
@@ -100,7 +102,7 @@ for ref in REF_DATA:
     assert(math.fabs(angle - ref[3]) < TOLERANCE), "Angle {} differs from expected value {}".format(angle, ref[3])
 
 # select incorrect data
-angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1"), model.selection("VERTEX", "Extrusion_1_1/Generated_Face_6&Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"))
+angle = model.measureAngle(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"), model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3][Extrusion_1_1/To_Face]"), model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_1][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_2][Extrusion_1_1/From_Face]"))
 assert(angle == -1.0)
 
 angle = model.measureAngle(Part_1_doc, model.selection("VERTEX", ""), model.selection("VERTEX", ""), model.selection("VERTEX", ""))
index c2b7d0a6a6f28425edfc8914e2e35668af114318..a5a4444aad26b52edb0bb3b1c52d02c2e4063fb5 100644 (file)
@@ -1,4 +1,4 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+## Copyright (C) 2014-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
@@ -18,6 +18,8 @@
 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 ##
 
+# -*- coding: utf-8 -*-
+
 from salome.shaper import model
 
 import math
@@ -26,9 +28,9 @@ model.begin()
 partSet = model.moduleDocument()
 Part_1 = model.addPart(partSet)
 Part_1_doc = Part_1.document()
-ParamR = model.addParameter(Part_1_doc, "R", "50")
-ParamL = model.addParameter(Part_1_doc, "L", "40")
-ParamH = model.addParameter(Part_1_doc, "H", "20")
+model.addParameter(Part_1_doc, "R", "50")
+model.addParameter(Part_1_doc, "L", "40")
+model.addParameter(Part_1_doc, "H", "20")
 Point_2 = model.addPoint(Part_1_doc, 0, 100, 100)
 Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OX"), model.selection("VERTEX", "Point_1"), False)
 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
@@ -57,7 +59,7 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
 Sketch_2 = model.addSketch(Part_1_doc, model.standardPlane("YOZ"))
 SketchArc_1 = Sketch_2.addArc(100, 48.41229182762603, 87.5, 0, 87.5, 96.82458365525073, False)
 SketchArc_2 = Sketch_2.addArc(0, 48.41229182762603, 87.5, 0, 87.5, 96.82458365525073, False)
@@ -87,34 +89,34 @@ TOLERANCE = 1.e-6
 
 # reference data
 REF_DATA = [(model.selection("VERTEX", "PartSet/Origin"),
-             model.selection("VERTEX", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"),
+             model.selection("VERTEX", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"),
              122.4744871),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1"),
-             model.selection("VERTEX", "Sketch_2/Vertex-SketchArc_1-SketchLine_7e"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"),
+             model.selection("VERTEX", "Sketch_2/SketchArc_1"),
              36.94403089),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"),
-             model.selection("EDGE", "Extrusion_1_1/Generated_Face_5"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"),
+             model.selection("EDGE", "([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])"),
              0),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"),
-             model.selection("EDGE", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/To_Face_1"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"),
+             model.selection("EDGE", "[Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_1_2][Extrusion_2_1/To_Face]"),
              16.00781059),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"),
-             model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"),
+             model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_1_2"),
              8.412291828),
-            (model.selection("VERTEX", "Sketch_1/Vertex-SketchCircle_1"),
+            (model.selection("VERTEX", "Sketch_1/SketchCircle_1_2__cc"),
              model.selection("FACE", "Plane_1"),
              35.35533906),
-            (model.selection("FACE", "Extrusion_2_2/From_Face_1"),
-             model.selection("FACE", "Extrusion_2_2/To_Face_1"),
+            (model.selection("FACE", "Extrusion_2_2/From_Face"),
+             model.selection("FACE", "Extrusion_2_2/To_Face"),
              100),
-            (model.selection("FACE", "Extrusion_1_1/Generated_Face_5"),
-             model.selection("FACE", "Extrusion_2_1/Generated_Face_2"),
+            (model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"),
+             model.selection("FACE", "Extrusion_2_1/Generated_Face&Sketch_2/SketchArc_1_2"),
              0),
-            (model.selection("FACE", "Extrusion_1_1/Generated_Face_5"),
-             model.selection("FACE", "Extrusion_1_1/Generated_Face_2"),
+            (model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"),
+             model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_5"),
              27.63932023),
             (model.selection("SOLID", "Extrusion_1_1"),
-             model.selection("FACE", "Extrusion_2_1/To_Face_1"),
+             model.selection("FACE", "Extrusion_2_1/To_Face"),
              12.5),
             (model.selection("SOLID", "Extrusion_1_1"),
              model.selection("SOLID", "Extrusion_2_1"),
index f557f8fde98eda4ba75723e1a709062c4b95a739..c85fb4a2ba549af46bb8fcc6b748d878daefaabd 100644 (file)
@@ -1,4 +1,4 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+## Copyright (C) 2014-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
@@ -18,6 +18,8 @@
 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 ##
 
+# -*- coding: utf-8 -*-
+
 from salome.shaper import model
 
 import math
@@ -57,20 +59,20 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
 model.do()
 
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [("Extrusion_1_1/From_Face_1&Extrusion_1_1/Generated_Face_1", ParamH.value()),
-            ("Extrusion_1_1/From_Face_1&Extrusion_1_1/Generated_Face_4", ParamL.value()),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1", ParamR.value() * 2.0 * math.pi),
-            ("Extrusion_1_1/Generated_Face_5&Extrusion_1_1/To_Face_1", 381.981436664),
-            ("Extrusion_1_1/Generated_Face_5", 60),
-            ("Sketch_1/Edge-SketchLine_3", ParamL.value()),
-            ("Sketch_1/Edge-SketchLine_4", ParamH.value()),
-            ("Sketch_1/Edge-SketchCircle_1_2", ParamR.value() * 2.0 * math.pi)
+REF_DATA = [("[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_6]", ParamH.value()),
+            ("[Extrusion_1_1/From_Face][Extrusion_1_1/Generated_Face&Sketch_1/SketchLine_3]", ParamL.value()),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]", ParamR.value() * 2.0 * math.pi),
+            ("[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]", 381.981436664),
+            ("([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face])([Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face])", 60),
+            ("Sketch_1/SketchLine_3", ParamL.value()),
+            ("Sketch_1/SketchLine_4", ParamH.value()),
+            ("Sketch_1/SketchCircle_1_2", ParamR.value() * 2.0 * math.pi)
            ]
 
 for ref in REF_DATA:
@@ -78,7 +80,7 @@ for ref in REF_DATA:
     assert(math.fabs(length - ref[1]) < TOLERANCE), "Length {} differs from expected value {}".format(length, ref[1])
 
 # select incorrect data
-length = model.measureLength(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_5"))
+length = model.measureLength(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"))
 assert(length == -1)
 
 model.end()
index a39927d460e1282450693f3a93fb80355684e0ab..c000dde790786ae99c503bd950e5c2c654d57a3b 100644 (file)
@@ -1,4 +1,4 @@
-## Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+## Copyright (C) 2014-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
@@ -18,6 +18,8 @@
 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 ##
 
+# -*- coding: utf-8 -*-
+
 from salome.shaper import model
 
 import math
@@ -57,15 +59,15 @@ SketchConstraintLength_2 = Sketch_1.setLength(SketchLine_4.result(), "H")
 SketchConstraintDistanceHorizontal_1 = Sketch_1.setHorizontalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "L/2")
 SketchConstraintDistanceVertical_1 = Sketch_1.setVerticalDistance(SketchLine_4.startPoint(), SketchCircle_1.center(), "H/2")
 model.do()
-Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2r-SketchLine_3f-SketchLine_4f-SketchLine_5f-SketchLine_6f")], model.selection(), model.selection("FACE", "Plane_1"), 0, model.selection(), 10)
 model.do()
 
 TOLERANCE = 1.e-6
 
 # reference data
-REF_DATA = [(model.selection("EDGE", "Sketch_1/Edge-SketchCircle_1_2"), ParamR.value()),
-            (model.selection("EDGE", "Extrusion_1_1/Generated_Face_5&Extrusion_1_1/From_Face_1"), ParamR.value()),
-            (model.selection("FACE", "Extrusion_1_1/Generated_Face_5"), ParamR.value())
+REF_DATA = [(model.selection("EDGE", "Sketch_1/SketchCircle_1_2"), ParamR.value()),
+            (model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/From_Face]"), ParamR.value()),
+            (model.selection("FACE", "Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2"), ParamR.value())
            ]
 
 for ref in REF_DATA:
@@ -73,7 +75,7 @@ for ref in REF_DATA:
     assert(math.fabs(radius - ref[1]) < TOLERANCE), "Radius {} differs from expected value {}".format(radius, ref[1])
 
 # select incorrect data
-radius = model.measureRadius(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face_1"))
+radius = model.measureRadius(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
 assert(radius == -1)
 
 model.end()