We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary STL meshes exported from Fusion360 not loaded by STLLoader.js
Fusion360 mesh.stl binary header:
STLB ATF 9.3.0.1241 COLOR=���� ��
STLLoader.js parseBinary function:
function isBinary( data ) { var expect, face_size, n_faces, reader; reader = new DataView( data ); face_size = ( 32 / 8 * 3 ) + ( ( 32 / 8 * 3 ) * 3 ) + ( 16 / 8 ); n_faces = reader.getUint32( 80, true ); expect = 80 + ( 32 / 8 ) + ( n_faces * face_size ); if ( expect === reader.byteLength ) { return true; }
... function parseBinary( data ) {
var reader = new DataView( data ); var faces = reader.getUint32( 80, true ); var r, g, b, hasColors = false, colors; var defaultR, defaultG, defaultB, alpha; // process STL header // check for default color in header ("COLOR=rgba" sequence). for ( var index = 0; index < 80 - 10; index ++ ) { if ( ( reader.getUint32( index, false ) == 0x434F4C4F /*COLO*/ ) && ( reader.getUint8( index + 4 ) == 0x52 /*'R'*/ ) && ( reader.getUint8( index + 5 ) == 0x3D /*'='*/ ) ) { hasColors = true; colors = []; defaultR = reader.getUint8( index + 6 ) / 255; defaultG = reader.getUint8( index + 7 ) / 255; defaultB = reader.getUint8( index + 8 ) / 255; alpha = reader.getUint8( index + 9 ) / 255; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Binary STL meshes exported from Fusion360 not loaded by STLLoader.js
Fusion360 mesh.stl binary header:
STLLoader.js parseBinary function:
...
function parseBinary( data ) {
The text was updated successfully, but these errors were encountered: