I had some code that wrote skeletons to ply using tinyPLY. Recently, CGAL has added IO for several formats, including PLY. Out of curiosity, I thought I would use the built-in methods and try and remove tinyPly. I need to write both surface_mesh and skeletons derived from CGAL::Mean_curvature_flow_skeletonization. Saving the surface_mesh worked very well, and simplified my code.. Nice! (just calling CGAL::IO::write_PLY(outputStream, mesh);)
For the skeleton, if I try and call the same I get compilation errors. I figured one way around would be just to convert the skeleton to a surface_mesh by iterating through the verts and edges of the skeleton and adding them to a newly constructed surface_mesh, then calling write_PLY. This kind of works.. but only the vertices and not the edges are written, though I have confirmed that the mesh object has the appropriate number of edges/halfedges.
So the question: Is there a way that I can call CGAL::IO::write_PLY directly on the skeleton and get it to compile correctly? And/or is there a different type that I could convert my skeleton too that would write correctly? I know I can go back to tinyPLY, but I figured that figuring this out might help me better understand the data structure and simplify the code.
The specific compilation error when calling CGAL::IO::write_PLY(outputStream, skeleton) are:
C2146 syntax error: missing ';' before identifier 'Point_3'
And this is called on line 336 of PLY.H :
typedef typename boost::property_traits<Vpm>::reference Point_3;
I understand that this means that reference is likely not defined, but I can't figure out what to do about it...