Class IO

java.lang.Object
Jcg.mesh.IO

public class IO extends Object
Author:
Luca Castelli Aleardi This class provides input/output methods for dealing with plane and surface meshes (stored in various formats, e.g.: OFF, Metis, ...)
  • Constructor Details

    • IO

      public IO()
  • Method Details

    • writePolyedronToOFF

      public static void writePolyedronToOFF(Polyhedron_3 mesh, String filename)
      Output a 3D (surface) triangulation to OFF file

      Warning: only for triangle meshes (faces must be triangular)

      Parameters:
      mesh - a triangulation (Half-edge representation)
    • writeReversedPolyedronToOFF

      public static void writeReversedPolyedronToOFF(Polyhedron_3 mesh, String filename)
      Reverse the orientation of the input surface and output to OFF file.
      The orientation of the faces is reversed.

      Warnings:
      -) only for triangle meshes (faces must be triangular)
      -) the orientation of the input mesh remains unchanged

      Parameters:
      mesh - input triangulation (Half-edge representation)
    • writePolyedronToOFF

      public static void writePolyedronToOFF(Polyhedron_3 mesh, double[][] edgeColors, String filename)
      Output a 3D (surface) triangulation to OFF file
      Parameters:
      mesh - a triangulation (Half-edge representation)
      edgeColors - an array containing the colors of edges (one for each half-edge) warning: only for triangle meshes (faces must be triangular)
    • writePolyedronToMETIS

      public static void writePolyedronToMETIS(Polyhedron_3 mesh, String filename)
      Output a 3D (surface) mesh to METIS file

      Parameters:
      mesh - a triangulation (Half-edge representation)
    • writePolyedronToEDGES

      public static void writePolyedronToEDGES(Polyhedron_3 mesh, String filename, String separatingText)
      Output a 3D (surface) mesh as a list of EDGES (with vertices separated by commas)

      Indices of vertices start from 0

      Parameters:
      mesh - a triangulation (Half-edge representation)