X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBLSURFPlugin%2FBLSURFPluginBuilder.py;h=9fd78e96357fee5b910da555a083e5b7ce1be3fb;hb=a8bd0694f247ff64404cac9d60661022f38a117e;hp=f61279b6dc20f8e6147df3800933bfadde7f7924;hpb=954619f5f0632bf86d23984f0fd005372d6628e8;p=plugins%2Fblsurfplugin.git diff --git a/src/BLSURFPlugin/BLSURFPluginBuilder.py b/src/BLSURFPlugin/BLSURFPluginBuilder.py index f61279b..9fd78e9 100644 --- a/src/BLSURFPlugin/BLSURFPluginBuilder.py +++ b/src/BLSURFPlugin/BLSURFPluginBuilder.py @@ -22,6 +22,7 @@ # Python API for the MG-CADSurf meshing plug-in module. from salome.smesh.smesh_algorithm import Mesh_Algorithm +import GEOM LIBRARY = "libBLSURFEngine.so" @@ -695,6 +696,37 @@ class BLSURF_Algorithm(Mesh_Algorithm): self.Parameters().AddPreCadEdgesPeriodicity(theEdge1, theEdge2) pass + #----------------------------------------- + # Hyper-Patches + #----------------------------------------- + + ## Defines hyper-patches. A hyper-patch is a set of adjacent faces meshed as a whole, + # ignoring edges between them + # @param hyperPatchList : list of hyper-patches. A hyper-patch is defined as a list of + # faces or groups of faces. A face can be identified either as a GEOM object or + # a face ID (returned e.g. by geompy.GetSubShapeID( mainShape, subShape )). + # + # Example: cadsurf.SetHyperPatches([[ Face_1, Group_2 ],[ 13, 23 ]]) + def SetHyperPatches(self, hyperPatchList): + hpl = [] + for patch in hyperPatchList: + ids = [] + for face in patch: + if isinstance( face, int ): + ids.append( face ) + elif isinstance( face, GEOM._objref_GEOM_Object): + faces = self.mesh.geompyD.SubShapeAll( face, self.mesh.geompyD.ShapeType["FACE"] ) + for f in faces: + ids.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, f )) + else: + raise TypeError, \ + "Face of hyper-patch should be either ID or GEOM_Object, not %s" % type(face) + pass + hpl.append( ids ) + pass + self.Parameters().SetHyperPatches( hpl ) + return + #===================== # Obsolete methods #=====================