MeshVTK (class)¶
Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Mesh/MeshVTK
-
class
MeshVTK
(mesh=None, is_pyvista_mesh=False, format='vtk', path='', name='mesh', surf=None, is_vtk_surf=False, surf_path='', surf_name='surf', label=None, dimension=2, init_dict=None, init_str=None)[source]¶ Bases:
pyleecan.Classes.Mesh.Mesh
Gather the mesh storage format
-
VERSION
= 1¶
-
get_mesh_pv
(indices=None)¶ Return the pyvista mesh object (or submesh).
- Parameters
self (MeshVTK) – a MeshVTK object
indices (list) – list of the points to extract (optional)
- Returns
mesh – a pyvista UnstructuredGrid object
- Return type
pyvista.core.pointset.UnstructuredGrid
-
get_point
(indices=None)¶ Return the array of the points coordinates.
- Parameters
self (MeshVTK) – a MeshVTK object
indices (list) – list of the points to extract (optional)
- Returns
points – Points coordinates
- Return type
ndarray
-
get_cell
(indices=None)¶ Return the cells (connectivities).
- Parameters
self (MeshVTK) – a MeshVTK object
indices (list) – list of the points to extract (optional)
- Returns
cells – List of cell groups (type + array)
- Return type
list
-
get_normals
(indices=None, loc='center')¶ Return the array of the normals coordinates.
- Parameters
self (MeshVTK) – a MeshVTK object
indices (list) – list of the points to extract (optional)
loc (str) – localization of the normals (“center” or “point”)
- Returns
normals – Normals coordinates
- Return type
ndarray
-
get_surf
(indices=None)¶ Return the surf object if it was already extracted, or extracts it from the mesh.
- Parameters
self (MeshVTK) – a MeshVTK object
indices (list) – list of the points to extract (optional)
- Returns
surf – a pyvista polydata object
- Return type
pyvista.core.pointset.PolyData
-
get_cell_area
(indices=None)¶ Return the area of the cells on the outer surface.
- Parameters
self (MeshVTK) – a MeshVTK object
indices (list) – list of the points to extract (optional)
- Returns
areas – Area of the cells
- Return type
ndarray
-
convert
(meshtype, scale)¶ Convert this object to another type of Mesh object.
-
save
(save_path='', is_folder=False)¶ Save the object to the save_path
- Parameters
self – A pyleecan object
save_path (str) – path to the folder to save the object
is_folder (bool) – to split the object in different files: separate simulation machine and materials
-
copy
()¶ Return a copy of the class
-
get_logger
()¶ Get the object logger or its parent’s one
- Parameters
obj – A pyleecan object
- Returns
logger – Pyleecan object dedicated logger
- Return type
logging.Logger
-
property
mesh
¶ Pyvista object of the mesh (optional)
- Type
pyvista.core.pointset.PointGrid
-
property
is_pyvista_mesh
¶ Store the pyvista object
- Type
bool
-
property
format
¶ Format in which the mesh is stored
- Type
str
-
property
path
¶ Path where the mesh is stored
- Type
str
-
property
name
¶ Name of the mesh file
- Type
str
-
property
surf
¶ Pyvista object of the outer surface
- Type
pyvista.core.pointset.PolyData
-
property
is_vtk_surf
¶ Save the surface mesh in a vtk file
- Type
bool
-
property
surf_path
¶ Path where the outer surface is stored
- Type
str
-
property
surf_name
¶ Name of the outer surface file
- Type
str
-