+ self.hyp.SetToAddEdges( implEdges )
+ return self.hyp
+
+ ## Defines custom directions of axes of the grid
+ # @param xAxis either SMESH.DirStruct or a vector, or 3 vector components
+ # @param yAxis either SMESH.DirStruct or a vector, or 3 vector components
+ # @param zAxis either SMESH.DirStruct or a vector, or 3 vector components
+ def SetAxesDirs( self, xAxis, yAxis, zAxis ):
+ import GEOM
+ if hasattr( xAxis, "__getitem__" ):
+ xAxis = self.mesh.smeshpyD.MakeDirStruct( xAxis[0],xAxis[1],xAxis[2] )
+ elif isinstance( xAxis, GEOM._objref_GEOM_Object ):
+ xAxis = self.mesh.smeshpyD.GetDirStruct( xAxis )
+ if hasattr( yAxis, "__getitem__" ):
+ yAxis = self.mesh.smeshpyD.MakeDirStruct( yAxis[0],yAxis[1],yAxis[2] )
+ elif isinstance( yAxis, GEOM._objref_GEOM_Object ):
+ yAxis = self.mesh.smeshpyD.GetDirStruct( yAxis )
+ if hasattr( zAxis, "__getitem__" ):
+ zAxis = self.mesh.smeshpyD.MakeDirStruct( zAxis[0],zAxis[1],zAxis[2] )
+ elif isinstance( zAxis, GEOM._objref_GEOM_Object ):
+ zAxis = self.mesh.smeshpyD.GetDirStruct( zAxis )
+ if not self.hyp:
+ self.hyp = self.Hypothesis("CartesianParameters3D")
+ if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
+ self.mesh.AddHypothesis( self.hyp, self.geom )
+ self.hyp.SetAxesDirs( xAxis, yAxis, zAxis )
+ return self.hyp
+
+ ## Automatically defines directions of axes of the grid at which
+ # a number of generated hexahedra is maximal
+ # @param isOrthogonal defines whether the axes mush be orthogonal
+ def SetOptimalAxesDirs(self, isOrthogonal=True):
+ if not self.hyp:
+ self.hyp = self.Hypothesis("CartesianParameters3D")
+ if not self.mesh.IsUsedHypothesis( self.hyp, self.geom ):
+ self.mesh.AddHypothesis( self.hyp, self.geom )
+ x,y,z = self.hyp.ComputeOptimalAxesDirs( self.geom, isOrthogonal )
+ self.hyp.SetAxesDirs( x,y,z )