X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=test.models%2Fbearing_puller.py;h=cd6721ed0623b408dabd67520643ca0a1c7a2703;hb=f4eb5bbd469168e56d862bc5ca755528e7872c1c;hp=5a20aecd31e6bb88580ce41ec6c45385229da554;hpb=fc0fc28bf1527bda9b79e33694d412428e386508;p=modules%2Fshaper.git diff --git a/test.models/bearing_puller.py b/test.models/bearing_puller.py index 5a20aecd3..cd6721ed0 100644 --- a/test.models/bearing_puller.py +++ b/test.models/bearing_puller.py @@ -1,22 +1,21 @@ -## 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 -## 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 -## +# Copyright (C) 2014-2022 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 +# from SketchAPI import * @@ -98,15 +97,15 @@ SketchLine_7.result().setName("SketchLine_30") SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_5.startPoint(), SketchLine_7.result()) SketchConstraintCoincidence_10.setName("SketchConstraintCoincidence_35") model.do() -Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_4r-SketchArc_1_2f-SketchArc_2_2f-SketchLine_28r-SketchLine_29r")], model.selection("EDGE", "PartSet/OZ"), 360, 0) -Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_2")) +Revolution_1 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchArc_2_2f-SketchArc_1_2f-SketchLine_4r-SketchLine_29r-SketchLine_28r-SketchLine_2r-SketchLine_1r")], model.selection("EDGE", "PartSet/OZ"), 360, 0) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2")) SketchLine_8 = Sketch_2.addLine(0, 0, 25, 43.30127018922193) SketchLine_8.setName("SketchLine_5") SketchLine_8.result().setName("SketchLine_5") SketchLine_8.setAuxiliary(True) SketchPoint_3 = Sketch_2.addPoint(model.selection("VERTEX", "PartSet/Origin")) SketchConstraintCoincidence_11 = Sketch_2.setCoincident(SketchLine_8.startPoint(), SketchPoint_3.result()) -SketchCircle_1 = Sketch_2.addCircle(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1")) +SketchCircle_1 = Sketch_2.addCircle(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]")) SketchConstraintCoincidence_12 = Sketch_2.setCoincident(SketchLine_8.endPoint(), SketchCircle_1.results()[1]) SketchLine_9 = Sketch_2.addLine(39.43375672974064, -43.30127018922192, 15.87711932209923, -2.499977343709401) SketchLine_9.setName("SketchLine_10") @@ -116,7 +115,7 @@ SketchLine_10.setName("SketchLine_6") SketchLine_10.result().setName("SketchLine_6") SketchLine_10.setAuxiliary(True) SketchConstraintCoincidence_13 = Sketch_2.setCoincident(SketchLine_10.startPoint(), SketchPoint_3.result()) -SketchCircle_2 = Sketch_2.addCircle(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_1")) +SketchCircle_2 = Sketch_2.addCircle(model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_2][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1]")) SketchConstraintCoincidence_14 = Sketch_2.setCoincident(SketchLine_10.endPoint(), SketchCircle_2.results()[1]) SketchLine_11 = Sketch_2.addLine(15.87713238415337, 2.499999967850816, 39.43375672974065, 43.30127018922192) SketchLine_11.setName("SketchLine_11") @@ -229,10 +228,10 @@ SketchLine_22.result().setName("SketchLine_19") SketchConstraintDistance_9 = Sketch_2.setDistance(SketchArc_9.center(), SketchPoint_3.coordinates(), 21) SketchConstraintDistance_9.setName("SketchConstraintDistance_8") model.do() -Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchLine_10r-SketchLine_11r-SketchArc_3_2f-SketchArc_4_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_14r-SketchArc_7_2f-SketchLine_15r-SketchArc_8_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_12r-SketchArc_5_2f-SketchLine_13r-SketchArc_6_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchArc_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchArc_9_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchArc_11_2f")], model.selection(), model.selection(), 10, model.selection("FACE", "Revolution_1_1/Generated_Face_5"), 10) +Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("WIRE", "Sketch_2/Face-SketchArc_4_2f-SketchLine_11r-SketchArc_3_2f-SketchLine_10r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchArc_7_2f-SketchLine_15r-SketchArc_8_2f-SketchLine_14r_wire"), model.selection("FACE", "Sketch_2/Face-SketchArc_5_2f-SketchLine_13r-SketchArc_6_2f-SketchLine_12r"), model.selection("FACE", "Sketch_2/Face-SketchLine_19f-SketchLine_20f-SketchLine_21f-SketchArc_10_2f"), model.selection("FACE", "Sketch_2/Face-SketchLine_16f-SketchLine_17f-SketchLine_18f-SketchArc_9_2f"), model.selection("WIRE", "Sketch_2/Face-SketchLine_22f-SketchLine_23f-SketchLine_24f-SketchArc_11_2f_wire")], model.selection(), model.selection(), 10, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_4"), 10) Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_4"), model.selection("SOLID", "Extrusion_1_5")]) Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_1_1")], [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_3"), model.selection("SOLID", "Extrusion_1_6")]) -Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cut_2_1/Modified_Face_7"), model.selection("FACE", "Cut_2_1/Modified_Face_9")) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Cut_2_1/Modified_Face&Sketch_2/SketchLine_21"), model.selection("FACE", "Cut_2_1/Modified_Face&Sketch_2/SketchLine_19")) Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "Plane_1")) SketchCircle_3 = Sketch_3.addCircle(25, -10, 4) SketchCircle_4 = Sketch_3.addCircle(40, -10, 4) @@ -245,7 +244,7 @@ SketchConstraintDistance_10 = Sketch_3.setDistance(SketchCircle_3.center(), Sket SketchConstraintDistance_10.setName("SketchConstraintDistance_9") SketchConstraintDistance_11 = Sketch_3.setDistance(SketchCircle_4.center(), SketchLine_28.result(), 40) SketchConstraintDistance_11.setName("SketchConstraintDistance_10") -SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Cut_2_1/Modified_Face_divided_20_e_15_1"), False) +SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Cut_2_1/Generated_Edge&Sketch_2/SketchLine_21&Sketch_1/SketchLine_2"), False) SketchLine_29 = SketchProjection_1.createdFeature() SketchLine_29.setName("SketchLine_26") SketchLine_29.result().setName("SketchLine_26") @@ -254,7 +253,7 @@ SketchConstraintDistance_12.setName("SketchConstraintDistance_11") SketchConstraintDistance_13 = Sketch_3.setDistance(SketchCircle_3.center(), SketchLine_29.result(), 10) SketchConstraintDistance_13.setName("SketchConstraintDistance_12") model.do() -Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2f"), model.selection("WIRE", "Sketch_3/Wire-SketchCircle_4_2f")], model.selection(), model.selection("FACE", "Cut_1_1/Modified_Face_6"), 5, model.selection("FACE", "Cut_1_1/Modified_Face_8"), 5) +Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_3/Face-SketchCircle_3_2r"), model.selection("WIRE", "Sketch_3/Face-SketchCircle_4_2f_wire")], model.selection(), model.selection("FACE", "Cut_1_1/Modified_Face&Sketch_2/SketchLine_11"), 5, model.selection("FACE", "Cut_1_1/Modified_Face&Sketch_2/SketchLine_13"), 5) Cut_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Cut_2_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) Recover_1 = model.addRecover(Part_1_doc, Cut_3, [Extrusion_2.results()[1], Extrusion_2.result()]) Rotation_1 = model.addRotation(Part_1_doc, [model.selection("SOLID", "Recover_1_1"), model.selection("SOLID", "Recover_1_2")], model.selection("EDGE", "PartSet/OZ"), 120) @@ -496,15 +495,15 @@ SketchConstraintCoincidence_97 = Sketch_5.setCoincident(SketchLine_49.endPoint() SketchConstraintCoincidence_97.setName("SketchConstraintCoincidence_75") SketchConstraintDistance_19 = Sketch_5.setDistance(SketchLine_49.endPoint(), SketchLine_41.result(), 10) model.do() -Face_1 = model.addFace(Part_2_doc, [model.selection("WIRE", "Sketch_1/Wire-SketchArc_1_2f-SketchArc_4_2f-SketchArc_5_2f-SketchArc_6_2f-SketchArc_7_2f-SketchArc_8_2f-SketchArc_9_2f-SketchArc_10_2f")]) -Axis_4 = model.addAxis(Part_2_doc, model.selection("FACE", "PartSet/XOZ"), model.selection("VERTEX", "Sketch_2/Vertex-SketchArc_3-SketchLine_20s")) +Face_1 = model.addFace(Part_2_doc, [model.selection("WIRE", "Sketch_1/Face-SketchArc_1_2f-SketchArc_7_2f-SketchArc_8_2f-SketchArc_9_2f-SketchArc_10_2f-SketchArc_6_2f-SketchArc_5_2f-SketchArc_4_2f_wire")]) +Axis_4 = model.addAxis(Part_2_doc, model.selection("FACE", "PartSet/XOZ"), model.selection("VERTEX", "Sketch_2/SketchArc_3")) Rotation_3 = model.addRotation(Part_2_doc, [model.selection("FACE", "Face_1_1")], model.selection("EDGE", "Axis_1"), -43.8752) -Pipe_1 = model.addPipe(Part_2_doc, [model.selection("FACE", "Rotation_1_1")], model.selection("EDGE", "Sketch_2/Edge-SketchArc_3_2")) -Extrusion_3 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_2/Wire-SketchCircle_2_2f"), model.selection("WIRE", "Sketch_2/Wire-SketchLine_14r-SketchLine_15r-SketchLine_16r-SketchLine_17r")], model.selection(), "Gap/2", "Gap/2") +Pipe_1 = model.addPipe(Part_2_doc, [model.selection("FACE", "Rotation_1_1")], model.selection("EDGE", "Sketch_2/SketchArc_3_2")) +Extrusion_3 = model.addExtrusion(Part_2_doc, [model.selection("WIRE", "Sketch_2/Face-SketchCircle_2_2f-SketchCircle_3_2r_wire"), model.selection("WIRE", "Sketch_2/Face-SketchLine_17r-SketchLine_16r-SketchLine_15r-SketchLine_14r_wire")], model.selection(), "Gap/2", "Gap/2") Fuse_1 = model.addFuse(Part_2_doc, [model.selection("SOLID", "Pipe_1_1")], [model.selection("SOLID", "Extrusion_1_1"), model.selection("SOLID", "Extrusion_1_2")]) Extrusion_4 = model.addExtrusion(Part_2_doc, [model.selection("FACE", "Sketch_2/Face-SketchCircle_3_2f")], model.selection(), "Gap", "Gap") Cut_1 = model.addCut(Part_2_doc, [model.selection("SOLID", "Fuse_1_1")], [model.selection("SOLID", "Extrusion_2_1")]) -Translation_1 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Cut_1_1")], model.selection("VERTEX", "Sketch_2/Edge-SketchCircle_2_2__cc"), model.selection("VERTEX", "Sketch_2/Vertex-SketchLine_21e")) +Translation_1 = model.addTranslation(Part_2_doc, [model.selection("SOLID", "Cut_1_1")], model.selection("VERTEX", "Sketch_2/SketchCircle_2_2__cc"), model.selection("VERTEX", "Sketch_2/SketchLine_21_EndVertex")) model.do() Part_3 = model.duplicatePart(Part_2) Part_3.setName("Arm 2") @@ -547,11 +546,11 @@ SketchConstraintCoincidence_238 = Sketch_10.setCoincident(SketchPoint_7.coordina SketchLine_99 = Sketch_10.addLine(model.selection("EDGE", "PartSet/OY")) SketchConstraintDistance_35 = Sketch_10.setDistance(SketchLine_98.endPoint(), SketchLine_99.result(), "Thickness") model.do() -Revolution_2 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_1r-SketchLine_2r-SketchLine_3r-SketchLine_4r-SketchLine_5r-SketchLine_6r")], model.selection("EDGE", "Sketch_1/Edge-SketchLine_6"), 360, 0) -Sketch_11 = model.addSketch(Part_5_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_1")) +Revolution_2 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_1/Face-SketchLine_6r-SketchLine_5r-SketchLine_4r-SketchLine_3r-SketchLine_2r-SketchLine_1r")], model.selection("EDGE", "Sketch_1/SketchLine_6"), 360, 0) +Sketch_11 = model.addSketch(Part_5_doc, model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_1")) SketchCircle_14 = Sketch_11.addCircle(0, 0, 8.5) SketchCircle_14.setAuxiliary(True) -SketchPoint_8 = Sketch_11.addPoint(model.selection("VERTEX", "Sketch_1/Vertex-SketchLine_1s-SketchLine_6e")) +SketchPoint_8 = Sketch_11.addPoint(model.selection("VERTEX", "Sketch_1/SketchLine_1_StartVertex")) SketchConstraintCoincidence_239 = Sketch_11.setCoincident(SketchCircle_14.center(), SketchPoint_8.result()) SketchConstraintRadius_18 = Sketch_11.setRadius(SketchCircle_14.results()[1], "(Rod+5)/2") SketchLine_100 = Sketch_11.addLine(-8.5, -4.907477288111821, -8.5, 4.907477288111821) @@ -579,7 +578,7 @@ SketchConstraintEqual_8 = Sketch_11.setEqual(SketchLine_101.result(), SketchLine SketchConstraintEqual_9 = Sketch_11.setEqual(SketchLine_102.result(), SketchLine_103.result()) SketchConstraintEqual_10 = Sketch_11.setEqual(SketchLine_103.result(), SketchLine_104.result()) model.do() -Extrusion_9 = model.addExtrusion(Part_5_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_8r-SketchLine_9r-SketchLine_10r-SketchLine_11r-SketchLine_12r-SketchLine_13r")], model.selection(), 25, 0) +Extrusion_9 = model.addExtrusion(Part_5_doc, [model.selection("FACE", "Sketch_2/Face-SketchLine_13r-SketchLine_12r-SketchLine_11r-SketchLine_10r-SketchLine_9r-SketchLine_8r")], model.selection(), 25, 0) Sketch_12 = model.addSketch(Part_5_doc, model.standardPlane("YOZ")) SketchLine_106 = Sketch_12.addLine(9.814954576223595, 48.99999999999999, 9.814954576223595, 52.35726558990813) SketchLine_107 = Sketch_12.addLine(9.814954576223595, 52.35726558990813, 4, 52.35726558990813) @@ -590,15 +589,15 @@ SketchConstraintCoincidence_248 = Sketch_12.setCoincident(SketchLine_106.startPo SketchConstraintHorizontal_20 = Sketch_12.setHorizontal(SketchLine_107.result()) SketchConstraintVertical_20 = Sketch_12.setVertical(SketchLine_106.result()) SketchConstraintAngle_8 = Sketch_12.setAngle(SketchLine_108.result(), SketchLine_107.result(), 30) -SketchLine_109 = Sketch_12.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_3")) +SketchLine_109 = Sketch_12.addLine(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_10][Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_9]")) SketchConstraintCoincidence_249 = Sketch_12.setCoincident(SketchLine_108.endPoint(), SketchLine_109.result()) -SketchProjection_2 = Sketch_12.addProjection(model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1")) +SketchProjection_2 = Sketch_12.addProjection(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_2/SketchLine_10][Extrusion_1_1/To_Face]"), False) SketchLine_110 = SketchProjection_2.createdFeature() SketchConstraintDistance_36 = Sketch_12.setDistance(SketchLine_110.result(), SketchLine_108.endPoint(), 1) SketchLine_111 = Sketch_12.addLine(model.selection("EDGE", "PartSet/OZ")) SketchConstraintDistance_37 = Sketch_12.setDistance(SketchLine_108.startPoint(), SketchLine_111.result(), 4) model.do() -Revolution_3 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_14f-SketchLine_15f-SketchLine_16f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) +Revolution_3 = model.addRevolution(Part_5_doc, [model.selection("FACE", "Sketch_3/Face-SketchLine_14r-SketchLine_15f-SketchLine_16f")], model.selection("EDGE", "PartSet/OZ"), 360, 0) Cut_12 = model.addCut(Part_5_doc, [model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")]) Cut_13 = model.addFuse(Part_5_doc, [model.selection("SOLID", "Cut_1_1"), model.selection("SOLID", "Revolution_1_1")], [])