Skip to content
Prev 200048 / 398506 Next

R package for reading / writing 3D file (. PLY)

On 11/12/2009 11:37 AM, kvarpun wrote:
Okay, I understand now.  Yes, R can display 3D images based on lines and 
polygons using the rgl package or scatterplot3d or grid graphics, but 
those have nothing to do with PLY files.  As far as I know there is no 
existing code to read or write a PLY file, but from the look of it, it's 
a simple format and it wouldn't be hard to write input/output routines. 
  The likely problems are:

  - it's an open ended format, with each application allowed to define 
its own record types.  If your files come from an application that did 
that you may have trouble working out what was intended and reading it in.

  - some of the recommended elements are not supported in rgl or other 
3D renderers in R.  In particular, polygons with more than 4 vertices 
need to be decomposed into triangles or quads, and rgl knows nothing 
about refraction index:  you'd probably need a ray-tracing renderer for 
that.

  - rgl scenes contain text, and as far as I can see, there's no way to 
include that in a standard PLY file, so you'd need to invent your own 
record type for it.  Text is always hard to describe graphically, so 
this wouldn't be easy.

Duncan Murdoch