1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2016 CEA/DEN, EDF R&D
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.
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.
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
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Francis KLOSS : 2011-2013 : CEA-Saclay, DEN, DM2S, SFME, LGLS, F-91191 Gif-sur-Yvette, France
22 # =============================================================================================
26 geompy = hexablock.geompy
28 # Construire le modèle de bloc
29 # ============================
31 doc = hexablock.addDocument("bielle")
33 # Charger la géométrie
34 # ====================
36 bielle = geompy.ImportSTEP("bielle.stp")
37 shape = doc.addShape (bielle, "bielle")
40 # Sélectionner des sous-parties de la géométrie
41 # ---------------------------------------------
43 sommets = geompy.SubShapeAllIDs (bielle, geompy.ShapeType["VERTEX"])
44 aretes = geompy.SubShapeAllIDs (bielle, geompy.ShapeType["EDGE"])
46 print " ... Aretes = ", aretes
47 print " ... Sommets = ", sommets
49 nbfaces = shape.countFace ()
50 nbedges = shape.countEdge ()
51 nbvertex = shape.countVertex ()
53 for n in range (nbfaces) :
54 print " Face nro %d = %s" % (n , shape.getNameFace (n))
57 for n in range (nbedges) :
58 print " Edge nro %d = %s" % (n , shape.getNameEdge (n))
61 for n in range (nbvertex) :
62 print " Vertex nro %d = %s" % (n , shape.getNameVertex (n))