- if HasAngles and Angles and LinearVariation:
- Angles = self.editor.LinearAnglesVariation( PathMesh, PathShape, Angles )
- pass
- if MakeGroups:
- return self.editor.ExtrusionAlongPathObjectMakeGroups(theObject, PathMesh,
- PathShape, NodeStart, HasAngles,
- Angles, HasRefPoint, RefPoint)
- return self.editor.ExtrusionAlongPathObject(theObject, PathMesh, PathShape,
- NodeStart, HasAngles, Angles, HasRefPoint,
- RefPoint)
-
- ## Generates new elements by extrusion of the elements which belong to the object
- # The path of extrusion must be a meshed edge.
- # @param theObject the object which elements should be processed.
- # It can be a mesh, a sub mesh or a group.
- # @param PathMesh mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
- # @param PathShape shape(edge) defines the sub-mesh for the path
- # @param NodeStart the first or the last node on the edge. Defines the direction of extrusion
- # @param HasAngles allows the shape to be rotated around the path
- # to get the resulting mesh in a helical fashion
- # @param Angles list of angles
- # @param HasRefPoint allows using the reference point
- # @param RefPoint the point around which the shape is rotated (the mass center of the shape by default).
- # The User can specify any point as the Reference Point.
- # @param MakeGroups forces the generation of new groups from existing ones
- # @param LinearVariation forces the computation of rotation angles as linear
- # variation of the given Angles along path steps
- # @return list of created groups (SMESH_GroupBase) and SMESH::Extrusion_Error if MakeGroups=True,
- # only SMESH::Extrusion_Error otherwise
- # @ingroup l2_modif_extrurev
+ return self.editor.ExtrusionAlongPathObjects(Nodes, Edges, Faces,
+ PathObject, PathShape, NodeStart,
+ HasAngles, Angles, LinearVariation,
+ HasRefPoint, RefPoint, MakeGroups,
+ ScaleFactors, ScalesVariation)
+
+ def ExtrusionAlongPathX(self, Base, Path, NodeStart,
+ HasAngles=False, Angles=[], LinearVariation=False,
+ HasRefPoint=False, RefPoint=[0,0,0], MakeGroups=False,
+ ElemType=SMESH.FACE):
+ """
+ Generate new elements by extrusion of the given elements.
+ The path of extrusion must be a meshed edge.
+
+ Parameters:
+ Base: :class:`mesh, sub-mesh, group, filter <SMESH.SMESH_IDSource>`, or list of ids of elements for extrusion
+ Path: 1D mesh or 1D sub-mesh, along which proceeds the extrusion
+ NodeStart: the start node from Path. Defines the direction of extrusion
+ HasAngles: not used obsolete
+ Angles: list of angles in radians. Nodes at each extrusion step are rotated
+ around *basePoint*, additionally to previous steps.
+ LinearVariation: forces the computation of rotation angles as linear
+ variation of the given Angles along path steps
+ HasRefPoint: allows using the reference point
+ RefPoint: the reference point around which the elements are rotated (the mass
+ center of the elements by default).
+ The User can specify any point as the Reference Point.
+ *RefPoint* can be either GEOM Vertex, [x,y,z] or :class:`SMESH.PointStruct`
+ MakeGroups: forces the generation of new groups from existing ones
+ ElemType: type of elements for extrusion (if param Base is a mesh)
+
+ Returns:
+ list of created :class:`groups <SMESH.SMESH_GroupBase>` and
+ :class:`error code <SMESH.SMESH_MeshEditor.Extrusion_Error>`
+ if *MakeGroups* == True, only :class:`error code <SMESH.SMESH_MeshEditor.Extrusion_Error>`
+ otherwise
+ Example: :ref:`tui_extrusion_along_path`
+ """
+
+ n,e,f = [],[],[]
+ if ElemType == SMESH.NODE: n = Base
+ if ElemType == SMESH.EDGE: e = Base
+ if ElemType == SMESH.FACE: f = Base
+ gr,er = self.ExtrusionAlongPathObjects(n,e,f, Path, None, NodeStart,
+ HasAngles, Angles, LinearVariation,
+ HasRefPoint, RefPoint, MakeGroups)
+ if MakeGroups: return gr,er
+ return er
+
+ def ExtrusionAlongPath(self, IDsOfElements, PathMesh, PathShape, NodeStart,
+ HasAngles=False, Angles=[], HasRefPoint=False, RefPoint=[],
+ MakeGroups=False, LinearVariation=False):
+ """
+ Generate new elements by extrusion of the given elements.
+ The path of extrusion must be a meshed edge.
+
+ Parameters:
+ IDsOfElements: ids of elements
+ PathMesh: mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion
+ PathShape: shape (edge) defines the sub-mesh for the path
+ NodeStart: the first or the last node on the edge. Defines the direction of extrusion
+ HasAngles: not used obsolete
+ Angles: list of angles in radians. Nodes at each extrusion step are rotated
+ around *basePoint*, additionally to previous steps.
+ HasRefPoint: allows using the reference point
+ RefPoint: the reference point around which the shape is rotated (the mass center of the shape by default).
+ The User can specify any point as the Reference Point.
+ *RefPoint* can be either GEOM Vertex, [x,y,z] or :class:`SMESH.PointStruct`
+ MakeGroups: forces the generation of new groups from existing ones
+ LinearVariation: forces the computation of rotation angles as linear
+ variation of the given Angles along path steps
+
+ Returns:
+ list of created :class:`groups <SMESH.SMESH_GroupBase>` and
+ :class:`error code <SMESH.SMESH_MeshEditor.Extrusion_Error>`
+ if *MakeGroups* == True, only :class:`error code <SMESH.SMESH_MeshEditor.Extrusion_Error>` otherwise
+ Example: :ref:`tui_extrusion_along_path`
+ """
+
+ if not IDsOfElements:
+ IDsOfElements = [ self.GetMesh() ]
+ n,e,f = [],IDsOfElements,IDsOfElements
+ gr,er = self.ExtrusionAlongPathObjects(n,e,f, PathMesh, PathShape,
+ NodeStart, HasAngles, Angles,
+ LinearVariation,
+ HasRefPoint, RefPoint, MakeGroups)
+ if MakeGroups: return gr,er
+ return er
+
+ def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart,
+ HasAngles=False, Angles=[], HasRefPoint=False, RefPoint=[],
+ MakeGroups=False, LinearVariation=False):
+ """
+ Generate new elements by extrusion of the elements which belong to the object.
+ The path of extrusion must be a meshed edge.
+
+ Parameters:
+ theObject: the object whose elements should be processed.
+ It can be a :class:`mesh, sub-mesh, group or filter <SMESH.SMESH_IDSource>`.
+ PathMesh: mesh containing a 1D sub-mesh on the edge, along which the extrusion proceeds
+ PathShape: shape (edge) defines the sub-mesh for the path
+ NodeStart: the first or the last node on the edge. Defines the direction of extrusion
+ HasAngles: not used obsolete
+ Angles: list of angles in radians. Nodes at each extrusion step are rotated
+ around *basePoint*, additionally to previous steps.
+ HasRefPoint: allows using the reference point
+ RefPoint: the reference point around which the shape is rotated (the mass center of the shape by default).
+ The User can specify any point as the Reference Point.
+ *RefPoint* can be either GEOM Vertex, [x,y,z] or :class:`SMESH.PointStruct`
+ MakeGroups: forces the generation of new groups from existing ones
+ LinearVariation: forces the computation of rotation angles as linear
+ variation of the given Angles along path steps
+
+ Returns:
+ list of created :class:`groups <SMESH.SMESH_GroupBase>` and
+ :class:`error code <SMESH.SMESH_MeshEditor.Extrusion_Error>` if *MakeGroups* == True,
+ only :class:`error code <SMESH.SMESH_MeshEditor.Extrusion_Error>` otherwise
+ Example: :ref:`tui_extrusion_along_path`
+ """
+
+ n,e,f = [],theObject,theObject
+ gr,er = self.ExtrusionAlongPathObjects(n,e,f, PathMesh, PathShape, NodeStart,
+ HasAngles, Angles, LinearVariation,
+ HasRefPoint, RefPoint, MakeGroups)
+ if MakeGroups: return gr,er
+ return er
+