Salome HOME
14b1ff4687f2c14bdd152173279dc0d3924ccfdc
[modules/shaper.git] / src / SketchPlugin / Test / Test3154.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 from salome.shaper import geom
22
23 from SketchAPI import *
24
25 model.begin()
26 partSet = model.moduleDocument()
27 Part_1 = model.addPart(partSet)
28 Part_1_doc = Part_1.document()
29 Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10)
30 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "Cylinder_1_1/Face_2"))
31 SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "[Cylinder_1_1/Face_1][Cylinder_1_1/Face_3]"), True)
32 SketchCircle_1 = SketchProjection_1.createdFeature()
33 SketchLine_1 = Sketch_1.addLine(-0.2715703110882526, -4.992619509449466, -1.152966889672805, 4.865251005995354)
34 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
35 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchCircle_1.results()[1])
36 model.do()
37
38 SketchSplit_1 = Sketch_1.addSplit(SketchAPI_Circle(SketchCircle_1), geom.Pnt2d(-5, 0))
39 model.end()
40
41 # check Split is invalid
42 assert(SketchSplit_1.feature().error() != "")