/** * @param out * @throws IOException */ private int writeTriangles(PrintStream out, AmibeReader.SubMesh subMesh) throws IOException { int count = 1; if (subMesh.getNumberOfTrias() > 0) { IntFileReader trias = subMesh.getTriangles(); long nb = trias.size() / 3; for (int i = 0; i < nb; i++) { int n1 = trias.get(); int n2 = trias.get(); int n3 = trias.get(); if (n1 >= 0) MeshExporter.UNV.writeSingleTriangle(out, count, n1 + 1, n2 + 1, n3 + 1); count++; } } logger.log(Level.INFO, "Total number of triangles: {0}", count - 1); return count; }