Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Groups
Importing and exporting meshes

Functions

def CreateMeshesFromUNV
 Create a Mesh object importing data from the given UNV file. More...
 
def CreateMeshesFromMED
 Create a Mesh object(s) importing data from the given MED file. More...
 
def CreateMeshesFromSAUV
 Create a Mesh object(s) importing data from the given SAUV file. More...
 
def CreateMeshesFromSTL
 Create a Mesh object importing data from the given STL file. More...
 
def CreateMeshesFromCGNS
 Create Mesh objects importing data from the given CGNS file. More...
 
def CreateMeshesFromGMF
 Create a Mesh object importing data from the given GMF file. More...
 
def ExportMED
 Export the mesh in a file in MED format allowing to overwrite the file if it exists or add the exported data to its contents. More...
 
def ExportSAUV
 Export the mesh in a file in SAUV format. More...
 
def ExportDAT
 Export the mesh in a file in DAT format. More...
 
def ExportUNV
 Export the mesh in a file in UNV format. More...
 
def ExportSTL
 Export the mesh in a file in STL format. More...
 
def ExportCGNS
 Export the mesh in a file in CGNS format. More...
 
def ExportGMF
 Export the mesh in a file in GMF format. More...
 
def ExportToMED
 Deprecated, used only for compatibility! Please, use ExportMED() method instead. More...
 

Detailed Description

These are methods of class smeshBuilder

Function Documentation

def CreateMeshesFromUNV (   self,
  theFileName 
)

Create a Mesh object importing data from the given UNV file.

Returns
an instance of Mesh class

References smeshBuilder.geompyD.

def CreateMeshesFromMED (   self,
  theFileName 
)

Create a Mesh object(s) importing data from the given MED file.

Returns
a tuple ( list of Mesh class instances, SMESH.DriverMED_ReadStatus )

References smeshBuilder.geompyD.

def CreateMeshesFromSAUV (   self,
  theFileName 
)

Create a Mesh object(s) importing data from the given SAUV file.

Returns
a tuple ( list of Mesh class instances, SMESH.DriverMED_ReadStatus )

References smeshBuilder.geompyD.

def CreateMeshesFromSTL (   self,
  theFileName 
)

Create a Mesh object importing data from the given STL file.

Returns
an instance of Mesh class

References smeshBuilder.geompyD.

def CreateMeshesFromCGNS (   self,
  theFileName 
)

Create Mesh objects importing data from the given CGNS file.

Returns
a tuple ( list of Mesh class instances, SMESH.DriverMED_ReadStatus )

References smeshBuilder.geompyD.

def CreateMeshesFromGMF (   self,
  theFileName 
)

Create a Mesh object importing data from the given GMF file.

GMF files must have .mesh extension for the ASCII format and .meshb for the binary format.

Returns
[ an instance of Mesh class, SMESH.ComputeError ]

References smeshBuilder.Concatenate(), and smeshBuilder.geompyD.

def ExportMED (   self,
  f,
  auto_groups = 0,
  version = MED_V2_2,
  overwrite = 1,
  meshPart = None,
  autoDimension = True,
  fields = [],
  geomAssocFields = '' 
)

Export the mesh in a file in MED format allowing to overwrite the file if it exists or add the exported data to its contents.

Parameters
fis the file name
auto_groupsboolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is auto_groups=False.
versionMED format version (MED_V2_1 or MED_V2_2, the latter meaning any current version). The parameter is obsolete since MED_V2_1 is no longer supported.
overwriteboolean parameter for overwriting/not overwriting the file
meshParta part of mesh (group, sub-mesh) to export instead of the mesh
autoDimensionif True (default), a space dimension of a MED mesh can be either
  • 1D if all mesh nodes lie on OX coordinate axis, or
  • 2D if all mesh nodes lie on XOY coordinate plane, or
  • 3D in the rest cases.
    If autoDimension is False, the space dimension is always 3.
fieldslist of GEOM fields defined on the shape to mesh.
geomAssocFieldseach character of this string means a need to export a corresponding field; correspondence between fields and characters is following:
  • 'v' stands for "_vertices _" field;
  • 'e' stands for "_edges _" field;
  • 'f' stands for "_faces _" field;
  • 's' stands for "_solids _" field.

References Mesh.GetIDSource().

def ExportSAUV (   self,
  f,
  auto_groups = 0 
)

Export the mesh in a file in SAUV format.

Parameters
fis the file name
auto_groupsboolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is auto_groups=false.
def ExportDAT (   self,
  f,
  meshPart = None 
)

Export the mesh in a file in DAT format.

Parameters
fthe file name
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

References Mesh.GetIDSource().

def ExportUNV (   self,
  f,
  meshPart = None 
)

Export the mesh in a file in UNV format.

Parameters
fthe file name
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

References Mesh.GetIDSource().

def ExportSTL (   self,
  f,
  ascii = 1,
  meshPart = None 
)

Export the mesh in a file in STL format.

Parameters
fthe file name
asciidefines the file encoding
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

References Mesh.GetIDSource().

def ExportCGNS (   self,
  f,
  overwrite = 1,
  meshPart = None 
)

Export the mesh in a file in CGNS format.

Parameters
fis the file name
overwriteboolean parameter for overwriting/not overwriting the file
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

References Mesh.GetIDSource(), and Mesh.mesh.

def ExportGMF (   self,
  f,
  meshPart = None 
)

Export the mesh in a file in GMF format.

GMF files must have .mesh extension for the ASCII format and .meshb for the bynary format. Other extensions are not allowed.

Parameters
fis the file name
meshParta part of mesh (group, sub-mesh) to export instead of the mesh

References Mesh.GetIDSource(), and Mesh.mesh.

def ExportToMED (   self,
  f,
  version = MED_V2_2,
  opt = 0,
  overwrite = 1,
  autoDimension = True 
)

Deprecated, used only for compatibility! Please, use ExportMED() method instead.

Export the mesh in a file in MED format allowing to overwrite the file if it exists or add the exported data to its contents

Parameters
fthe file name
versionMED format version (MED_V2_1 or MED_V2_2, the latter meaning any current version). The parameter is obsolete since MED_V2_1 is no longer supported.
optboolean parameter for creating/not creating the groups Group_On_All_Nodes, Group_On_All_Faces, ...
overwriteboolean parameter for overwriting/not overwriting the file
autoDimensionif True (default), a space dimension of a MED mesh can be either
  • 1D if all mesh nodes lie on OX coordinate axis, or
  • 2D if all mesh nodes lie on XOY coordinate plane, or
  • 3D in the rest cases.
    If autoDimension is False, the space dimension is always 3.