X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_SWIG%2FGEOM_TestHealing.py;h=efb2f98d52b3197d51474067c468bab40e28b3e1;hb=46676347f26294f60ec56f5d31abb87bceebf317;hp=4b79515967d38f27337ae25e735386e3866da8be;hpb=8370b4a1c488f6ef18d8944869d6a8cd3a2d18d2;p=modules%2Fgeom.git diff --git a/src/GEOM_SWIG/GEOM_TestHealing.py b/src/GEOM_SWIG/GEOM_TestHealing.py index 4b7951596..efb2f98d5 100644 --- a/src/GEOM_SWIG/GEOM_TestHealing.py +++ b/src/GEOM_SWIG/GEOM_TestHealing.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -21,7 +21,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# GEOM_SWIG : binding of C++ implementaion with Python +# GEOM_SWIG : binding of C++ implementation with Python # File : GEOM_TestHealing.py # Author : Julia DOROVSKIKH # Module : GEOM @@ -51,12 +51,12 @@ def TestProcessShape (geompy): theShape = geompy.MakePrismVecH(face, edge, 130) #Check shape - print "Before ProcessShape:" + print("Before ProcessShape:") isValid = geompy.CheckShape(theShape) if isValid == 0: - print "The shape is not valid" + print("The shape is not valid") else: - print "The shape seems to be valid" + print("The shape seems to be valid") #Process Shape Operators = ["FixShape"] @@ -66,13 +66,13 @@ def TestProcessShape (geompy): PS = geompy.ProcessShape(theShape, Operators, Parameters, Values) #Check shape - print "After ProcessShape:" + print("After ProcessShape:") isValid = geompy.CheckShape(PS) if isValid == 0: - print "The shape is not valid" - raise RuntimeError, "It seems, that the ProcessShape() has failed" + print("The shape is not valid") + raise RuntimeError("It seems, that the ProcessShape() has failed") else: - print "The shape seems to be valid" + print("The shape seems to be valid") #Add In Study Id_Shape = geompy.addToStudy(theShape, "Invalid Shape") @@ -138,7 +138,7 @@ def TestSuppressInternalWires (geompy): nbw1 = nbw1 + 1 if nbw1 != 2: - raise RuntimeError, "GetFreeBoundary(f12) must return 2 closed wires, but returned ", nbw1 + raise RuntimeError("GetFreeBoundary(f12) must return 2 closed wires, but returned ").with_traceback(nbw1) #SuppressInternalWires face = geompy.SuppressInternalWires(f12, []) @@ -154,8 +154,8 @@ def TestSuppressInternalWires (geompy): nbw2 = nbw2 + 1 if nbw2 != 1: - print "GetFreeBoundary(face) must return 1 closed wires, but returned ", nbw2 - raise RuntimeError, "SuppressInternalWires() works not correctly" + print("GetFreeBoundary(face) must return 1 closed wires, but returned ", nbw2) + raise RuntimeError("SuppressInternalWires() works not correctly") #Add In Study Id_face = geompy.addToStudy(face, "Face without internal wires") @@ -181,12 +181,12 @@ def TestCloseContour (geompy): Shape = geompy.MakePolyline([p0, pz, py, p200]) #Check shape - print "Before closing contour:" + print("Before closing contour:") isValid = geompy.CheckShape(Shape) if isValid == 0: - print "The shape is not valid" + print("The shape is not valid") else: - print "The shape seems to be valid" + print("The shape seems to be valid") #Close Contour IsCommonVertex = 0 # false @@ -202,13 +202,13 @@ def TestCloseContour (geompy): CC = geompy.CloseContour(Shape, Wires, IsCommonVertex) #Check shape - print "After closing contour:" + print("After closing contour:") isValid = geompy.CheckShape(CC) if isValid == 0: - print "The shape is not valid" - raise RuntimeError, "It seems, that the contour was not closed" + print("The shape is not valid") + raise RuntimeError("It seems, that the contour was not closed") else: - print "The shape seems to be valid" + print("The shape seems to be valid") #Add In Study Id_Shape = geompy.addToStudy(Shape, "Shape with open wire") @@ -243,7 +243,7 @@ def TestSuppressHoles (geompy): f_id = geompy.addToStudyInFather(Cut, face, f_name) f_glob_id = geompy.GetSubShapeID(Cut, face) - print "face ", ind, " global index = ", f_glob_id + print("face ", ind, " global index = ", f_glob_id) ind = ind + 1 f_glob_id_0 = geompy.GetSubShapeID(Cut, faces[0]) @@ -258,7 +258,7 @@ def TestSuppressHoles (geompy): f_id = geompy.addToStudyInFather(cut_without_f_0, face, f_name) f_glob_id = geompy.GetSubShapeID(cut_without_f_0, face) - print "face ", ind, " global index = ", f_glob_id + print("face ", ind, " global index = ", f_glob_id) ind = ind + 1 f_glob_id_3 = geompy.GetSubShapeID(cut_without_f_0, faces1[3]) @@ -274,7 +274,7 @@ def TestSuppressHoles (geompy): w_id = geompy.addToStudyInFather(cut_without_f_0_3, wire, w_name) w_glob_id = geompy.GetSubShapeID(cut_without_f_0_3, wire) - print "wire ", ind, " global index = ", w_glob_id + print("wire ", ind, " global index = ", w_glob_id) ind = ind + 1 w_3 = geompy.GetSubShapeID(cut_without_f_0_3, wires[3])