Module simpa.core

Class TextStlReader

java.lang.Object
simpa.core.api.utils.TextStlReader

public class TextStlReader extends Object
Utility specific for reading STL files.
  • Constructor Details

    • TextStlReader

      public TextStlReader()
      Constructs the STL reader with empty lists.
  • Method Details

    • getVertices

      public List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> getVertices()
      Returns:
      List of vertices.
    • getFaces

      public List<int[]> getFaces()
      Returns:
      List of integer arrays with the indexes of the vertices consisting of the faces.
    • createStlObject

      public org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet createStlObject(String fn) throws IOException
      Creates a PolyhedronsSet from an STL text file. The PolyhedronsSet is useful for us, because it has the checkPoint(Point of type P) method, which tells if a point is inside or outside of the surface described by the STL file.. For the STL file format see: https://en.wikipedia.org/wiki/STL_(file_format)
      Parameters:
      fn - input file name
      Returns:
      PolyhedronsSet
      Throws:
      IOException - if there are problems with the file
    • createStlObject

      public org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet createStlObject(InputStream is) throws IOException
      Creates a PolyhedronSet from an STL file.
      Parameters:
      is - input stream of the input STL file.
      Returns:
      a polyhedronset constructed from the STL file.
      Throws:
      IOException - if there are problems with the file
    • readStlFile

      public void readStlFile(InputStream is) throws IOException
      Reads the contents of an STL file.
      Parameters:
      is - input stream of the input STL file.
      Throws:
      IOException - if there are problems with the file.