write_ply
write_ply(filename, vertices, faces=None, colors=None, cmap='BuGn')
Store triangle mesh into .ply file format
Writes a triangle mesh (optionally with per-vertex colors) into the ply file format, in a way consistent with, e.g., importing to Blender.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
Name of the file ending in ".ply" to which to write the mesh |
required |
vertices |
numpy double array
|
Matrix of mesh vertex coordinates |
required |
faces |
numpy int array, optional (default None)
|
Matrix of triangle face indices into vertices. If none, only the vertices will be written (e.g., a point cloud) |
None
|
colors |
numpy double array, optional (default None)
|
Array of per-vertex colors. It can be a matrix of per-row RGB values, or a vector of scalar values that gets transformed by a colormap. |
None
|
cmap |
str, optional (default 'BuGn')
|
Name of colormap used to transform the color values if they are a vector of scalar function values (if colors is a matrix of RGB values, this parameter will not be used). Should be a valid input to |
'BuGn'
|
See Also
write_mesh, colormap.
Notes
This function is not optimized and covers the very specific funcionality of saving a mesh with per-vertex coloring that can be imported into Blender or other software. If you wish to write a mesh for any other purpose, we strongly recommend you use write_mesh instead.
Examples:
TODO
Source code in src/gpytoolbox/write_ply.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|