From 5ec690fdf8f463a02c4e4d5505d5486b9a5bbd70 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Tue, 08 Jul 2014 16:21:14 +0000
Subject: [PATCH] Merge branch 'master' of bitbucket.org:samop/trisurf-ng into cross-section

---
 src/io.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/io.c b/src/io.c
index 76737ee..1bf5d4a 100644
--- a/src/io.c
+++ b/src/io.c
@@ -777,7 +777,7 @@
 	}
 
 	fprintf(fh, "<?xml version=\"1.0\"?>\n<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" compressor=\"vtkZLibDataCompressor\">\n <UnstructuredGrid>\n");
-    fprintf(fh, "<Piece NumberOfPoints=\"%u\" NumberOfCells=\"%u\">\n",vlist->n+monono*polyno+fonono*filno, blist->n+monono*polyno+filno*(fonono-1));
+    fprintf(fh, "<Piece NumberOfPoints=\"%u\" NumberOfCells=\"%u\">\n",vlist->n+monono*polyno+fonono*filno, blist->n+monono*polyno+filno*(fonono-1)+vesicle->tlist->n);
     fprintf(fh,"<PointData Scalars=\"scalars\">\n<DataArray type=\"Int64\" Name=\"scalars\" format=\"ascii\">");
    	for(i=0;i<vlist->n;i++){
 		fprintf(fh,"%u ",vtx[i]->idx);
@@ -854,8 +854,19 @@
 
 	}
 
+	//triangles
+	for(i=0;i<vesicle->tlist->n;i++){
+		fprintf(fh,"%u %u %u\n", vesicle->tlist->tria[i]->vertex[0]->idx,vesicle->tlist->tria[i]->vertex[1]->idx,vesicle->tlist->tria[i]->vertex[2]->idx);
+	}
+
+
     fprintf(fh,"</DataArray>\n<DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">");
     for (i=2;i<(blist->n+monono*polyno+(fonono-1)*filno)*2+1;i+=2){
+    fprintf(fh,"%u ",i);
+    }
+    //triangles
+	i++;
+    for(;i<(blist->n+monono*polyno+(fonono-1)*filno)*2+1+vesicle->tlist->n*3+1;i+=3){
     fprintf(fh,"%u ",i);
     }
     fprintf(fh,"\n");
@@ -863,6 +874,10 @@
      for (i=0;i<blist->n+monono*polyno+fonono*filno;i++){
         fprintf(fh,"3 ");
     }
+	//triangles
+	for(i=0;i<vesicle->tlist->n;i++){
+	fprintf(fh,"5 ");
+	}
 
     fprintf(fh,"</DataArray>\n</Cells>\n</Piece>\n</UnstructuredGrid>\n</VTKFile>\n");
     fclose(fh);

--
Gitblit v1.9.3