cartoreader_lite.low_level.read_mesh¶
This file provides routines to read .mesh files from CARTO3
Functions
|
Reads a single mesh file in CARTO3 mesh format and returns it as a pyvista object |
|
Reads a single section of the .mesh files |
|
Converts the dataframe of the TrianglesSection into multiple numpy array |
|
- cartoreader_lite.low_level.read_mesh.read_section(lines: Iterable[str]) pandas.core.frame.DataFrame¶
Reads a single section of the .mesh files
- Parameters
lines (Iterable[str]) – The lines of the section
- Returns
The section data in a dataframe
- Return type
pd.DataFrame
- cartoreader_lite.low_level.read_mesh.read_tris(data: pandas.core.frame.DataFrame) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]¶
Converts the dataframe of the TrianglesSection into multiple numpy array
- Parameters
data (pd.DataFrame) – The data containing the TrianglesSection
- Returns
Returns the triplet (faces [Mx3], normals [Mx3], group-ID [M])
- Return type
Tuple[np.ndarray, np.ndarray, np.ndarray]
- cartoreader_lite.low_level.read_mesh.read_mesh_file(fname: str) Tuple[Union[pyvista.core.pointset.UnstructuredGrid, pyvista.core.pointset.PolyData], dict]¶
Reads a single mesh file in CARTO3 mesh format and returns it as a pyvista object
- Parameters
fname (str) – Filename of the mesh file
- Returns
Returns the constructred mesh from the data, along with the header data as a dictionary
- Return type
Tuple[Union[pv.UnstructuredGrid, pv.PolyData], dict]