Skip to content


Subversion checkout URL

You can clone with
Download ZIP


0071 ply ( Point export is broken #1252

laserpilot opened this Issue · 6 comments

4 participants

unsigned char faceSize = 3;
    os << "element face " << data.getNumIndices() / faceSize << endl;
    os << "property list uchar int vertex_indices" << endl;
} else if(data.getMode() == OF_PRIMITIVE_TRIANGLES) {
    os << "element face " << data.getNumVertices() / faceSize << endl;
    os << "property list uchar int vertex_indices" << endl;

The facesize is being set as static as 3, but this results in strange exports...things open OK in Meshlab, but exporting to other programs with no faces seems like it won't work


hi laserpilot, i'm not personally familiar with this, but (speaking without in-depth knowledge of the subject) i'd be surprised most 3D programs would know how to handle pure point clouds.

with which programs were you having trouble?

and when you say 'exporting to other programs' do you mean exporting from Meshlab to other programs, or loading the data saved by ofMesh directly in other programs?


exporting from meshlab to other programs.

Ie taking the .ply in Meshlab and exporting to a .obj or whatever else. Eventually want to be able to play with them I would always get a blank object in Maya, Blender, C4D and Autocad. The files currently generated from OF don't spit out faces properly, unless you do mesh.setupIndicesAuto() but then when you bring that into meshlab you get a garbled mass of triangles.


right, yes. AFAIK ofMesh currently doesn't have any way of automatically generating triangles that would form a surface that isn't a garbled mesh of triangles (actually i think that would be something of a difficult mathematical task).

if you're starting from a point cloud and you want a mesh then i suspect you will need to use a computational geometry library like CGAL to generate a non-intersecting mesh from your point cloud.

but if you want the points to look like points when you bring them into Maya/etc, these programs expect a 'mesh' with 'triangles', so i think you'll have to create individual sphere or cube meshes to represent each point in your original point cloud, and then export that.


ofMesh should correctly export any of the OF_PRIMITIVE_TRIANGLE* formats, but none of the LINE or POINT formats.

the reason is mostly that programs like blender/maya etc don't know what to do with lines and points. but maybe we can find an example of a point cloud .ply file that blender/maya can open, and then we can export something that looks similar?

@damiannz i just spoke to @laserpilot on skype and i think he meant something else about faces and setupIndicesAuto(). generating triangles from a point cloud is definitely a nontrivial and underconstrained task :)


right... perhaps we should be logging an error if someone tries to export LINE or POINT formats? something like exporting LINE or POINT, MeshLab can handle this but most other 3d applications probably can't?

i don't think Blender/Maya can open .ply files directly -- @laserpilot said he was passing them through MeshLab to generate a .obj file.


very smart, i think logging an error is a good first step. but it would be awesome to eventually support the line/point modes if we can find an example of blender/maya supporting them.

@bilderbuchi bilderbuchi modified the milestone: 0.9.0, 0.9.1
@kylemcdonald kylemcdonald modified the milestone: 0.9.3, 0.9.1, 0.9.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.