]> SALOME platform Git repositories - modules/shaper.git/blob - src/FeaturesPlugin/Test/Test2617.py
Salome HOME
Merge branch 'V9_2_2_BR'
[modules/shaper.git] / src / FeaturesPlugin / Test / Test2617.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2018-2019  CEA/DEN, EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 from salome.shaper import model
22
23 model.begin()
24 partSet = model.moduleDocument()
25 Part_1 = model.addPart(partSet)
26 Part_1_doc = Part_1.document()
27 Cone_1 = model.addCone(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 10, 5, 10)
28 Translation_1 = model.addTranslation(Part_1_doc, [model.selection("SOLID", "Cone_1_1")], model.selection("EDGE", "PartSet/OX"), 5)
29 Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Translation_1_1")], model.selection("EDGE", "PartSet/OZ"), True)
30 Common_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Symmetry_1_1_2"), model.selection("SOLID", "Symmetry_1_1_1")])
31 model.do()
32 model.testHaveNamingSubshapes(Common_1, model, Part_1_doc)
33 model.end()
34
35 from GeomAPI import GeomAPI_Shape
36
37 model.testNbResults(Common_1, 1)
38 model.testNbSubResults(Common_1, [0])
39 model.testNbSubShapes(Common_1, GeomAPI_Shape.SOLID, [1])
40 model.testNbSubShapes(Common_1, GeomAPI_Shape.FACE, [3])
41 model.testNbSubShapes(Common_1, GeomAPI_Shape.EDGE, [8])
42 model.testNbSubShapes(Common_1, GeomAPI_Shape.VERTEX, [16])
43 model.testResultsVolumes(Common_1, [461.055845803990962394891539589])
44
45 assert(model.checkPythonDump())