Class STLReader

java.lang.Object
toxi.geom.mesh.STLReader

public class STLReader extends Object
Utility class to read binary STL files and turn them into TriangleMesh instances.
  • Field Details

    • TRIANGLEMESH

      public static final Class<? extends Mesh3D> TRIANGLEMESH
    • WEMESH

      public static final Class<? extends Mesh3D> WEMESH
  • Constructor Details

    • STLReader

      public STLReader()
  • Method Details

    • loadBinary

      public Mesh3D loadBinary(InputStream stream, String meshName, Class<? extends Mesh3D> meshClass)
      Attempts to load an STL model from the given InputStream. Currently no exceptions are being thrown and the method will return null if anything goes wrong during parsing the mesh data.
      Parameters:
      stream -
      meshName -
      Returns:
      mesh instance or null if unsuccessful
    • loadBinary

      public Mesh3D loadBinary(InputStream stream, String meshName, int bufSize, Class<? extends Mesh3D> meshClass)
      Attempts to load an STL model from the given InputStream. Currently no exceptions are being thrown and the method will return null if anything goes wrong during parsing the mesh data.
      Parameters:
      stream -
      meshName -
      bufSize - size of the stream buffer
      Returns:
      mesh instance or null if unsuccessful
    • loadBinary

      public Mesh3D loadBinary(String fileName, Class<? extends Mesh3D> meshClass)
    • loadBinary

      public Mesh3D loadBinary(String fileName, int bufSize, Class<? extends Mesh3D> meshClass)
      Attempts to load an STL model from the given file path. Currently no exceptions are being thrown and the method will return null if anything goes wrong during parsing the mesh data.
      Parameters:
      fileName - file path to read model from
      Returns:
      mesh instance or null if unsuccessful