1 # Copyright (C) 2017-2023 CEA, EDF
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
20 """Test de la création de faces gauches"""
26 from SketchAPI import *
28 from salome.shaper import model
31 partSet = model.moduleDocument()
34 Part_1 = model.addPart(partSet)
35 Part_1_doc = Part_1.document()
40 l_coo.append((0, 0, 0))
41 l_coo.append((1, 8, 0))
42 l_coo.append((3, 10, 4))
43 l_coo.append((5, 5, 5))
44 l_coo.append((2, 3, 1))
45 for iaux, (coo_x,coo_y,coo_z) in enumerate(l_coo):
46 point = model.addPoint(Part_1_doc, coo_x,coo_y,coo_z)
47 nom = "P_{}".format(iaux)
49 point.result().setName(nom)
52 ### Create Interpolation
53 Interpolation_1_objects = list()
55 Interpolation_1_objects.append(model.selection("VERTEX", "all-in-{}".format(nom)))
56 Interpolation_1 = model.addInterpolation(Part_1_doc, Interpolation_1_objects, True, False)
59 Wire_1 = model.addWire(Part_1_doc, [model.selection("EDGE", "Interpolation_1_1")], False)
62 Face_1 = model.addFace(Part_1_doc, [model.selection("WIRE", "Wire_1_1")])
66 if salome.sg.hasDesktop():
67 salome.sg.updateObjBrowser()