Salome HOME
3b5da3fa17739a406aefc1e3cc43e340da495783
[modules/shaper.git] / src / ModelAPI / Test / TestWeakNaming2125.py
1 # Copyright (C) 2014-2023  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 from salome.shaper import model
21
22 model.begin()
23 partSet = model.moduleDocument()
24 Part_1 = model.addPart(partSet)
25 Part_1_doc = Part_1.document()
26 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("YOZ"))
27 SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "PartSet/Origin"))
28 SketchCircle_1 = Sketch_1.addCircle(0, 0, 207.1440202435477)
29 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
30 SketchCircle_2 = Sketch_1.addCircle(0, 0, 103.3027146966417)
31 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchCircle_2.center())
32 model.do()
33 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2r")], model.selection(), 410, 0)
34 Sketch_2 = model.addSketch(Part_1_doc, model.selection("FACE", "Extrusion_1_1/To_Face"))
35 SketchCircle_3 = Sketch_2.addCircle(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_2_2][Extrusion_1_1/To_Face]"))
36 SketchCircle_4 = Sketch_2.addCircle(model.selection("EDGE", "[Extrusion_1_1/Generated_Face&Sketch_1/SketchCircle_1_2][Extrusion_1_1/To_Face]"))
37 SketchArc_1 = Sketch_2.addArc(-76.31943784014528, 69.61892179185162, 22.73963059863011, 100.7688447087372, -98.26117835861398, -31.87776170424145, False)
38 SketchConstraintCoincidence_3 = Sketch_2.setCoincident(SketchCircle_3.results()[1], SketchArc_1.startPoint())
39 SketchConstraintCoincidence_4 = Sketch_2.setCoincident(SketchCircle_3.results()[1], SketchArc_1.endPoint())
40 SketchConstraintTangent_1 = Sketch_2.setTangent(SketchCircle_4.results()[1], SketchArc_1.results()[1])
41 SketchConstraintCoincidence_5 = Sketch_2.setCoincident(SketchArc_1.center(), SketchCircle_3.results()[1])
42 SketchArc_2 = Sketch_2.addArc(0, 0, 22.73963059863011, 100.7688447087372, -98.26117835861152, -31.87776170424295, False)
43 SketchConstraintCoincidence_6 = Sketch_2.setCoincident(SketchCircle_3.result(), SketchArc_2.center())
44 SketchConstraintCoincidence_7 = Sketch_2.setCoincident(SketchArc_1.startPoint(), SketchArc_2.startPoint())
45 SketchConstraintCoincidence_8 = Sketch_2.setCoincident(SketchArc_1.results()[1], SketchArc_2.endPoint())
46 model.do()
47 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [model.selection("FACE", "Sketch_2/Face-SketchArc_1_2f-SketchArc_2_2r")], model.selection(), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f-SketchCircle_2_2r"), 0, model.selection(), 0, [model.selection("SOLID", "Extrusion_1_1")])
48 Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", "ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face"))
49 SketchLine_1 = Sketch_3.addLine(72.49453964599654, -117.643151959956, 76.08424302289386, 111.5797586569786)
50 SketchArc_3 = Sketch_3.addArc(23.82028040531734, -147.9761102212422, 72.49453964599654, -117.643151959956, 29.20403695178628, -205.0750334594096, False)
51 SketchConstraintCoincidence_9 = Sketch_3.setCoincident(SketchLine_1.startPoint(), SketchArc_3.startPoint())
52 SketchProjection_1 = Sketch_3.addProjection(model.selection("EDGE", "[ExtrusionCut_1_1/Modified_Face&Extrusion_1_1/To_Face][ExtrusionCut_1_1/Modified_Face&Sketch_1/SketchCircle_1_2&weak_name_2]"), False)
53 SketchArc_4 = SketchProjection_1.createdFeature()
54 SketchConstraintCoincidence_10 = Sketch_3.setCoincident(SketchArc_3.endPoint(), SketchArc_4.results()[1])
55 model.do()
56 model.do()
57 model.end()
58
59 from ModelAPI import *
60 aFactory = ModelAPI_Session.get().validators()
61 assert(aFactory.validate(Sketch_3.feature()))