Salome HOME
22358: EDF SMESH: Body Fitting algorithm: origin point of grid defined by spacing
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index 4e7c418e494ef2d46f09308338661fd1b08fecd8..779aeb24e2790f16e160c342bf73fb7dbb9c097b 100644 (file)
@@ -2431,8 +2431,8 @@ class Mesh:
     ## Returns three components of normal of given mesh face
     #  (or an empty array in KO case)
     #  @ingroup l1_meshinfo
-    def GetFaceNormal(self, faceId):
-        return self.mesh.GetFaceNormal(faceId)
+    def GetFaceNormal(self, faceId, normalized=False):
+        return self.mesh.GetFaceNormal(faceId,normalized)
 
     ## Returns an element based on all given nodes.
     #  @ingroup l1_meshinfo
@@ -3076,14 +3076,20 @@ class Mesh:
             pass
         # axis
         if isinstance( startHexPoint, geomBuilder.GEOM._objref_GEOM_Object):
-            startHexPoint = self.geompyD.PointCoordinates( startHexPoint )
+            startHexPoint = self.smeshpyD.GetPointStruct( startHexPoint )
+        elif isinstance( startHexPoint, list ):
+            startHexPoint = SMESH.PointStruct( startHexPoint[0],
+                                               startHexPoint[1],
+                                               startHexPoint[2])
         if isinstance( facetNormal, geomBuilder.GEOM._objref_GEOM_Object):
-            facetNormal = self.geompyD.VectorCoordinates( facetNormal )
-        axis = SMESH.AxisStruct( startHexPoint[0], startHexPoint[1], startHexPoint[2],
-                                 facetNormal[0],   facetNormal[1],   facetNormal[2])
-        self.mesh.SetParameters( axis.parameters )
-
-        self.editor.SplitHexahedraIntoPrisms(elems, method, axis, allDomains)
+            facetNormal = self.smeshpyD.GetDirStruct( facetNormal )
+        elif isinstance( facetNormal, list ):
+            facetNormal = self.smeshpyD.MakeDirStruct( facetNormal[0],
+                                                       facetNormal[1],
+                                                       facetNormal[2])
+        self.mesh.SetParameters( startHexPoint.parameters + facetNormal.PS.parameters )
+
+        self.editor.SplitHexahedraIntoPrisms(elems, startHexPoint, facetNormal, method, allDomains)
 
     ## Splits quadrangle faces near triangular facets of volumes
     #