I am looking for a file format to output some 3D geometry. In my case, it only needs to handle very simple shapes - uniformly spaced and sized cubes at points in space. So far I've ended up just representing them as triangles or quads depending on what I can use.

I've tried Binary STL format which is decently compact, but has no support for colors.

Wavefront Object format (OBJ) and the material library (MTL) work well for color support, but there is no binary version as far as I know - making it very bulky.

Is there a file format that:

  • Is compact in size
  • Has some way to support colors
  • Can be opened by software like 3D Viewer, Paint 3D, or other common tools?

The PLY file format is a simple format similar to OBJ that allows arbitrary attributes (like colours) and has a binary mode.

  • $\begingroup$ The fact that it has an ASCII header for the binary format is a little frustrating, but I think I can work around that. Do you know how properties are handled for software that reads in PLY files? The header specifies where the properties are, what they apply to, and their size, but the names and types are arbitrary. How does any software deal with the fact that the colors could be called "red" "blue" and "green", or "rd" "bl" "gr" (or anything else), and they could be anything from uchar to float? How is that possible? $\endgroup$ – Tyler Shellberg Feb 27 '20 at 18:56
  • $\begingroup$ As a sidenote, can colors even be applied to faces? Or is the only option to define them per-vertex, or do some kind of user-defined elements? This is all a little confusing. $\endgroup$ – Tyler Shellberg Feb 27 '20 at 19:02
  • $\begingroup$ @TylerShellberg Unfortunately, you might have to rely on common practice for that, in the case of colours likely uchar red... That's the disadvantage of an entirely felxible file format like that. $\endgroup$ – Christian Rau Feb 27 '20 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.