+ ## 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 )
+ return self.hyp
+
+ ## Sets/unsets a fixed point. The algorithm makes a plane of the grid pass
+ # through the fixed point in each direction at which the grid is defined
+ # by spacing
+ # @param p coordinates of the fixed point. Either SMESH.PointStruct or
+ # a vertex or 3 components of coordinates.
+ # @param toUnset defines whether the fixed point is defined or removed.
+ def SetFixedPoint( self, p, toUnset=False ):
+ import SMESH, GEOM
+ if toUnset:
+ if not self.hyp: return
+ p = SMESH.PointStruct(0,0,0)
+ elif hasattr( p, "__getitem__" ):
+ p = SMESH.PointStruct( p[0],p[1],p[2] )
+ elif isinstance( p, GEOM._objref_GEOM_Object ):
+ p = self.mesh.smeshpyD.GetPointStruct( p )
+ 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.SetFixedPoint( p, toUnset )
+ return self.hyp
+
+