Package toxi.geom.mesh
Class STLReader
java.lang.Object
toxi.geom.mesh.STLReader
Utility class to read binary STL files and turn them into
TriangleMesh
instances.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionloadBinary
(InputStream stream, String meshName, int bufSize, Class<? extends Mesh3D> meshClass) Attempts to load an STL model from the givenInputStream
.loadBinary
(InputStream stream, String meshName, Class<? extends Mesh3D> meshClass) Attempts to load an STL model from the givenInputStream
.loadBinary
(String fileName, int bufSize, Class<? extends Mesh3D> meshClass) Attempts to load an STL model from the given file path.loadBinary
(String fileName, Class<? extends Mesh3D> meshClass)
-
Field Details
-
TRIANGLEMESH
-
WEMESH
-
-
Constructor Details
-
STLReader
public STLReader()
-
-
Method Details
-
loadBinary
Attempts to load an STL model from the givenInputStream
. 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 givenInputStream
. 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
-
loadBinary
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
-