+ return self.editor.ExtrusionSweepObjects( nodes, edges, faces,
+ StepVector, NbOfSteps,
+ scaleFactors, linearVariation, basePoint,
+ MakeGroups)
+
+
+ def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps, MakeGroups=False, IsNodes = False):
+ """
+ Generate new elements by extrusion of the elements with given ids
+
+ Parameters:
+ IDsOfElements: the list of ids of elements or nodes for extrusion
+ StepVector: vector or :class:`SMESH.DirStruct` or 3 vector components, defining
+ the direction and value of extrusion for one step (the total extrusion
+ length will be NbOfSteps * ||StepVector||)
+ NbOfSteps: the number of steps
+ MakeGroups: forces the generation of new groups from existing ones
+ IsNodes: is True if elements with given ids are nodes
+
+ Returns:
+ the list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True, empty list otherwise
+
+ Example: :ref:`tui_extrusion`
+ """
+ n,e,f = [],[],[]
+ if IsNodes: n = IDsOfElements
+ else : e,f, = IDsOfElements,IDsOfElements
+ return self.ExtrusionSweepObjects(n,e,f, StepVector, NbOfSteps, MakeGroups)
+
+ def ExtrusionByNormal(self, Elements, StepSize, NbOfSteps,
+ ByAverageNormal=False, UseInputElemsOnly=True, MakeGroups=False, Dim = 2):
+ """
+ Generate new elements by extrusion along the normal to a discretized surface or wire
+
+ Parameters:
+ Elements: elements to extrude - a list including ids, :class:`a mesh, sub-meshes, groups or filters <SMESH.SMESH_IDSource>`.
+ Only faces can be extruded so far. A sub-mesh should be a sub-mesh on geom faces.
+ StepSize: length of one extrusion step (the total extrusion
+ length will be *NbOfSteps* *StepSize*).
+ NbOfSteps: number of extrusion steps.
+ ByAverageNormal: if True each node is translated by *StepSize*
+ along the average of the normal vectors to the faces sharing the node;
+ else each node is translated along the same average normal till
+ intersection with the plane got by translation of the face sharing
+ the node along its own normal by *StepSize*.
+ UseInputElemsOnly: to use only *Elements* when computing extrusion direction
+ for every node of *Elements*.
+ MakeGroups: forces generation of new groups from existing ones.
+ Dim: dimension of elements to extrude: 2 - faces or 1 - edges. Extrusion of edges
+ is not yet implemented. This parameter is used if *Elements* contains
+ both faces and edges, i.e. *Elements* is a Mesh.
+
+ Returns:
+ the list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True,
+ empty list otherwise.
+ Example: :ref:`tui_extrusion`
+ """
+
+ unRegister = genObjUnRegister()
+ if isinstance( Elements, Mesh ):
+ Elements = [ Elements.GetMesh() ]
+ if isinstance( Elements, list ):
+ if not Elements:
+ raise RuntimeError("Elements empty!")
+ if isinstance( Elements[0], int ):
+ Elements = self.GetIDSource( Elements, SMESH.ALL )
+ unRegister.set( Elements )
+ if not isinstance( Elements, list ):
+ Elements = [ Elements ]
+ StepSize,NbOfSteps,Parameters,hasVars = ParseParameters(StepSize,NbOfSteps)
+ self.mesh.SetParameters(Parameters)
+ return self.editor.ExtrusionByNormal(Elements, StepSize, NbOfSteps,
+ ByAverageNormal, UseInputElemsOnly, MakeGroups, Dim)
+
+ def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps, MakeGroups=False, IsNodes=False):
+ """
+ Generate new elements by extrusion of the elements or nodes which belong to the object
+
+ Parameters:
+ theObject: the object whose elements or nodes should be processed.
+ It can be a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`.
+ StepVector: vector or :class:`SMESH.DirStruct` or 3 vector components, defining
+ the direction and value of extrusion for one step (the total extrusion
+ length will be NbOfSteps * ||StepVector||)
+ NbOfSteps: the number of steps
+ MakeGroups: forces the generation of new groups from existing ones
+ IsNodes: is True if elements to extrude are nodes
+
+ Returns:
+ list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True, empty list otherwise
+ Example: :ref:`tui_extrusion`
+ """
+
+ n,e,f = [],[],[]
+ if IsNodes: n = theObject
+ else : e,f, = theObject,theObject
+ return self.ExtrusionSweepObjects(n,e,f, StepVector, NbOfSteps, MakeGroups)
+
+ def ExtrusionSweepObject1D(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
+ """
+ Generate new elements by extrusion of edges which belong to the object
+
+ Parameters:
+ theObject: object whose 1D elements should be processed.
+ It can be a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`.
+ StepVector: vector or :class:`SMESH.DirStruct` or 3 vector components, defining
+ the direction and value of extrusion for one step (the total extrusion
+ length will be NbOfSteps * ||StepVector||)
+ NbOfSteps: the number of steps
+ MakeGroups: to generate new groups from existing ones
+
+ Returns:
+ list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True, empty list otherwise
+ Example: :ref:`tui_extrusion`
+ """
+
+ return self.ExtrusionSweepObjects([],theObject,[], StepVector, NbOfSteps, MakeGroups)
+
+ def ExtrusionSweepObject2D(self, theObject, StepVector, NbOfSteps, MakeGroups=False):
+ """
+ Generate new elements by extrusion of faces which belong to the object
+
+ Parameters:
+ theObject: object whose 2D elements should be processed.
+ It can be a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`.
+ StepVector: vector or :class:`SMESH.DirStruct` or 3 vector components, defining
+ the direction and value of extrusion for one step (the total extrusion
+ length will be NbOfSteps * ||StepVector||)
+ NbOfSteps: the number of steps
+ MakeGroups: forces the generation of new groups from existing ones
+
+ Returns:
+ list of created :class:`groups <SMESH.SMESH_GroupBase>` if *MakeGroups* == True, empty list otherwise
+ Example: :ref:`tui_extrusion`
+ """
+
+ return self.ExtrusionSweepObjects([],[],theObject, StepVector, NbOfSteps, MakeGroups)
+