From 6254246a05a95a0dffcead2ae70135f688099179 Mon Sep 17 00:00:00 2001 From: cignoni Date: Mon, 28 May 2012 11:29:14 +0000 Subject: [PATCH] improved support of saving of polygonal meshes when kept using faux bits --- wrap/io_trimesh/export_off.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wrap/io_trimesh/export_off.h b/wrap/io_trimesh/export_off.h index 75838b24..54d89a5c 100644 --- a/wrap/io_trimesh/export_off.h +++ b/wrap/io_trimesh/export_off.h @@ -111,15 +111,17 @@ namespace vcg { if (mask &io::Mask::IOM_BITPOLYGONAL) { - + assert(tri::HasFFAdjacency(m)); std::vector polygon; - for(fi=m.face.begin();fi!=m.face.end();++fi) if (!fi->IsD()) fi->ClearV(); + tri::UpdateFlags::FaceClearV(m); for(fi=m.face.begin();fi!=m.face.end();++fi) if (!fi->IsD()) if (!fi->IsV()) { - assert(tri::HasFFAdjacency(m)); vcg::tri::PolygonSupport::ExtractPolygon(&*fi,polygon); - fprintf(fpout,"%d ", int(polygon.size()) ); - for (size_t i=0; iUberFlags() ); - fprintf(fpout,"\n"); + if(!polygon.empty()) + { + fprintf(fpout,"%d ", int(polygon.size()) ); + for (size_t i=0; iUberFlags() ); + fprintf(fpout,"\n"); + } } } else {