public static void exportSmf(List<Triangle> triangulation, OutputStream os) { exportSmf(triangulation, new OutputStreamWriter(os)); }
public static void exportTsin(DelaunayTriangulation dto, String tsinFile) throws IOException { exportTsin(dto, new FileWriter(tsinFile)); }
public static List<Point> readPoints(String file) throws IOException { return readPoints(new FileInputStream(file)); }
public static List<Point> readPoints(InputStream is) throws IOException { BufferedReader br = null; try { br = new BufferedReader(new InputStreamReader(is)); String s; while ((s = br.readLine()).startsWith("/")) { } if (s.equals("begin")) { return readSmf(br); } else if (Utils.isNumeric(s)) { return readTsin(br, s); } else { throw new UnsupportedFormatException("File format not recognized"); } } finally { Utils.closeQuietly(br); } }
public static void exportSmf(List<Triangle> triangulation, String smfFile) throws IOException { exportSmf(triangulation, new FileWriter(smfFile)); }
public static void exportTsin(DelaunayTriangulation dto, File tsinFile) throws IOException { exportTsin(dto, new FileWriter(tsinFile)); }
/** * creates a Delaunay Triangulation from all the points in the suggested * tsin file or from a smf file (off like). if the file name is .smf - read * it as an smf file as try to read it as .tsin <br> * Note: duplicated points are ignored! <br> * SMF file has an OFF like format (a face (f) is presented by the indexes * of its points - starting from 1 - not from 0): <br> * begin <br> * v x1 y1 z1 <br> * ... <br> * v xn yn zn <br> * f i11 i12 i13 <br> * ... <br> * f im1 im2 im3 <br> * end <br> * <br> * The tsin text file has the following (very simple) format <br> * vertices# (n) <br> * x1 y1 z1 <br> * ... <br> * xn yn zn <br> * * */ public static List<Point> readPoints(File file) throws IOException { return readPoints(new FileInputStream(file)); }
public static void exportSmf(List<Triangle> triangulation, File smfFile) throws IOException { exportSmf(triangulation, new FileWriter(smfFile)); }
public static void exportTsin(DelaunayTriangulation dto, OutputStream os) { exportTsin(dto, new OutputStreamWriter(os)); }