+ def SplitVolumesIntoTetra(self, elems, method=smeshBuilder.Hex_5Tet ):
+ unRegister = genObjUnRegister()
+ if isinstance( elems, Mesh ):
+ elems = elems.GetMesh()
+ if ( isinstance( elems, list )):
+ elems = self.editor.MakeIDSource(elems, SMESH.VOLUME)
+ unRegister.set( elems )
+ self.editor.SplitVolumesIntoTetra(elems, method)
+
+ ## Splits hexahedra into prisms
+ # @param elems either a list of elements or a mesh or a group or a submesh or a filter
+ # @param startHexPoint a point used to find a hexahedron for which @a facetNormal
+ # gives a normal vector defining facets to split into triangles.
+ # @a startHexPoint can be either a triple of coordinates or a vertex.
+ # @param facetNormal a normal to a facet to split into triangles of a
+ # hexahedron found by @a startHexPoint.
+ # @a facetNormal can be either a triple of coordinates or an edge.
+ # @param method flags passing splitting method: smesh.Hex_2Prisms, smesh.Hex_4Prisms.
+ # smesh.Hex_2Prisms - to split the hexahedron into 2 prisms, etc.
+ # @param allDomains if @c False, only hexahedra adjacent to one closest
+ # to @a startHexPoint are split, else @a startHexPoint
+ # is used to find the facet to split in all domains present in @a elems.
+ # @ingroup l2_modif_cutquadr
+ def SplitHexahedraIntoPrisms(self, elems, startHexPoint, facetNormal,
+ method=smeshBuilder.Hex_2Prisms, allDomains=False ):
+ # IDSource
+ unRegister = genObjUnRegister()
+ if isinstance( elems, Mesh ):
+ elems = elems.GetMesh()
+ if ( isinstance( elems, list )):
+ elems = self.editor.MakeIDSource(elems, SMESH.VOLUME)
+ unRegister.set( elems )
+ pass
+ # axis
+ if isinstance( startHexPoint, geomBuilder.GEOM._objref_GEOM_Object):
+ startHexPoint = self.smeshpyD.GetPointStruct( startHexPoint )
+ elif isinstance( startHexPoint, list ):
+ startHexPoint = SMESH.PointStruct( startHexPoint[0],
+ startHexPoint[1],
+ startHexPoint[2])
+ if isinstance( facetNormal, geomBuilder.GEOM._objref_GEOM_Object):
+ facetNormal = self.smeshpyD.GetDirStruct( facetNormal )
+ elif isinstance( facetNormal, list ):
+ facetNormal = self.smeshpyD.MakeDirStruct( facetNormal[0],
+ facetNormal[1],
+ facetNormal[2])
+ self.mesh.SetParameters( startHexPoint.parameters + facetNormal.PS.parameters )
+
+ self.editor.SplitHexahedraIntoPrisms(elems, startHexPoint, facetNormal, method, allDomains)