1 # Copyright (C) 2014-2023 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #=========================================================================
24 # Initialization of the test
25 #=========================================================================
31 from ModelAPI import *
32 from salome.shaper import model
35 __updated__ = "2020-11-12"
37 #=========================================================================
38 # Initialization of the test
39 #=========================================================================
41 partSet = model.moduleDocument()
44 Part_1 = model.addPart(partSet)
45 Part_1_doc = Part_1.document()
48 Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
51 #=========================================================================
52 # Test 1. Create a normal to a face with only a face
53 #=========================================================================
54 Normal_1 = model.getNormal(Part_1_doc, model.selection("FACE", "Box_1_1/Top"))
57 #=========================================================================
58 # Test 2. Create a normal to a face with a face and a vertex
59 #=========================================================================
60 Normal_2 = model.getNormal(Part_1_doc, model.selection("FACE", "Box_1_1/Front"), model.selection("VERTEX", "[Box_1_1/Front][Box_1_1/Right][Box_1_1/Bottom]"))
65 assert (len(Normal_1.results()) > 0)
66 assert(Normal_1.feature().error() == "")
67 anAxisResult = modelAPI_ResultConstruction(Normal_1.feature().firstResult())
68 assert (anAxisResult is not None)
70 assert (len(Normal_2.results()) > 0)
71 assert(Normal_2.feature().error() == "")
72 anAxisResult = modelAPI_ResultConstruction(Normal_2.feature().firstResult())
73 assert (anAxisResult is not None)
75 #=========================================================================
77 #=========================================================================