Hi, is there a simple way to export a triangle strip to .ply?
I’m using ofxPoly to give thickness to polylines. It creates meshes which display fine in OF, but if you save them to .ply they only contain vertices, no faces. Loaded in blender they are just a set of points.
I can rewrite the code to export triangles, but I’m wondering if there’s an simpler approach? And what’s the issue? Maybe the exporter not knowing what to do with strips?
I’ll post one more solution to convert a triangle-strip-mesh into a triangles-mesh by producing indices while keeping the vertices untouched. In case anyone has use for it.
void stripToTriangles(ofMesh & m) {
u_int numVert = static_cast<u_int>(m.getNumVertices());
if(m.getMode() == OF_PRIMITIVE_TRIANGLE_STRIP && numVert >= 4) {
m.clearIndices();
for(u_int i = 0; i < numVert - 2; i += 2) {
m.addIndices({ i, i + 1, i + 2, i + 3, i + 2, i + 1 });
}
m.setMode(OF_PRIMITIVE_TRIANGLES);
}
}