cellcomplex.property_topomesh.io module¶
PropertyTopomesh I/O¶
Implementing functions to read and write PropertyTopomesh objects in several standard mesh file formats, including PLY, OBJ or MSH.
|
Write a PropertyTopomesh as a standard PLY file. |
|
Read a PropertyTopomesh stored as a PLY file. |
-
cellcomplex.property_topomesh.io.multidim_data_ply_string(data)[source]¶ Convert a multidimensional data into a PLY-formatted string
- Parameters
data (
numpy.ndarray) –
-
cellcomplex.property_topomesh.io.read_msh_property_topomesh(msh_filename, preserve_cells=True, verbose=False)[source]¶
-
cellcomplex.property_topomesh.io.read_ply_property_topomesh(ply_filename, verbose=False, fuse_elements=True, fuse_vertices=True)[source]¶ Read a PropertyTopomesh stored as a PLY file.
Read an ASCII-encoded PLY file containing a cell complex. The file can be a regular mesh file with only vertex and face elements, but it can also contain edge and volume elements that define topological elements of dimensions 1 and 3 respectively. Associated properties can be of int, float, string, vector or tensor types.
- Parameters
ply_filename (str) – Path to the PLY file to read from
verbose (bool) – Whether to print all information read from the file
fuse_elements (bool) – Whether identical topological elements should be fused in a single wisp
fuse_vertices (bool) – Whether vertices at the same position should be fused in a single wisp
- Returns
topomesh – Cell complex with all the element properties read from the file
- Return type
cellcomplex.property_topomesh.PropertyTopomesh
-
cellcomplex.property_topomesh.io.save_obj_property_topomesh(topomesh, obj_filename, reorient_faces=False, verbose=False)[source]¶
-
cellcomplex.property_topomesh.io.save_ply_cellcomplex_topomesh(topomesh, ply_filename, properties_to_save={0: [], 1: ['length'], 2: ['area', 'epidermis'], 3: []}, color_faces=False, colormap=None, position_name='barycenter', oriented=True)[source]¶ Implementing the PLY standard defined at Saisnbury Computational Workshop 2015.
- Parameters
topomesh –
ply_filename –
properties_to_save –
color_faces –
colormap –
position_name –
oriented –
-
cellcomplex.property_topomesh.io.save_ply_property_topomesh(topomesh, ply_filename, properties_to_save={0: [], 1: ['length'], 2: ['area', 'epidermis'], 3: []}, position_name='barycenter', verbose=True)[source]¶ Write a PropertyTopomesh as a standard PLY file.
Save a PropertyTopomesh object into a ASCII-formatted PLY file with a subset of element properties written into the file. The written file is readable by other mesh processing tools, and contains all the necessary information to reconstruct the PropertyTopomesh including all topological relationships and element properties.
- Parameters
topomesh (
cellcomplex.property_topomesh.PropertyTopomesh) – The PropertyTopomesh instance to saveply_filename (str) – Path to the PLY file to write to
properties_to_save (dict) – Dictionary containing ,for each degree, the list of properties to write in the file
position_name (str) – Property name used to define the XYZ position of vertices (default : barycenter)
verbose (bool) – Whether to print information while writing the file