Python Forum
Saving an numpy.ndarray as .ply file in python
Thread Rating:
  • 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving an numpy.ndarray as .ply file in python
#1
hello,

I open an already existing .ply file and modify it in a loop working with the line in this file.
At the end, I have a numpy.ndarray that I would like to save as a .ply file.
How can I do this ?
numpy.ndarray looks like:
array(['ply\n', 'format ascii 1.0\n', 'element vertex 36\n',
       'property float x\n', 'property float y\n', 'property float z\n',
       'property float score\n', 'property float nx\n',
       'property float ny\n', 'property float nz\n',
       'property float size\n', 'property uchar red\n',
       'property uchar green\n', 'property uchar blue\n', 'end_header\n',
       '13.32 12.84 3.06 -0.352745 -0.230493 0.906887 20 0.74 255 255',
       '13.44 12.84 3.06 0.135449 -0.0514792 0.989446 20 0.25 255 255',
       '13.56 12.84 3.024 0.26937 -0.00564067 0.96302 20 0.34 255 255',
       '13.68 12.84 3 0.023836 0.341656 0.939523 20 0.96 255 255 0 \n',
       '13.8 12.84 3 0.17265 0.491562 0.853557 20 0.93 255 255 0 \n',
       '13.92 12.84 2.94 0.271418 0.421348 0.865331 20 0.55 255 255 0',
       '13.92 13.44 2.412 0.592844 0.469536 0.654272 1 0.28 255 0 0 \n',
       '\n'],
      dtype='|S61')
Reply


Messages In This Thread
Saving an numpy.ndarray as .ply file in python - by Tina - Oct-11-2017, 03:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Changing the content of the table and saving the new data into another file femke_pythonquestion123 1 1,620 Sep-18-2020, 12:06 PM
Last Post: femke_pythonquestion123
  Spyder: ndarray object of numpy module error python_newbie09 6 18,000 Jul-31-2019, 06:21 AM
Last Post: rohit_w
  Saving to Json file Shambob1874 1 2,509 May-30-2018, 10:00 PM
Last Post: micseydel
  Saving the results from an input in a txt. file pythonenthusiast 2 2,779 Nov-28-2017, 03:52 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020