Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / Test / Test2692.py
1 # Copyright (C) 2018-2023  CEA, EDF
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 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
27 LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("SOLID", "Box_1_1")], model.selection("EDGE", "PartSet/OY"), 20, 3)
28 ExtrusionCut_1_objects_2 = [model.selection("SOLID", "LinearCopy_1_1_2"), model.selection("SOLID", "LinearCopy_1_1_1"), model.selection("SOLID", "LinearCopy_1_1_3")]
29 ExtrusionCut_1 = model.addExtrusionCut(Part_1_doc, [], model.selection(), 0, 10, ExtrusionCut_1_objects_2)
30 Sketch_1 = model.addSketch(Part_1_doc, model.selection("FACE", "LinearCopy_1_1_2/MF:Translated_Face&Box_1_1/Top"))
31 SketchCircle_1 = Sketch_1.addCircle(4.871972805908816, 24.69028692663239, 2.754280056405151)
32 SketchCircle_2 = Sketch_1.addCircle(4.956613458332676, 4.459837610261877, 1.82794741094275)
33 SketchCircle_3 = Sketch_1.addCircle(4.842959508111481, 44.32940059836771, 3.136980464700132)
34 ExtrusionCut_1.setNestedSketch(Sketch_1)
35 model.do()
36 model.testHaveNamingSubshapes(ExtrusionCut_1, model, Part_1_doc)
37 model.end()
38
39 from GeomAPI import GeomAPI_Shape
40
41 model.testNbResults(ExtrusionCut_1, 1)
42 model.testNbSubResults(ExtrusionCut_1, [3])
43 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.SOLID, [3])
44 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.FACE, [21])
45 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.EDGE, [90])
46 model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.VERTEX, [180])
47 model.testResultsVolumes(ExtrusionCut_1, [2347.550996571865198347950354218])
48
49 assert(model.checkPythonDump())