java.lang.Object
simpa.core.api.utils.TextStlReader
Utility specific for reading STL files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet
Creates a PolyhedronSet from an STL file.org.apache.commons.math3.geometry.euclidean.threed.PolyhedronsSet
Creates a PolyhedronsSet from an STL text file.List
<int[]> getFaces()
List
<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> void
Reads the contents of an STL file.
-
Constructor Details
-
TextStlReader
public TextStlReader()Constructs the STL reader with empty lists.
-
-
Method Details
-
getVertices
- Returns:
- List of vertices.
-
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
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.
-