This function checks if the file is in ASCII format or in Binary format
It is done by searching keyword solid
at the start of the file.
An ASCII STL data must begin with solid
as the first six bytes. However, ASCII STLs lacking the SPACE after the d
are known to be plentiful. So, check the first 5 bytes for solid
.
Several encodings, such as UTF-8, precede the text with up to 5 bytes: https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding Search for solid
to start anywhere after those prefixes.
Examples
Syntax
isBinary()
Parameters
Related References
createModel
Load a 3d model from an OBJ or STL string.
isBinary
This function checks if the file is in ASCII format or in Binary format It is done by searching keyword solid at the start of the file.
loadModel
Loads a 3D model to create a p5.Geometry object.
matchDataViewAt
This function matches the query at the provided offset.