X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=test.models%2Fbearing_puller.py;h=393843543a7127c23fcbae3abeb37b5fd2f3a98d;hb=99ec31c777055dab5411d31bb490fee1935f31ce;hp=def5fb606a409486c900677be1de0dc2c4c346aa;hpb=544d1cc7666e4214148fc33a702f0a51225e79f5;p=modules%2Fshaper.git diff --git a/test.models/bearing_puller.py b/test.models/bearing_puller.py index def5fb606..393843543 100644 --- a/test.models/bearing_puller.py +++ b/test.models/bearing_puller.py @@ -1,3 +1,23 @@ +## 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 +## + from SketchAPI import * from salome.shaper import model @@ -79,14 +99,14 @@ SketchConstraintCoincidence_10 = Sketch_1.setCoincident(SketchLine_5.startPoint( 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_5")) +Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_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_6&Revolution_1_1/Generated_Face_5")) +SketchCircle_1 = Sketch_2.addCircle(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_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") @@ -96,7 +116,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_6&Revolution_1_1/Generated_Face_5")) +SketchCircle_2 = Sketch_2.addCircle(model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Revolution_1_1/Generated_Face_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_12 = Sketch_2.addLine(model.selection("EDGE", "PartSet/OX")) @@ -207,10 +227,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_2"), 10) +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) Boolean_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")]) Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_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", "Boolean_2_1/Modified_7"), model.selection("FACE", "Boolean_2_1/Modified_9")) +Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "Boolean_2_1/Modified_Face_7"), model.selection("FACE", "Boolean_2_1/Modified_Face_9")) 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) @@ -223,7 +243,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", "Boolean_2_1/Modified_23&Boolean_2_1/Modified_7")) +SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "Boolean_2_1/Modified_Face_17&Boolean_2_1/Modified_Face_7")) SketchLine_29 = SketchProjection_1.createdFeature() SketchLine_29.setName("SketchLine_26") SketchLine_29.result().setName("SketchLine_26") @@ -232,7 +252,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", "Boolean_1_1/Modified_6"), 5, model.selection("FACE", "Boolean_1_1/Modified_8"), 5) +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", "Boolean_1_1/Modified_Face_6"), 5, model.selection("FACE", "Boolean_1_1/Modified_Face_8"), 5) Boolean_3 = model.addCut(Part_1_doc, [model.selection("SOLID", "Boolean_2_1")], [model.selection("SOLID", "Extrusion_2_1"), model.selection("SOLID", "Extrusion_2_2")]) Recover_1 = model.addRecover(Part_1_doc, Boolean_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) @@ -289,8 +309,6 @@ SketchConstraintRadius_6 = Sketch_4.setRadius(SketchCircle_5.results()[1], "(b-a SketchConstraintTangent_6 = Sketch_4.setTangent(SketchCircle_5.results()[1], SketchLine_35.result()) SketchConstraintTangent_7 = Sketch_4.setTangent(SketchCircle_5.results()[1], SketchLine_30.result()) SketchConstraintTangent_8 = Sketch_4.setTangent(SketchCircle_5.results()[1], SketchLine_32.result()) -SketchConstraintCoincidence_43 = Sketch_4.setCoincident(SketchCircle_5.center(), SketchLine_36.result()) -SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_21") SketchLine_37 = Sketch_4.addLine(4.894344934278314, 2.394344934278312, 6.25, 0) SketchLine_37.setAuxiliary(True) SketchConstraintCoincidence_44 = Sketch_4.setCoincident(SketchLine_31.endPoint(), SketchLine_37.startPoint()) @@ -342,6 +360,8 @@ SketchConstraintCoincidence_60 = Sketch_4.setCoincident(SketchArc_13.startPoint( SketchConstraintCoincidence_60.setName("SketchConstraintCoincidence_48") SketchConstraintCoincidence_61 = Sketch_4.setCoincident(SketchArc_13.endPoint(), SketchArc_12.endPoint()) SketchConstraintCoincidence_61.setName("SketchConstraintCoincidence_49") +SketchConstraintCoincidence_43 = Sketch_4.setCoincident(SketchArc_13.center(), SketchLine_32.result()) +SketchConstraintCoincidence_43.setName("SketchConstraintCoincidence_21") SketchConstraintMirror_1 = Sketch_4.addMirror(SketchLine_40.result(), [SketchArc_13.results()[1], SketchArc_12.results()[1]]) [SketchArc_14, SketchArc_15] = SketchConstraintMirror_1.mirrored() SketchArc_15.setName("SketchArc_6") @@ -526,7 +546,7 @@ 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_5")) +Sketch_11 = model.addSketch(Part_5_doc, model.selection("FACE", "Revolution_1_1/Generated_Face_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")) @@ -568,7 +588,7 @@ 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_4&Extrusion_1_1/Generated_Face_3")) +SketchLine_109 = Sketch_12.addLine(model.selection("EDGE", "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_3")) 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")) SketchLine_110 = SketchProjection_2.createdFeature()