Salome HOME
1720eb325b71f162073f368aaf8c6ecbbc3f28c2
[modules/shaper.git] / src / FiltersPlugin / Test / Test17924.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("XOY"))
27 SketchEllipticArc_1 = Sketch_1.addEllipticArc(-10.32877055751729, 9.639944794047965, 15.50521682336113, 20.50671907502198, 14.00087220087917, 9.066138556306997, -21.07385236240306, -7.836309501397333, False)
28 [SketchPoint_1, SketchPoint_2, SketchPoint_3, SketchPoint_4, SketchPoint_5, SketchPoint_6, SketchPoint_7, SketchLine_1, SketchLine_2] = SketchEllipticArc_1.construction(center = "aux", firstFocus = "aux", secondFocus = "aux", majorAxisStart = "aux", majorAxisEnd = "aux", minorAxisStart = "aux", minorAxisEnd = "aux", majorAxis = "aux", minorAxis = "aux")
29 SketchLine_3 = Sketch_1.addLine(14.00087220087917, 9.066138556306999, -27.08576797296286, 16.56662668932342)
30 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchEllipticArc_1.startPoint(), SketchLine_3.startPoint())
31 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_3.endPoint(), SketchEllipticArc_1.result())
32 SketchLine_4 = Sketch_1.addLine(-21.07385236240307, -7.836309501397318, 6.541391110246827, 27.42439482327214)
33 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchEllipticArc_1.endPoint(), SketchLine_4.startPoint())
34 SketchConstraintCoincidence_4 = Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchEllipticArc_1.result())
35 model.do()
36 Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "Sketch_1")], model.selection(), 50, 0)
37 FilterFace = model.filters(Part_1_doc, [model.addFilter(name = "OnGeometry", args = [model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchEllipticArc_1")])])
38 model.end()
39
40 Reference = {
41     model.selection("FACE", "Extrusion_1_1_1/From_Face"): False,
42     model.selection("FACE", "Extrusion_1_1_1/To_Face"): False,
43     model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchEllipticArc_1"): True,
44     model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_4"): False,
45     model.selection("FACE", "Extrusion_1_1_1/Generated_Face&Sketch_1/SketchLine_3"): False,
46     model.selection("FACE", "Extrusion_1_1_2/To_Face"): False,
47     model.selection("FACE", "Extrusion_1_1_2/From_Face"): False,
48     model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchEllipticArc_1"): True,
49     model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_3"): False,
50     model.selection("FACE", "Extrusion_1_1_2/Generated_Face&Sketch_1/SketchLine_4"): False,
51     model.selection("FACE", "Extrusion_1_1_3/To_Face"): False,
52     model.selection("FACE", "Extrusion_1_1_3/From_Face"): False,
53     model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_4"): False,
54     model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchLine_3"): False,
55     model.selection("FACE", "Extrusion_1_1_3/Generated_Face&Sketch_1/SketchEllipticArc_1"): True
56 }
57
58 model.checkFilter(Part_1_doc, model, FilterFace, Reference)