X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_SWIG%2FsmeshBuilder.py;h=6a1a4e1dffe12512924952abfda148165ba284fd;hb=7a713be33b27d6a8c77f983460f0e97e52c6ff7c;hp=6e0f59579baa41d3aac4cd8947262b06f25d36eb;hpb=90e0893c89027a434e832eb72eeac85391b909e9;p=modules%2Fsmesh.git diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 6e0f59579..6a1a4e1df 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -3290,7 +3290,7 @@ class Mesh: return self.editor.TriToQuadObject(theObject, Functor, MaxAngle) ## Split quadrangles into triangles. - # @param IDsOfElements the faces to be splitted. + # @param IDsOfElements the faces to be split. # @param theCriterion is a numerical functor, in terms of enum SMESH.FunctorType, used to # choose a diagonal for splitting. If @a theCriterion is None, which is a default # value, then quadrangles will be split by the smallest diagonal. @@ -3326,7 +3326,7 @@ class Mesh: ## Split each of given quadrangles into 4 triangles. A node is added at the center of # a quadrangle. - # @param theElements the faces to be splitted. This can be either mesh, sub-mesh, + # @param theElements the faces to be split. This can be either mesh, sub-mesh, # group or a list of face IDs. By default all quadrangles are split # @ingroup l2_modif_cutquadr def QuadTo4Tri (self, theElements=[]): @@ -3341,7 +3341,7 @@ class Mesh: return self.editor.QuadTo4Tri( theElements ) ## Split quadrangles into triangles. - # @param IDsOfElements the faces to be splitted + # @param IDsOfElements the faces to be split # @param Diag13 is used to choose a diagonal for splitting. # @return TRUE in case of success, FALSE otherwise. # @ingroup l2_modif_cutquadr @@ -3362,7 +3362,7 @@ class Mesh: return self.editor.SplitQuadObject(theObject, Diag13) ## Find a better splitting of the given quadrangle. - # @param IDOfQuad the ID of the quadrangle to be splitted. + # @param IDOfQuad the ID of the quadrangle to be split. # @param theCriterion is a numerical functor, in terms of enum SMESH.FunctorType, used to # choose a diagonal for splitting. # Type SMESH.FunctorType._items in the Python Console to see all items. @@ -4974,6 +4974,32 @@ class Mesh: def CreateHoleSkin(self, radius, theShape, groupName, theNodesCoords): return self.editor.CreateHoleSkin( radius, theShape, groupName, theNodesCoords ) + ## Create a polyline consisting of 1D mesh elements each lying on a 2D element of + # the initial mesh. Positions of new nodes are found by cutting the mesh by the + # plane passing through pairs of points specified by each PolySegment structure. + # If there are several paths connecting a pair of points, the shortest path is + # selected by the module. Position of the cutting plane is defined by the two + # points and an optional vector lying on the plane specified by a PolySegment. + # By default the vector is defined by Mesh module as following. A middle point + # of the two given points is computed. The middle point is projected to the mesh. + # The vector goes from the middle point to the projection point. In case of planar + # mesh, the vector is normal to the mesh. + # @param segments - PolySegment's defining positions of cutting planes. + # Return the used vector which goes from the middle point to its projection. + # @param groupName - optional name of a group where created mesh segments will + # be added. + # @ingroup l2_modif_duplicat + def MakePolyLine(self, segments, groupName='', isPreview=False ): + editor = self.editor + if isPreview: + editor = self.mesh.GetMeshEditPreviewer() + segmentsRes = editor.MakePolyLine( segments, groupName ) + for i, seg in enumerate( segmentsRes ): + segments[i].vector = seg.vector + if isPreview: + return editor.GetPreviewData() + return None + ## Return a cached numerical functor by its type. # @param theCriterion functor type - an item of SMESH.FunctorType enumeration. # Type SMESH.FunctorType._items in the Python Console to see all items.