]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Test correction
authorvsv <vsv@opencascade.com>
Thu, 7 Jul 2022 14:37:12 +0000 (17:37 +0300)
committervsv <vsv@opencascade.com>
Thu, 7 Jul 2022 14:37:12 +0000 (17:37 +0300)
src/PythonAPI/Test/TestCR.py

index 1530ad34aa728e0cf72595d763fa22421f9f7dc7..8952537c9a34d8a37a0ba0644dde6e70b49b0244 100644 (file)
@@ -14,6 +14,10 @@ from salome.shaper import model, geom
 def GetShapeType(theShape):
     CR = geom.CanonicalRecognition()
     if CR.isPlane(theShape, 0.1)[0]:
+        if CR.isCircle(theShape, 0.1)[0]:
+            return ("Plane","Circle")
+        if CR.isEllipse(theShape, 0.1)[0]:
+            return ("Plane","Ellipse")
         return "Plane"
     if CR.isSphere(theShape, 0.1)[0]:
         return "Sphere"
@@ -23,10 +27,6 @@ def GetShapeType(theShape):
         return "Cylinder"
     if CR.isLine(theShape, 0.1)[0]:
         return "Line"
-    if CR.isCircle(theShape, 0.1)[0]:
-        return "Circle"
-    if CR.isEllipse(theShape, 0.1)[0]:
-        return "Ellipse"
     return "Not defined"
 
 
@@ -97,9 +97,9 @@ aEllipseShape = EllipseWire_1.defaultResult().shape()
 
 ### Check shapes types
 assert (GetShapeType(aPlaneShape) == "Plane")
-assert (GetShapeType(aCircleShape) == "Circle")
+assert (GetShapeType(aCircleShape)[1] == "Circle")
 assert (GetShapeType(aLineShape) == "Line")
 assert (GetShapeType(aCylinderShape) == "Cylinder")
 assert (GetShapeType(aSphereShape) == "Sphere")
 assert (GetShapeType(aConeShape) == "Cone")
-assert (GetShapeType(aEllipseShape) == "Ellipse")
+assert (GetShapeType(aEllipseShape)[1] == "Ellipse")