How to write Ply file that includes triangulation?

11 ビュー (過去 30 日間)
OJ27
OJ27 2017 年 9 月 5 日
回答済み: raphael falque 2021 年 3 月 18 日
I have vertices, color, and triangulation of my 3D object. I have tried the pointCloud and pcwrite, but it only allows me to input vertices and color. When I try to load the ply file using Blender 2 things happen: -Colors are not properly read (only one color shows) -Points are not triangulated
  1 件のコメント
Dejan Dimitrijevic
Dejan Dimitrijevic 2019 年 3 月 19 日
編集済み: Dejan Dimitrijevic 2019 年 3 月 22 日
Were you able to do this please...I don't think Ning Zhang realized that the plywrite in MATLAB only writes the vertices with their colors, but there are no triangle face(t) elements being written...it's basically just the point cloud, and there is no surface afterwards, which you asked for (the triangulation besides the vertices)...
Nevermind, found this, though not clean, as plywrite might be, it can write faces too...just have to traverse surface now...or does someone know a simpler way?

サインインしてコメントする。

回答 (2 件)

Ning Zhang
Ning Zhang 2017 年 9 月 8 日
'pcread' should do the job for you to convert the PLY to MATLAB pointCloud Object
https://www.mathworks.com/help/vision/ref/pcread.html
To write to a PLY, which the Greg Turk's version of PLY is used in pcwrite, vertex number, position x y z, color RGB is all you need. Check the format of PLY in the following link:
If you try this following example in your Command Window
>> openExample('vision/WriteA3DPointCloudToAPLYFileExample')
In the opened script, if you change the encodingType from 'binary' to 'ascii'. You should be able to examine the XYZ and RGB values, once you generate the PLY
  1 件のコメント
raphael falque
raphael falque 2021 年 3 月 18 日
編集済み: raphael falque 2021 年 3 月 18 日
This does not include the triangulation

サインインしてコメントする。


raphael falque
raphael falque 2021 年 3 月 18 日
I added the color output to the write_ply from Gabriel Peyré over there: https://github.com/rFalque/3D_tools_matlab/blob/main/IO/write_ply.m

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by