module SMESH
{
+ enum Bnd_Dimension { BND_2DFROM3D, BND_1DFROM3D, BND_1DFROM2D };
+
/*!
* This interface makes modifications on the Mesh - removing elements and nodes etc.
*/
in GEOM::GEOM_Object theShape );
/*!
- * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * \brief Generates skin mesh (containing 2D cells) from 3D mesh
* The created 2D mesh elements based on nodes of free faces of boundary volumes
* \return TRUE if operation has been completed successfully, FALSE otherwise
*/
boolean Make2DMeshFrom3D();
+ /*!
+ * \brief Creates missing boundary elements
+ * \param elements - elements whose boundary is to be checked
+ * \param dimension - defines type of boundary elements to create
+ * \param groupName - a name of group to store created boundary elements in,
+ * "" means not to create the group
+ * \param meshName - a name of new mesh to store created boundary elements in,
+ * "" means not to create the new mesh
+ * \param toCopyElements - if true, the checked elements will be copied into the new mesh
+ * \param toCopyExistingBondary - if true, not only new but also pre-existing
+ * boundary elements will be copied into the new mesh
+ * \param group - returns the create group, if any
+ * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
+ */
+ SMESH::SMESH_Mesh MakeBoundaryMesh(in SMESH_IDSource elements,
+ in Bnd_Dimension dimension,
+ in string groupName,
+ in string meshName,
+ in boolean toCopyElements,
+ in boolean toCopyExistingBondary,
+ out SMESH_Group group);
+
};
};
::SMESH_MeshEditor aMeshEditor( myMesh );
bool aResult = aMeshEditor.Make2DMeshFrom3D();
storeResult( aMeshEditor) ;
-
+
TPythonDump() << "isDone = " << this << ".Make2DMeshFrom3D()";
return aResult;
}
+
+//================================================================================
+/*!
+ * \brief Creates missing boundary elements
+ * \param elements - elements whose boundary is to be checked
+ * \param dimension - defines type of boundary elements to create
+ * \param groupName - a name of group to store created boundary elements in,
+ * "" means not to create the group
+ * \param meshName - a name of new mesh to store created boundary elements in,
+ * "" means not to create the new mesh
+ * \param toCopyElements - if true, the checked elements will be copied into the new mesh
+ * \param toCopyExistingBondary - if true, not only new but also pre-existing
+ * boundary elements will be copied into the new mesh
+ * \param group - returns the create group, if any
+ * \retval SMESH::SMESH_Mesh - the mesh where elements were added to
+ */
+//================================================================================
+
+SMESH::SMESH_Mesh_ptr
+SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
+ SMESH::Bnd_Dimension dimension,
+ const char* groupName,
+ const char* meshName,
+ CORBA::Boolean toCopyElements,
+ CORBA::Boolean toCopyMissingBondary,
+ SMESH::SMESH_Group_out group)
+{
+
+ return SMESH::SMESH_Mesh::_duplicate( myMesh_i->_this() );
+}
const SMESH::ListOfGroups& theNodesNot,
GEOM::GEOM_Object_ptr theShape );
- /*!
- * \brief Generated skin mesh (containing 2D cells) from 3D mesh
- * The created 2D mesh elements based on nodes of free faces of boundary volumes
- * \return TRUE if operation has been completed successfully, FALSE otherwise
- */
- CORBA::Boolean Make2DMeshFrom3D();
-
- private: //!< private methods
+ /*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+ CORBA::Boolean Make2DMeshFrom3D();
+
+ SMESH::SMESH_Mesh_ptr MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
+ SMESH::Bnd_Dimension dimension,
+ const char* groupName,
+ const char* meshName,
+ CORBA::Boolean toCopyElements,
+ CORBA::Boolean toCopyMissingBondary,
+ SMESH::SMESH_Group_out group);
+
+private: //!< private methods
SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
# Methods of splitting a hexahedron into tetrahedra
Hex_5Tet, Hex_6Tet, Hex_24Tet = 1, 2, 3
+
## Converts an angle from degrees to radians
def DegreesToRadians(AngleInDegrees):
from math import pi
def SplitVolumesIntoTetra(self, elemIDs, method=Hex_5Tet ):
if isinstance( elemIDs, Mesh ):
elemIDs = elemIDs.GetMesh()
+ if ( isinstance( elemIDs, list )):
+ elemIDs = self.editor.MakeIDSource(elemIDs, SMESH.VOLUME)
self.editor.SplitVolumesIntoTetra(elemIDs, method)
## Splits quadrangle faces near triangular facets of volumes
# @ingroup l2_modif_edit
def Make2DMeshFrom3D(self):
return self.editor. Make2DMeshFrom3D()
-
+
+ ## Creates missing boundary elements
+ # @param elements - elements whose boundary is to be checked:
+ # mesh, group, sub-mesh or list of elements
+ # @param dimension - defines type of boundary elements to create:
+ # SMESH.BND_2DFROM3D, SMESH.BND_1DFROM3D, SMESH.BND_1DFROM2D
+ # @param groupName - a name of group to store created boundary elements in,
+ # "" means not to create the group
+ # @param meshName - a name of new mesh to store created boundary elements in,
+ # "" means not to create the new mesh
+ # @param toCopyElements - if true, the checked elements will be copied into the new mesh
+ # @param toCopyExistingBondary - if true, not only new but also pre-existing
+ # boundary elements will be copied into the new mesh
+ # @return tuple (mesh, group) where bondary elements were added to
+ # @ingroup l2_modif_edit
+ def MakeBoundaryMesh(self, elements, dimension=SMESH.BND_2DFROM3D, groupName="", meshName="",
+ toCopyElements=False, toCopyExistingBondary=False):
+ if isinstance( elements, Mesh ):
+ elements = elements.GetMesh()
+ if ( isinstance( elements, list )):
+ elements = self.editor.MakeIDSource(elements, SMESH.ALL)
+ return self.editor.MakeBoundaryMesh(elements,dimension,groupName,meshName,
+ toCopyElements,toCopyExistingBondary)
+
## Renumber mesh nodes
# @ingroup l2_modif_renumber
def RenumberNodes(self):