1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2014-2020 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
22 from .geomsmesh import geompy
24 # -----------------------------------------------------------------------------
25 # --- identification des shapes modifiées par la duplication des noeuds de la face fissure (d'un coté de la face)
27 def shapesSurFissure(blocPartition, plane1, faceFissure, gencnt):
34 vertex = geompy.MakeVertexOnSurface(plane1, 0.5, 0.5)
35 normal = geompy.GetNormal(plane1, vertex)
36 extrusion = geompy.MakePrismVecH(plane1, normal, 100)
39 solids= geompy.GetShapesOnBox ( extrusion, blocPartition, geompy.ShapeType("SOLID"), GEOM.ST_ONIN )
41 sharedSolids += geompy.GetSharedShapes(faceFissure, solid, geompy.ShapeType["SOLID"])
42 logging.debug("sharedSolids %s",sharedSolids)
45 faces= geompy.GetShapesOnBox ( extrusion, blocPartition, geompy.ShapeType("FACE"), GEOM.ST_ONIN )
47 sharedFaces += geompy.GetSharedShapes(faceFissure, face, geompy.ShapeType["FACE"])
48 logging.debug("sharedFaces %s",sharedFaces)
51 edges= geompy.GetShapesOnBox ( extrusion, blocPartition, geompy.ShapeType("EDGE"), GEOM.ST_ONIN )
53 if not edge.IsSame(gencnt):
54 sharedEdges += geompy.GetSharedShapes(faceFissure, edge, geompy.ShapeType["EDGE"])
55 logging.debug("sharedEdges %s",sharedEdges)
57 shapesAModifier = [ sharedSolids, sharedFaces, sharedEdges]
58 return shapesAModifier